From a8156c3aa90705bb35cb23b8b2383127304feb29 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 2 Aug 2024 11:40:21 +0100 Subject: [PATCH 001/108] Rename the plasma current calculation function and tests for readability --- process/physics.py | 4 +- process/utilities/errorlist.json | 2 +- tests/unit/test_physics.py | 68 ++++++++++++++++---------------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/process/physics.py b/process/physics.py index 47f19602f9..570d1df5b7 100644 --- a/process/physics.py +++ b/process/physics.py @@ -817,7 +817,7 @@ def physics(self): physics_variables.bp, physics_variables.qstar, physics_variables.plascur, - ) = self.culcur( + ) = self.calculate_plasma_current( physics_variables.alphaj, physics_variables.alphap, physics_variables.bt, @@ -1991,7 +1991,7 @@ def pohm(facoh, kappa95, plascur, rmajor, rminor, ten, vol, zeff): return pohmpv, pohmmw, rpfac, rplas @staticmethod - def culcur( + def calculate_plasma_current( alphaj, alphap, bt, diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index dafabd320e..96d7dbaf2f 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -393,7 +393,7 @@ { "no": 77, "level": 3, - "message": "CULCUR: Illegal value for icurr" + "message": "CALCULATE_PLASMA_CURRENT: Illegal value for icurr" }, { "no": 78, diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 125569741a..acd092cc1b 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -468,7 +468,7 @@ def test_bootstrap_fraction_sauter(bootstrapfractionsauterparam, monkeypatch, ph assert bfs == pytest.approx(bootstrapfractionsauterparam.expected_bfs) -class CulcurParam(NamedTuple): +class PlasmaCurrentParam(NamedTuple): normalised_total_beta: Any = None beta: Any = None @@ -523,9 +523,9 @@ class CulcurParam(NamedTuple): @pytest.mark.parametrize( - "culcurparam", + "plasmacurrentparam", ( - CulcurParam( + PlasmaCurrentParam( normalised_total_beta=0, beta=0.030000000000000006, icurr=4, @@ -553,7 +553,7 @@ class CulcurParam(NamedTuple): expected_qstar=2.9008029008029004, expected_plascur=18398455.678867526, ), - CulcurParam( + PlasmaCurrentParam( normalised_total_beta=2.4784688886891844, beta=0.030000000000000006, icurr=4, @@ -583,55 +583,55 @@ class CulcurParam(NamedTuple): ), ), ) -def test_culcur(culcurparam, monkeypatch, physics): +def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): """ - Automatically generated Regression Unit Test for culcur. + Automatically generated Regression Unit Test for calculate_plasma_current(). This test was generated using data from tests/regression/scenarios/large-tokamak/IN.DAT. - :param culcurparam: the data used to mock and assert in this test. - :type culcurparam: culcurparam + :param plasmacurrentparam: the data used to mock and assert in this test. + :type plasmacurrentparam: plasmacurrentparam :param monkeypatch: pytest fixture used to mock module/class variables :type monkeypatch: _pytest.monkeypatch.monkeypatch """ monkeypatch.setattr( - physics_variables, "normalised_total_beta", culcurparam.normalised_total_beta + physics_variables, "normalised_total_beta", plasmacurrentparam.normalised_total_beta ) - monkeypatch.setattr(physics_variables, "beta", culcurparam.beta) - - _, _, bp, qstar, plascur = physics.culcur( - icurr=culcurparam.icurr, - iprofile=culcurparam.iprofile, - alphaj=culcurparam.alphaj, - rli=culcurparam.rli, - alphap=culcurparam.alphap, - bt=culcurparam.bt, - eps=culcurparam.eps, - kappa=culcurparam.kappa, - kappa95=culcurparam.kappa95, - p0=culcurparam.p0, - pperim=culcurparam.pperim, - q0=culcurparam.q0, - q95=culcurparam.q95, - rmajor=culcurparam.rmajor, - rminor=culcurparam.rminor, - sf=culcurparam.sf, - triang=culcurparam.triang, - triang95=culcurparam.triang95, + monkeypatch.setattr(physics_variables, "beta", plasmacurrentparam.beta) + + _, _, bp, qstar, plascur = physics.calculate_plasma_current( + icurr=plasmacurrentparam.icurr, + iprofile=plasmacurrentparam.iprofile, + alphaj=plasmacurrentparam.alphaj, + rli=plasmacurrentparam.rli, + alphap=plasmacurrentparam.alphap, + bt=plasmacurrentparam.bt, + eps=plasmacurrentparam.eps, + kappa=plasmacurrentparam.kappa, + kappa95=plasmacurrentparam.kappa95, + p0=plasmacurrentparam.p0, + pperim=plasmacurrentparam.pperim, + q0=plasmacurrentparam.q0, + q95=plasmacurrentparam.q95, + rmajor=plasmacurrentparam.rmajor, + rminor=plasmacurrentparam.rminor, + sf=plasmacurrentparam.sf, + triang=plasmacurrentparam.triang, + triang95=plasmacurrentparam.triang95, ) assert physics_variables.normalised_total_beta == pytest.approx( - culcurparam.expected_normalised_total_beta + plasmacurrentparam.expected_normalised_total_beta ) - assert bp == pytest.approx(culcurparam.expected_bp) + assert bp == pytest.approx(plasmacurrentparam.expected_bp) - assert qstar == pytest.approx(culcurparam.expected_qstar) + assert qstar == pytest.approx(plasmacurrentparam.expected_qstar) - assert plascur == pytest.approx(culcurparam.expected_plascur) + assert plascur == pytest.approx(plasmacurrentparam.expected_plascur) @pytest.mark.parametrize( From 520f508a471127a3a47b56f903e18b7c7f3babfc Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 2 Aug 2024 14:25:12 +0100 Subject: [PATCH 002/108] Tidy up and re-format calculate_plasma_current: Type hints added, hard coded values replaced with constants variables, in-line commnets removed with increased spacing, import re-arranged in-line with PEP standards --- process/physics.py | 210 ++++++++++++++++++++++++--------------------- 1 file changed, 113 insertions(+), 97 deletions(-) diff --git a/process/physics.py b/process/physics.py index 0c6ddf02ad..59c76a19dc 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1,10 +1,13 @@ +import math +from typing import Tuple import numpy as np import numba as nb -import scipy.integrate as integrate from scipy.optimize import root_scalar -import math -import process.physics_functions as physics_funcs from process.utilities.f2py_string_patch import f2py_compatible_to_string + +import scipy.integrate as integrate + +import process.physics_functions as physics_funcs from process.fortran import ( constraint_variables, reinke_variables, @@ -2002,102 +2005,106 @@ def pohm(facoh, kappa95, plascur, rmajor, rminor, ten, vol, zeff): @staticmethod def calculate_plasma_current( - alphaj, - alphap, - bt, - eps, - icurr, - iprofile, - kappa, - kappa95, - p0, - pperim, - q0, - q95, - rli, - rmajor, - rminor, - sf, - triang, - triang95, - ): - """Routine to calculate the plasma current - author: P J Knight, CCFE, Culham Science Centre - alphaj : input/output real : current profile index - alphap : input real : pressure profile index - bt : input real : toroidal field on axis (T) - eps : input real : inverse aspect ratio - icurr : input integer : current scaling model to use - 1 = Peng analytic fit - 2 = Peng divertor scaling (TART) - 3 = simple ITER scaling - 4 = revised ITER scaling - 5 = Todd empirical scaling I - 6 = Todd empirical scaling II - 7 = Connor-Hastie model - 8 = Sauter scaling (allowing negative triangularity) Issue #392 - 'Geometric formulas for system codes including the effect of negative triangularity' - iprofile : input integer : switch for current profile consistency - 0 use input values for alphaj, rli, dnbeta - 1 make these consistent with input q, q_0 values (recommend `icurr=4` with this option) - 2 use input values for alphaj, rli. Scale dnbeta with aspect ratio (original scaling) - 3 use input values for alphaj, rli. Scale dnbeta with aspect ratio (Menard scaling) - 4 use input values for alphaj, dnbeta. Set rli from elongation (Menard scaling) - 5 use input value for alphaj. Set rli and dnbeta from Menard scaling - kappa : input real : plasma elongation - kappa95 : input real : plasma elongation at 95% surface - p0 : input real : central plasma pressure (Pa) - pperim : input real : plasma perimeter length (m) - q0 : input real : plasma safety factor on axis - q95 : input real : plasma safety factor at 95% flux (= q-bar for icurr=2) - rli : input/output real : plasma normalised internal inductance - rmajor : input real : major radius (m) - rminor : input real : minor radius (m) - sf : input real : shape factor for icurr=1 (=A/pi in documentation) - triang : input real : plasma triangularity - triang95 : input real : plasma triangularity at 95% surface - bp : output real : poloidal field (T) - qstar : output real : equivalent cylindrical safety factor (shaped) - plascur : output real : plasma current (A) - This routine calculates the plasma current based on the edge - safety factor q95. It will also make the current profile parameters - consistent with the q-profile if required. - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, - unpublished internal Oak Ridge document - Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, - Fusion Technology, 21, 1729 - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, - ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 - M. Kovari et al, 2014, "PROCESS": A systems code for fusion power plants - - Part 1: Physics https://www.sciencedirect.com/science/article/pii/S0920379614005961 - H. Zohm et al, 2013, On the Physics Guidelines for a Tokamak DEMO - https://iopscience.iop.org/article/10.1088/0029-5515/53/7/073019 - T. Hartmann, 2013, Development of a modular systems code to analyse the - implications of physics assumptions on the design of a demonstration fusion power plant - https://inis.iaea.org/search/search.aspx?orig_q=RN:45031642 - Sauter, Geometric formulas for systems codes..., FED 2016 + alphaj: float, + alphap: float, + bt: float, + eps: float, + icurr: int, + iprofile: int, + kappa: float, + kappa95: float, + p0: float, + pperim: float, + q0: float, + q95: float, + rli: float, + rmajor: float, + rminor: float, + sf: float, + triang: float, + triang95: float + ) -> Tuple[float, float, float, float, float]: + """Calculate the plasma current. + + Args: + alphaj (float): Current profile index. + alphap (float): Pressure profile index. + bt (float): Toroidal field on axis (T). + eps (float): Inverse aspect ratio. + icurr (int): Current scaling model to use. + 1 = Peng analytic fit + 2 = Peng divertor scaling (TART) + 3 = simple ITER scaling + 4 = revised ITER scaling + 5 = Todd empirical scaling I + 6 = Todd empirical scaling II + 7 = Connor-Hastie model + 8 = Sauter scaling (allowing negative triangularity) + iprofile (int): Switch for current profile consistency. + 0: Use input values for alphaj, rli, dnbeta. + 1: Make these consistent with input q, q_0 values. + 2: Use input values for alphaj, rli. Scale dnbeta with aspect ratio (original scaling). + 3: Use input values for alphaj, rli. Scale dnbeta with aspect ratio (Menard scaling). + 4: Use input values for alphaj, dnbeta. Set rli from elongation (Menard scaling). + 5: Use input value for alphaj. Set rli and dnbeta from Menard scaling. + kappa (float): Plasma elongation. + kappa95 (float): Plasma elongation at 95% surface. + p0 (float): Central plasma pressure (Pa). + pperim (float): Plasma perimeter length (m). + q0 (float): Plasma safety factor on axis. + q95 (float): Plasma safety factor at 95% flux (= q-bar for icurr=2). + rli (float): Plasma normalised internal inductance. + rmajor (float): Major radius (m). + rminor (float): Minor radius (m). + sf (float): Shape factor for icurr=1 (=A/pi in documentation). + triang (float): Plasma triangularity. + triang95 (float): Plasma triangularity at 95% surface. + + Returns: + Tuple[float, float, float, float, float]: Tuple containing bp, qstar, plascur, alphaj, rli. + + Raises: + ValueError: If invalid value for icurr is provided. + + Notes: + This routine calculates the plasma current based on the edge safety factor q95. + It will also make the current profile parameters consistent with the q-profile if required. + + References: + - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, unpublished internal Oak Ridge document + - Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, Fusion Technology, 21, 1729 + - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 + - M. Kovari et al, 2014, "PROCESS": A systems code for fusion power plants - Part 1: Physics + - H. Zohm et al, 2013, On the Physics Guidelines for a Tokamak DEMO + - T. Hartmann, 2013, Development of a modular systems code to analyse the implications of physics assumptions on the design of a demonstration fusion power plant + - Sauter, Geometric formulas for systems codes..., FED 2016 """ # Aspect ratio - - asp = 1.0 / eps - - # Calculate the function Fq that scales the edge q from the - # circular cross-section cylindrical case + aspect_ratio = 1.0 / eps # Only the Sauter scaling (icurr=8) is suitable for negative triangularity: - if icurr != 8 and triang < 0.0: raise ValueError( - f"Triangularity is negative without icurr = 8: {triang=}, {icurr=}" + f"Triangularity is negative without icurr = 8 selected: {triang=}, {icurr=}" ) - if icurr == 1: # Peng analytical fit + # Calculate the function Fq that scales the edge q from the + # circular cross-section cylindrical case + + # Peng analytical fit + if icurr == 1: fq = (1.22 - 0.68 * eps) / ((1.0 - eps * eps) ** 2) * sf**2 - elif icurr == 2: # Peng scaling for double null divertor; TARTs [STAR Code] - plascur = 1.0e6 * plasc(q95, asp, eps, rminor, bt, kappa, triang) - elif icurr == 3: # Simple ITER scaling (simply the cylindrical case) + + # Peng scaling for double null divertor; TARTs [STAR Code] + elif icurr == 2: + plascur = 1.0e6 * plasc(q95, aspect_ratio, eps, rminor, bt, kappa, triang) + + # Simple ITER scaling (simply the cylindrical case) + elif icurr == 3: fq = 1.0 - elif icurr == 4: # ITER formula (IPDG89) + + # ITER formula (IPDG89) + elif icurr == 4: fq = ( 0.5 * (1.17 - 0.65 * eps) @@ -2107,7 +2114,9 @@ def calculate_plasma_current( + kappa95**2 * (1.0 + 2.0 * triang95**2 - 1.2 * triang95**3) ) ) - elif icurr in [5, 6]: # Todd empirical scalings + + # Todd empirical scalings + elif icurr in [5, 6]: fq = ( (1.0 + 2.0 * eps * eps) * 0.5 @@ -2121,12 +2130,14 @@ def calculate_plasma_current( ) fq *= 1 if icurr == 7 else (1.0 + (abs(kappa95 - 1.2)) ** 3) - elif icurr == 7: # Connor-Hastie asymptotically-correct expression + + # Connor-Hastie asymptotically-correct expression + elif icurr == 7: # N.B. If iprofile=1, alphaj will be wrong during the first call (only) fq = conhas(alphaj, alphap, bt, triang95, eps, kappa95, p0, constants.rmu0) - elif ( - icurr == 8 - ): # Sauter scaling allowing negative triangularity [FED May 2016] + + # Sauter scaling allowing negative triangularity [FED May 2016] + elif icurr == 8: # Assumes zero squareness, note takes kappa, delta at separatrix not _95 w07 = 1.0 # zero squareness - can be modified later if required @@ -2139,15 +2150,18 @@ def calculate_plasma_current( / (1.0 - 0.74 * eps) * (1.0 + 0.55 * (w07 - 1.0)) ) + elif icurr == 9: fq = 0.538 * (1.0 + 2.440 * eps**2.736) * kappa**2.154 * triang**0.060 else: raise ValueError(f"Invalid value {icurr=}") + # Main plasma current calculation using the fq value from the different settings if icurr != 2: - plascur = 5.0e6 * rminor**2 / (rmajor * q95) * fq * bt - # == 2 case covered above + plascur = (constants.twopi / constants.rmu0) * rminor**2 / (rmajor * q95) * fq * bt + # icurr == 2 case covered above + # Calculate cyclindrical safety factor qstar = ( 5.0e6 * rminor**2 @@ -2159,8 +2173,10 @@ def calculate_plasma_current( physics_variables.normalised_total_beta = ( 1.0e8 * physics_variables.beta * rminor * bt / plascur ) + + # Calculate the poloidal field generated by the plasma current bp = bpol( - icurr, plascur, q95, asp, eps, bt, kappa, triang, pperim, constants.rmu0 + icurr, plascur, q95, aspect_ratio, eps, bt, kappa, triang, pperim, constants.rmu0 ) if iprofile == 1: From c1908e5ec62f34b1385c9a8bb13eb65dd0ed3acb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 2 Aug 2024 14:43:37 +0100 Subject: [PATCH 003/108] Added a new structure for the plasma current docs dividing the types of current into seperate sections --- .../plasma_current/bootstrap_current.md | 20 +++++++ .../plasma_current/diamagnetic_current.md | 15 ++++++ .../pfirsch_schl\303\274ter_current_drive.md" | 12 +++++ .../{ => plasma_current}/plasma_current.md | 54 +------------------ mkdocs.yml | 7 ++- 5 files changed, 54 insertions(+), 54 deletions(-) create mode 100644 documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md create mode 100644 documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md create mode 100644 "documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" rename documentation/proc-pages/physics-models/{ => plasma_current}/plasma_current.md (50%) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md new file mode 100644 index 0000000000..9a6ed70f60 --- /dev/null +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -0,0 +1,20 @@ +The fraction of the plasma current provided by the bootstrap effect +can be either input into the code directly, or calculated using one of four +methods, as summarised here. Note that methods `ibss = 1-3` do not take into account the +existence of pedestals, whereas the Sauter et al. scaling +(`ibss = 4`) allows general profiles to be used. + +| `ibss` | Description | +| :-: | - | +| 1 | ITER scaling -- To use the ITER scaling method for the bootstrap current fraction. Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). This method is valid at high aspect ratio only. +| 2 | General scaling -- To use a more general scaling method, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). +| 3 | Numerically fitted scaling [^1] -- To use a numerically fitted scaling method, valid for all aspect ratios, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). +| 4 | Sauter, Angioni and Lin-Liu scaling [^2] [^3] -- Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). + +!!! Note "Fixed Bootstrap Current" + Direct input -- To input the bootstrap current fraction directly, set `bscfmax` + to $(-1)$ times the required value (e.g. -0.73 sets the bootstrap faction to 0.73). + +[^1]: H.R. Wilson, Nuclear Fusion **32** (1992) 257 +[^2]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **6** (1999) 2834 +[^3]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **9** (2002) 5140 \ No newline at end of file diff --git a/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md b/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md new file mode 100644 index 0000000000..904a5429ce --- /dev/null +++ b/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md @@ -0,0 +1,15 @@ +The diamagnetic current fraction $f_{dia}$ is strongly related to $\beta$ and is typically small, +hence it is usually neglected. For high $\beta$ plasmas, such as those at tight +aspect ratio, it should be included and two scalings are offered. If the diamagnetic +current is expected to be above one per cent of the plasma current, a warning +is issued to calculate it. + +`idia = 0` Diamagnetic current fraction is zero. + +`idia = 1` Diamagnetic current fraction is calculated using a fit to spherical tokamak calculations by Tim Hender: + +$$f_{dia} = \frac{\beta}{2.8}$$ + +`idia = 2` Diamagnetic current fraction is calculated using a SCENE fit for all aspect ratios: + +$$f_{dia} = 0.414 \space \beta \space (\frac{0.1 q_{95}}{q_0} + 0.44)$$ \ No newline at end of file diff --git "a/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" "b/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" new file mode 100644 index 0000000000..99c8b2941f --- /dev/null +++ "b/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" @@ -0,0 +1,12 @@ +A similar scaling is available for the Pfirsch-Schlüter current fraction $f_{PS}$. This is +typically smaller than the diamagnetic current, but is negative. + +`ips = 0` Pfirsch-Schlüter current fraction is set to zero. + +`ips = 1` Pfirsch-Schlüter current fraction is calculated using a SCENE fit for all aspect ratios: + +$$ f_{PS} = -0.09 \beta $$ + +There is no ability to input the diamagnetic and Pfirsch-Schlüter current +directly. In this case, it is recommended to turn off these two scalings +and to use the method of fixing the bootstrap current fraction. \ No newline at end of file diff --git a/documentation/proc-pages/physics-models/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md similarity index 50% rename from documentation/proc-pages/physics-models/plasma_current.md rename to documentation/proc-pages/physics-models/plasma_current/plasma_current.md index a1395a0edd..888180b709 100644 --- a/documentation/proc-pages/physics-models/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -54,54 +54,6 @@ l_i = 3.4 - \kappa_x Further desciption of `iprofile` is given in [Beta Limit](./plasma_beta.md). -## Bootstrap, Diamagnetic and Pfirsch-Schlüter Current Scalings - -The fraction of the plasma current provided by the bootstrap effect -can be either input into the code directly, or calculated using one of four -methods, as summarised here. Note that methods `ibss = 1-3` do not take into account the -existence of pedestals, whereas the Sauter et al. scaling -(`ibss = 4`) allows general profiles to be used. - -| `ibss` | Description | -| :-: | - | -| 1 | ITER scaling -- To use the ITER scaling method for the bootstrap current fraction. Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). This method is valid at high aspect ratio only. -| 2 | General scaling -- To use a more general scaling method, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). -| 3 | Numerically fitted scaling [^8] -- To use a numerically fitted scaling method, valid for all aspect ratios, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). -| 4 | Sauter, Angioni and Lin-Liu scaling [^9] [^10] -- Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). - -!!! Note "Fixed Bootstrap Current" - Direct input -- To input the bootstrap current fraction directly, set `bscfmax` - to $(-1)$ times the required value (e.g. -0.73 sets the bootstrap faction to 0.73). - -The diamagnetic current fraction $f_{dia}$ is strongly related to $\beta$ and is typically small, -hence it is usually neglected. For high $\beta$ plasmas, such as those at tight -aspect ratio, it should be included and two scalings are offered. If the diamagnetic -current is expected to be above one per cent of the plasma current, a warning -is issued to calculate it. - -`idia = 0` Diamagnetic current fraction is zero. - -`idia = 1` Diamagnetic current fraction is calculated using a fit to spherical tokamak calculations by Tim Hender: - -$$f_{dia} = \frac{\beta}{2.8}$$ - -`idia = 2` Diamagnetic current fraction is calculated using a SCENE fit for all aspect ratios: - -$$f_{dia} = 0.414 \space \beta \space (\frac{0.1 q_{95}}{q_0} + 0.44)$$ - -A similar scaling is available for the Pfirsch-Schlüter current fraction $f_{PS}$. This is -typically smaller than the diamagnetic current, but is negative. - -`ips = 0` Pfirsch-Schlüter current fraction is set to zero. - -`ips = 1` Pfirsch-Schlüter current fraction is calculated using a SCENE fit for all aspect ratios: - -$$ f_{PS} = -0.09 \beta $$ - -There is no ability to input the diamagnetic and Pfirsch-Schlüter current -directly. In this case, it is recommended to turn off these two scalings -and to use the method of fixing the bootstrap current fraction. - [^1]: D.J. Ward, 'PROCESS Fast Alpha Pressure', Work File Note F/PL/PJK/PROCESS/CODE/050 [^2]: Albajar, Nuclear Fusion **41** (2001) 665 [^3]: M. Kovari, R. Kemp, H. Lux, P. Knight, J. Morris, D.J. Ward, '“PROCESS”: A systems code for fusion power plants—Part 1: Physics' Fusion Engineering and Design 89 (2014) 3054–3069 @@ -110,8 +62,4 @@ Unpublished internal Oak Ridge document. [^5]: W.M. Nevins, 'Summary Report: ITER Specialists' Meeting on Heating and Current Drive', ITER-TN-PH-8-4, 13--17 June 1988, Garching, FRG [^6]: Y. Sakamoto, 'Recent progress in vertical stability analysis in JA', -Task meeting EU-JA #16, Fusion for Energy, Garching, 24--25 June 2014 -[^7]: Menard et al. (2016), Nuclear Fusion, 56, 106023 -[^8]: H.R. Wilson, Nuclear Fusion **32** (1992) 257 -[^9]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **6** (1999) 2834 -[^10]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **9** (2002) 5140 \ No newline at end of file +Task meeting EU-JA #16, Fusion for Energy, Garching, 24--25 June 2014 \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index f45c394889..072ef700fa 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -56,7 +56,12 @@ nav: - Density Limit: physics-models/plasma_density.md - Composition & Impurities: physics-models/plasma_radiation_impurities.md - Radiation: physics-models/plasma_radiation_impurities.md - - Plasma Current: physics-models/plasma_current.md + - Plasma Current: + - Overview: physics-models/plasma_current/plasma_current.md + - Bootstrap Current: physics-models/plasma_current/bootstrap_current.md + - Diamagnetic Current: physics-models/plasma_current/diamagnetic_current.md + - Pfirsch-Schlüter Current: physics-models/plasma_current/pfirsch_schlüter_current_drive.md + - External Current Drive: physics-models/plasma_current/external_current_drive.md - Confinement time: physics-models/plasma_confinement.md - Plasma Core Power Balance: physics-models/plasma_power_balance.md - Pulsed Plant Operation: physics-models/pulsed-plant.md From 974e20bfd71ca24084c21f2bb14139e887ebe07c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 2 Aug 2024 15:04:32 +0100 Subject: [PATCH 004/108] Re-name icurr to i_plasma_current and add icurr to the obsolete variables list --- .../fusion-devices/spherical-tokamak.md | 2 +- .../physics-models/plasma_geometry.md | 2 +- process/io/obsolete_vars.py | 1 + process/physics.py | 64 +++++++++---------- process/plasma_geometry.py | 4 +- process/utilities/errorlist.json | 8 +-- source/fortran/constraint_equations.f90 | 2 +- source/fortran/initial.f90 | 10 +-- source/fortran/input.f90 | 6 +- source/fortran/iteration_variables.f90 | 6 +- source/fortran/physics_variables.f90 | 8 +-- tests/integration/ref_dicts.json | 14 ++-- tests/unit/test_physics.py | 14 ++-- 13 files changed, 71 insertions(+), 70 deletions(-) diff --git a/documentation/proc-pages/fusion-devices/spherical-tokamak.md b/documentation/proc-pages/fusion-devices/spherical-tokamak.md index b628d1c6ee..0b7c4e170c 100644 --- a/documentation/proc-pages/fusion-devices/spherical-tokamak.md +++ b/documentation/proc-pages/fusion-devices/spherical-tokamak.md @@ -44,7 +44,7 @@ Switch `itart` provides overall control of the ST switches within the code, and | --- | --- | --- | | `ishape` | 0, 2, 3, 4 | 1, 5, 6, 7, 8 | | `ibss` | 1, 2, 3 | 2, 3 | -| `icurr` | 1, 3, 4, 5, 6, 7 | 2, 9 | +| `i_plasma_current` | 1, 3, 4, 5, 6, 7 | 2, 9 | | `itfsup` | 0, 1 | 0 |
Table 1: Summary of the switch values in 'PROCESS' that relate to conventional aspect ratio and low aspect ratio machines.
diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index a290f8b5ca..427bad0289 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -377,7 +377,7 @@ $$ \mathtt{pperim} = 2.0 \times (\mathtt{xo} \times \mathtt{thetao} + \mathtt{xi} \times \mathtt{thetai}) $$ -The shaping factor for `icurr=1` is also claculated here: +The shaping factor for `i_plasma_current=1` is also claculated here: $$ \mathtt{sf} = \frac{\mathtt{pperim}}{ 2.0\pi a} diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index b0fdf13d7e..fc8d615fdd 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -113,6 +113,7 @@ "theat": "t_fusion_ramp", "ieped": None, "eped_sf": None, + "icurr": "i_plasma_current", } OBS_VARS_HELP = { diff --git a/process/physics.py b/process/physics.py index 59c76a19dc..ec26cccfdc 100644 --- a/process/physics.py +++ b/process/physics.py @@ -117,11 +117,11 @@ def _plascar_bpol(aspect, eps, kappa, delta): @nb.jit(nopython=True, cache=True) -def bpol(icurr, ip, qbar, aspect, eps, bt, kappa, delta, perim, rmu0): +def bpol(i_plasma_current, ip, qbar, aspect, eps, bt, kappa, delta, perim, rmu0): """Function to calculate poloidal field author: J Galambos, FEDC/ORNL author: P J Knight, CCFE, Culham Science Centre - icurr : input integer : current scaling model to use + i_plasma_current : input integer : current scaling model to use ip : input real : plasma current (A) qbar : input real : edge q-bar aspect : input real : plasma aspect ratio @@ -138,7 +138,7 @@ def bpol(icurr, ip, qbar, aspect, eps, bt, kappa, delta, perim, rmu0): Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, Fusion Technology, 21, 1729 """ - if icurr != 2: + if i_plasma_current != 2: return rmu0 * ip / perim ff1, ff2, _, _ = _plascar_bpol(aspect, eps, kappa, delta) @@ -160,7 +160,7 @@ def plasc(qbar, aspect, eps, rminor, bt, kappa, delta): This function calculates the plasma current in MA, using a scaling from Peng, Galambos and Shipe (1992). It is primarily used for Tight Aspect Ratio Tokamaks and is - selected via icurr=2. + selected via i_plasma_current=2. J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, unpublished internal Oak Ridge document Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, @@ -800,7 +800,7 @@ def physics(self): # * physics_variables.rmajor # ) - if physics_variables.icurr == 2: + if physics_variables.i_plasma_current == 2: physics_variables.q95 = ( physics_variables.q * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0 ) @@ -825,7 +825,7 @@ def physics(self): physics_variables.alphap, physics_variables.bt, physics_variables.eps, - physics_variables.icurr, + physics_variables.i_plasma_current, physics_variables.iprofile, physics_variables.kappa, physics_variables.kappa95, @@ -2009,7 +2009,7 @@ def calculate_plasma_current( alphap: float, bt: float, eps: float, - icurr: int, + i_plasma_current: int, iprofile: int, kappa: float, kappa95: float, @@ -2031,7 +2031,7 @@ def calculate_plasma_current( alphap (float): Pressure profile index. bt (float): Toroidal field on axis (T). eps (float): Inverse aspect ratio. - icurr (int): Current scaling model to use. + i_plasma_current (int): Current scaling model to use. 1 = Peng analytic fit 2 = Peng divertor scaling (TART) 3 = simple ITER scaling @@ -2052,11 +2052,11 @@ def calculate_plasma_current( p0 (float): Central plasma pressure (Pa). pperim (float): Plasma perimeter length (m). q0 (float): Plasma safety factor on axis. - q95 (float): Plasma safety factor at 95% flux (= q-bar for icurr=2). + q95 (float): Plasma safety factor at 95% flux (= q-bar for i_plasma_current=2). rli (float): Plasma normalised internal inductance. rmajor (float): Major radius (m). rminor (float): Minor radius (m). - sf (float): Shape factor for icurr=1 (=A/pi in documentation). + sf (float): Shape factor for i_plasma_current=1 (=A/pi in documentation). triang (float): Plasma triangularity. triang95 (float): Plasma triangularity at 95% surface. @@ -2064,7 +2064,7 @@ def calculate_plasma_current( Tuple[float, float, float, float, float]: Tuple containing bp, qstar, plascur, alphaj, rli. Raises: - ValueError: If invalid value for icurr is provided. + ValueError: If invalid value for i_plasma_current is provided. Notes: This routine calculates the plasma current based on the edge safety factor q95. @@ -2082,29 +2082,29 @@ def calculate_plasma_current( # Aspect ratio aspect_ratio = 1.0 / eps - # Only the Sauter scaling (icurr=8) is suitable for negative triangularity: - if icurr != 8 and triang < 0.0: + # Only the Sauter scaling (i_plasma_current=8) is suitable for negative triangularity: + if i_plasma_current != 8 and triang < 0.0: raise ValueError( - f"Triangularity is negative without icurr = 8 selected: {triang=}, {icurr=}" + f"Triangularity is negative without i_plasma_current = 8 selected: {triang=}, {i_plasma_current=}" ) # Calculate the function Fq that scales the edge q from the # circular cross-section cylindrical case # Peng analytical fit - if icurr == 1: + if i_plasma_current == 1: fq = (1.22 - 0.68 * eps) / ((1.0 - eps * eps) ** 2) * sf**2 # Peng scaling for double null divertor; TARTs [STAR Code] - elif icurr == 2: + elif i_plasma_current == 2: plascur = 1.0e6 * plasc(q95, aspect_ratio, eps, rminor, bt, kappa, triang) # Simple ITER scaling (simply the cylindrical case) - elif icurr == 3: + elif i_plasma_current == 3: fq = 1.0 # ITER formula (IPDG89) - elif icurr == 4: + elif i_plasma_current == 4: fq = ( 0.5 * (1.17 - 0.65 * eps) @@ -2116,7 +2116,7 @@ def calculate_plasma_current( ) # Todd empirical scalings - elif icurr in [5, 6]: + elif i_plasma_current in [5, 6]: fq = ( (1.0 + 2.0 * eps * eps) * 0.5 @@ -2129,15 +2129,15 @@ def calculate_plasma_current( ) ) - fq *= 1 if icurr == 7 else (1.0 + (abs(kappa95 - 1.2)) ** 3) + fq *= 1 if i_plasma_current == 7 else (1.0 + (abs(kappa95 - 1.2)) ** 3) # Connor-Hastie asymptotically-correct expression - elif icurr == 7: + elif i_plasma_current == 7: # N.B. If iprofile=1, alphaj will be wrong during the first call (only) fq = conhas(alphaj, alphap, bt, triang95, eps, kappa95, p0, constants.rmu0) # Sauter scaling allowing negative triangularity [FED May 2016] - elif icurr == 8: + elif i_plasma_current == 8: # Assumes zero squareness, note takes kappa, delta at separatrix not _95 w07 = 1.0 # zero squareness - can be modified later if required @@ -2151,15 +2151,15 @@ def calculate_plasma_current( * (1.0 + 0.55 * (w07 - 1.0)) ) - elif icurr == 9: + elif i_plasma_current == 9: fq = 0.538 * (1.0 + 2.440 * eps**2.736) * kappa**2.154 * triang**0.060 else: - raise ValueError(f"Invalid value {icurr=}") + raise ValueError(f"Invalid value {i_plasma_current=}") # Main plasma current calculation using the fq value from the different settings - if icurr != 2: + if i_plasma_current != 2: plascur = (constants.twopi / constants.rmu0) * rminor**2 / (rmajor * q95) * fq * bt - # icurr == 2 case covered above + # i_plasma_current == 2 case covered above # Calculate cyclindrical safety factor qstar = ( @@ -2176,12 +2176,12 @@ def calculate_plasma_current( # Calculate the poloidal field generated by the plasma current bp = bpol( - icurr, plascur, q95, aspect_ratio, eps, bt, kappa, triang, pperim, constants.rmu0 + i_plasma_current, plascur, q95, aspect_ratio, eps, bt, kappa, triang, pperim, constants.rmu0 ) if iprofile == 1: # Ensure current profile consistency, if required - # This is as described in Hartmann and Zohm only if icurr = 4 as well... + # This is as described in Hartmann and Zohm only if i_plasma_current = 4 as well... # Tokamaks 4th Edition, Wesson, page 116 alphaj = qstar / q0 - 1.0 @@ -2512,8 +2512,8 @@ def outplas(self): po.ovarin( self.outfile, "Plasma current scaling law used", - "(icurr)", - physics_variables.icurr, + "(i_plasma_current)", + physics_variables.i_plasma_current, ) po.ovarrf( @@ -2582,7 +2582,7 @@ def outplas(self): self.outfile, "Safety factor on axis", "(q0)", physics_variables.q0 ) - if physics_variables.icurr == 2: + if physics_variables.i_plasma_current == 2: po.ovarrf( self.outfile, "Mean edge safety factor", "(q)", physics_variables.q ) @@ -5527,7 +5527,7 @@ def pcond( elif isc == 42: # High density relevant confinement scaling # P.T. Lang et al. 2012, IAEA conference proceeding EX/P4-01 - # q should be q95: incorrect if icurr = 2 (ST current scaling) + # q should be q95: incorrect if i_plasma_current = 2 (ST current scaling) qratio = q / qstar # Greenwald density in m^-3 nGW = 1.0e14 * plascur / (np.pi * rminor * rminor) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index bd606e404e..4bb9bb1077 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -233,8 +233,8 @@ def geomty(self): ) physics_variables.sareao = xso - # icurr = 8 specifies use of the Sauter geometry as well as plasma current. - if physics_variables.icurr == 8: + # i_plasma_current = 8 specifies use of the Sauter geometry as well as plasma current. + if physics_variables.i_plasma_current == 8: ( physics_variables.pperim, physics_variables.sf, diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index 96d7dbaf2f..ba23e36b35 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -193,7 +193,7 @@ { "no": 37, "level": 2, - "message": "CHECK: Usual current scaling for TARTs (icurr=2 or 9) is not being used" + "message": "CHECK: Usual current scaling for TARTs (i_plasma_current=2 or 9) is not being used" }, { "no": 38, @@ -208,7 +208,7 @@ { "no": 40, "level": 2, - "message": "CHECK: icurr=2 is not a valid option for a non-TART device" + "message": "CHECK: i_plasma_current=2 is not a valid option for a non-TART device" }, { "no": 41, @@ -393,7 +393,7 @@ { "no": 77, "level": 3, - "message": "CALCULATE_PLASMA_CURRENT: Illegal value for icurr" + "message": "CALCULATE_PLASMA_CURRENT: Illegal value for i_plasma_current" }, { "no": 78, @@ -1118,7 +1118,7 @@ { "no": 222, "level": 3, - "message": "CHECK: Lang 2012 confinement scaling cannot be used for icurr=2 due to wrong q" + "message": "CHECK: Lang 2012 confinement scaling cannot be used for i_plasma_current=2 due to wrong q" }, { "no": 223, diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index 289d0bd7c7..240564eeba 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -1984,7 +1984,7 @@ subroutine constraint_eqn_045(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! fq : input real : f-value for edge safety factor !! q : safety factor 'near' plasma edge: equal to q95 - !! (unless icurr = 2 (ST current scaling), in which case q = mean edge safety factor qbar) + !! (unless i_plasma_current = 2 (ST current scaling), in which case q = mean edge safety factor qbar) !! qlim : input real : lower limit for edge safety factor !! itart : input integer : switch for spherical tokamak (ST) models:
    !!
  • = 0 use conventional aspect ratio models; diff --git a/source/fortran/initial.f90 b/source/fortran/initial.f90 index 9a1512d740..e47b63680d 100755 --- a/source/fortran/initial.f90 +++ b/source/fortran/initial.f90 @@ -256,7 +256,7 @@ subroutine check boundu use pfcoil_variables, only: ipfres, ngrp, pfclres, ipfloc, ncls, isumatoh use physics_variables, only: aspect, fdeut, fgwped, fhe3, & - fgwsep, ftrit, ibss, i_single_null, icurr, idivrt, ishape, & + fgwsep, ftrit, ibss, i_single_null, i_plasma_current, idivrt, ishape, & iradloss, isc, ipedestal, ilhthresh, itart, nesep, rhopedn, rhopedt, & rnbeam, neped, te, tauee_in, tesep, teped, itartpf, ftar use pulse_variables, only: lpulse @@ -510,8 +510,8 @@ subroutine check ! Check if the choice of plasma current is addapted for ST ! 2 : Peng Ip scaling (See STAR code documentation) ! 9 : Fiesta Ip scaling - if (icurr /= 2 .and. icurr /= 9) then - idiags(1) = icurr ; call report_error(37) + if (i_plasma_current /= 2 .and. i_plasma_current /= 9) then + idiags(1) = i_plasma_current ; call report_error(37) end if !! If using Peng and Strickler (1986) model (itartpf == 0) @@ -599,7 +599,7 @@ subroutine check ! ------------------------------------ else - if (icurr == 2 .or. icurr == 9) call report_error(40) + if (i_plasma_current == 2 .or. i_plasma_current == 9) call report_error(40) ! Set the TF coil shape to PROCESS D-shape (if default value) if ( i_tf_shape == 0 ) i_tf_shape = 1 @@ -943,7 +943,7 @@ subroutine check call report_error(221) end if - if (icurr.eq.2.and.isc.eq.42) then + if (i_plasma_current.eq.2.and.isc.eq.42) then call report_error(222) end if diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 9654d2e262..1b5f5ac8ca 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -307,7 +307,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) fpdivlim, epbetmax, isc, kappa95, aspect, cwrmax, nesep, c_beta, csawth, dene, & ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, dnbeta, & fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, ftrit, & - ifalphap, tauee_in, alphaj, alphat, icurr, q, ti, tesep, rli, triang, & + ifalphap, tauee_in, alphaj, alphat, i_plasma_current, q, ti, tesep, rli, triang, & itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & teped, fhe3, iwalld, gamma, falpha, fgwped, tbeta, ibss, & iradloss, te, alphan, rmajor, kappa, iinvqd, fkzohm, beamfus0, & @@ -624,8 +624,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('iculbl') call parse_int_variable('iculbl', iculbl, 0, 3, & 'Switch for beta limit scaling') - case ('icurr') - call parse_int_variable('icurr', icurr, 1, 9, & + case ('i_plasma_current') + call parse_int_variable('i_plasma_current', i_plasma_current, 1, 9, & 'Switch for plasma current scaling') case ('idensl') call parse_int_variable('idensl', idensl, 1, 7, & diff --git a/source/fortran/iteration_variables.f90 b/source/fortran/iteration_variables.f90 index 1371cd56da..4923d727e1 100755 --- a/source/fortran/iteration_variables.f90 +++ b/source/fortran/iteration_variables.f90 @@ -3936,7 +3936,7 @@ subroutine loadxc use maths_library, only: variable_error use error_handling, only: idiags, fdiags, report_error use numerics, only: nvar, xcm, ixc, name_xc, lablxc, scafc, scale - use physics_variables, only: icurr + use physics_variables, only: i_plasma_current use global_variables, only: vlabel implicit none @@ -4133,8 +4133,8 @@ subroutine loadxc ! Simple list of iteration variable names name_xc(i) = lablxc(ixc(i)) ! Note that iteration variable 18 has more than one name: - if ((ixc(i) == 18).and.(icurr /= 2)) name_xc(i) = 'q95' - if ((ixc(i) == 18).and.(icurr == 2)) name_xc(i) = 'qbar' + if ((ixc(i) == 18).and.(i_plasma_current /= 2)) name_xc(i) = 'q95' + if ((ixc(i) == 18).and.(i_plasma_current == 2)) name_xc(i) = 'qbar' ! MDK Check if sweep variable is also an iteration variable diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 995df178f9..ecd5e97017 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -258,7 +258,7 @@ module physics_variables !! - =2 apply limit to thermal + neutral beam beta !! - =3 apply limit to toroidal beta - integer :: icurr + integer :: i_plasma_current !! switch for plasma current scaling to use !! !! - =1 Peng analytic fit @@ -365,7 +365,7 @@ module physics_variables !! switch for current profile consistency: !! !! - =0 use input values for alphaj, rli, dnbeta - !! - =1 make these consistent with input q, q_0 values (recommend `icurr=4` with this option) + !! - =1 make these consistent with input q, q_0 values (recommend `i_plasma_current=4` with this option) !! - =2 use input values for alphaj, rli. Scale dnbeta with aspect ratio (original scaling) !! - =3 use input values for alphaj, rli. Scale dnbeta with aspect ratio (Menard scaling) !! - =4 use input values for alphaj, dnbeta. Set rli from elongation (Menard scaling) @@ -712,7 +712,7 @@ module physics_variables real(dp) :: q !! Safety factor 'near' plasma edge (`iteration variable 18`) equal to q95 - !! (unless `icurr=2` (ST current scaling), in which case q = mean edge safety factor qbar) + !! (unless `i_plasma_current=2` (ST current scaling), in which case q = mean edge safety factor qbar) real(dp) :: q0 !! safety factor on axis @@ -950,7 +950,7 @@ subroutine init_physics_variables taumax = 10.0D0 ibss = 3 iculbl = 0 - icurr = 4 + i_plasma_current = 4 idia = 0 idensl = 7 idivrt = 2 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 159a778949..412d769ec2 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -2428,7 +2428,7 @@ ], "icode": 0.0, "iculbl": 0.0, - "icurr": 4.0, + "i_plasma_current": 4.0, "idensl": 7.0, "idia": 0.0, "idiags": [ @@ -9803,7 +9803,7 @@ "icc": "", "icode": "", "iculbl": "switch for beta limit scaling (`constraint equation 24`)\n
      \n
    • =0 apply limit to total beta
    • \n
    • =1 apply limit to thermal beta
    • \n
    • =2 apply limit to thermal + neutral beam beta
    • \n
    • =3 apply limit to toroidal beta
    • \n
    ", - "icurr": "switch for plasma current scaling to use\n
      \n
    • =1 Peng analytic fit
    • \n
    • =2 Peng double null divertor scaling (ST)
    • \n
    • =3 simple ITER scaling (k = 2.2, d = 0.6)
    • \n
    • =4 later ITER scaling, a la Uckan
    • \n
    • =5 Todd empirical scaling I
    • \n
    • =6 Todd empirical scaling II
    • \n
    • =7 Connor-Hastie model
    • \n
    • =8 Sauter scaling allowing negative triangularity
    • \n
    • =9 FIESTA ST fit
    • \n
    ", + "i_plasma_current": "switch for plasma current scaling to use\n
      \n
    • =1 Peng analytic fit
    • \n
    • =2 Peng double null divertor scaling (ST)
    • \n
    • =3 simple ITER scaling (k = 2.2, d = 0.6)
    • \n
    • =4 later ITER scaling, a la Uckan
    • \n
    • =5 Todd empirical scaling I
    • \n
    • =6 Todd empirical scaling II
    • \n
    • =7 Connor-Hastie model
    • \n
    • =8 Sauter scaling allowing negative triangularity
    • \n
    • =9 FIESTA ST fit
    • \n
    ", "idensl": "switch for density limit to enforce (`constraint equation 5`)\n
      \n
    • =1 old ASDEX
    • \n
    • =2 Borrass model for ITER (I)
    • \n
    • =3 Borrass model for ITER (II)
    • \n
    • =4 JET edge radiation
    • \n
    • =5 JET simplified
    • \n
    • =6 Hugill-Murakami Mq limit
    • \n
    • =7 Greenwald limit
    • \n
    ", "idia": "switch for diamagnetic current scaling\n
      \n
    • =0 Do not calculate
    • \n
    • =1 Use original TART scaling
    • \n
    • =2 Use SCENE scaling
    • \n
    ", "idiags": "", @@ -9875,7 +9875,7 @@ "iprecomp": "Switch for existence of central solenoid pre-compression structure:\n
      \n
    • =0 no pre-compression structure
    • \n
    • =1 calculated pre-compression structure
    • \n
    ", "iprimdiv": "", "iprimshld": "Switch for shield thermal power destiny:\n
      \n
    • =0 does not contribute to energy generation cycle
    • \n
    • =1 contributes to energy generation cycle
    • \n
    ", - "iprofile": "switch for current profile consistency:\n
      \n
    • =0 use input values for alphaj, rli, dnbeta (but see gtscale option)
    • \n
    • =1 make these consistent with input q, q_0 values (recommend `icurr=4` with this option)
    • \n
    ", + "iprofile": "switch for current profile consistency:\n
      \n
    • =0 use input values for alphaj, rli, dnbeta (but see gtscale option)
    • \n
    • =1 make these consistent with input q, q_0 values (recommend `i_plasma_current=4` with this option)
    • \n
    ", "ips": "switch for Pfirsch-Schl\u00fcter current scaling (issue #413):\n
      \n
    • =0 Do not calculate
    • \n
    • =1 Use SCENE scaling
    • \n
    ", "iptnt": "", "iptr": "", @@ -10403,7 +10403,7 @@ "pwplh": "lower hybrid wall plug power (MW)", "pwpm2": "base AC power requirement per unit floor area (W/m2)", "pwpnb": "neutral beam wall plug power (MW)", - "q": "safety factor 'near' plasma edge (`iteration variable 18`) equal to q95\n (unless `icurr=2` (ST current scaling), in which case q = mean edge safety factor qbar)", + "q": "safety factor 'near' plasma edge (`iteration variable 18`) equal to q95\n (unless `i_plasma_current=2` (ST current scaling), in which case q = mean edge safety factor qbar)", "q0": "safety factor on axis", "q2": "", "q95": "safety factor at 95% surface", @@ -13316,7 +13316,7 @@ "lb": 0, "ub": 3 }, - "icurr": { + "i_plasma_current": { "lb": 1, "ub": 9 }, @@ -19104,7 +19104,7 @@ "taumax", "ibss", "iculbl", - "icurr", + "i_plasma_current", "idia", "idensl", "idivrt", @@ -20427,7 +20427,7 @@ "ibss": "int_variable", "icc": "int_array", "iculbl": "int_variable", - "icurr": "int_variable", + "i_plasma_current": "int_variable", "idensl": "int_variable", "idia": "int_variable", "iefrf": "int_variable", diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index acd092cc1b..31b0416a73 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -473,7 +473,7 @@ class PlasmaCurrentParam(NamedTuple): beta: Any = None - icurr: Any = None + i_plasma_current: Any = None iprofile: Any = None @@ -528,7 +528,7 @@ class PlasmaCurrentParam(NamedTuple): PlasmaCurrentParam( normalised_total_beta=0, beta=0.030000000000000006, - icurr=4, + i_plasma_current=4, iprofile=1, alphaj=1, rli=0.90000000000000002, @@ -556,7 +556,7 @@ class PlasmaCurrentParam(NamedTuple): PlasmaCurrentParam( normalised_total_beta=2.4784688886891844, beta=0.030000000000000006, - icurr=4, + i_plasma_current=4, iprofile=1, alphaj=1.9008029008029004, rli=1.2064840230894305, @@ -603,7 +603,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): monkeypatch.setattr(physics_variables, "beta", plasmacurrentparam.beta) _, _, bp, qstar, plascur = physics.calculate_plasma_current( - icurr=plasmacurrentparam.icurr, + i_plasma_current=plasmacurrentparam.i_plasma_current, iprofile=plasmacurrentparam.iprofile, alphaj=plasmacurrentparam.alphaj, rli=plasmacurrentparam.rli, @@ -672,7 +672,7 @@ def test_plasc(arguments, expected): ( ( { - "icurr": 2, + "i_plasma_current": 2, "ip": 1.6e7, "qbar": 2.5, "aspect": 2.7, @@ -687,7 +687,7 @@ def test_plasc(arguments, expected): ), ( { - "icurr": 2, + "i_plasma_current": 2, "ip": 1.6e7, "qbar": 2.5, "aspect": 3.0, @@ -702,7 +702,7 @@ def test_plasc(arguments, expected): ), ( { - "icurr": 3, + "i_plasma_current": 3, "ip": 1.6e7, "qbar": 2.5, "aspect": 3.0, From f599865842c1b4223b5bf2e90a6eef04bd7303b4 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 2 Aug 2024 15:06:17 +0100 Subject: [PATCH 005/108] Black format --- process/physics.py | 21 ++++++++++++++++++--- tests/unit/test_physics.py | 4 +++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/process/physics.py b/process/physics.py index ec26cccfdc..f08b436857 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2022,7 +2022,7 @@ def calculate_plasma_current( rminor: float, sf: float, triang: float, - triang95: float + triang95: float, ) -> Tuple[float, float, float, float, float]: """Calculate the plasma current. @@ -2158,7 +2158,13 @@ def calculate_plasma_current( # Main plasma current calculation using the fq value from the different settings if i_plasma_current != 2: - plascur = (constants.twopi / constants.rmu0) * rminor**2 / (rmajor * q95) * fq * bt + plascur = ( + (constants.twopi / constants.rmu0) + * rminor**2 + / (rmajor * q95) + * fq + * bt + ) # i_plasma_current == 2 case covered above # Calculate cyclindrical safety factor @@ -2176,7 +2182,16 @@ def calculate_plasma_current( # Calculate the poloidal field generated by the plasma current bp = bpol( - i_plasma_current, plascur, q95, aspect_ratio, eps, bt, kappa, triang, pperim, constants.rmu0 + i_plasma_current, + plascur, + q95, + aspect_ratio, + eps, + bt, + kappa, + triang, + pperim, + constants.rmu0, ) if iprofile == 1: diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 31b0416a73..d9fb30a846 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -597,7 +597,9 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): """ monkeypatch.setattr( - physics_variables, "normalised_total_beta", plasmacurrentparam.normalised_total_beta + physics_variables, + "normalised_total_beta", + plasmacurrentparam.normalised_total_beta, ) monkeypatch.setattr(physics_variables, "beta", plasmacurrentparam.beta) From 2e20df7315bb745836d515dec92e9498f74bb2c0 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 2 Aug 2024 15:49:33 +0100 Subject: [PATCH 006/108] Documentation added for Peng (i_plasma_current = 1) --- .../plasma_current/plasma_current.md | 68 +++++++++++++------ .../physics-models/plasma_geometry.md | 2 +- 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 888180b709..5274c676cf 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -1,28 +1,58 @@ -# Plasma Current Scaling Laws +# Plasma Current + +## Overview + + + + + + + +## Plasma Current Calculation | `calculate_plasma_current()` A number of plasma current scaling laws are available in PROCESS [^1]. These are calculated in -routine `culcur`, which is called by `physics`. The safety factor $q_{95}$ required to prevent -disruptive MHD instabilities dictates the plasma current Ip: +routine `calculate_plasma_current()`, in `physics.py`. The safety factor $q_{95}$ required to prevent +disruptive MHD instabilities dictates the plasma current $I_{\text{p}}$: $$\begin{aligned} -I_p = \frac{2\pi}{\mu_0} B_t \frac{a^2 f_q}{Rq_{95}} +I_{\text{p}} = f_q \frac{2\pi}{\mu_0} \frac{a^2 B_{\text{T}}}{R \ q_{95}} \end{aligned}$$ The factor $f_q$ makes allowance for toroidal effects and plasma shaping (elongation and -triangularity). Several formulae for this factor are available [2,3] depending on the value of -the switch `icurr`, as follows: - -| `icurr` | Description | -| :-: | - | -| 1 | Peng analytic fit | -| 2 | Peng double null divertor scaling (ST)[^4] | -| 3 | Simple ITER scaling | -| 4 | Revised ITER scaling[^5] $f_q = \frac{1.17-0.65\epsilon}{2(1-\epsilon^2)^2} (1 + \kappa_{95}^2 (1+2\delta_{95}^2 - 1.2\delta_{95}^3) )$| -| 5 | Todd empirical scaling, I | -| 6 | Todd empirical scaling, II | -| 7 | Connor-Hastie model | -| 8 | Sauter model, allows negative $\delta$ | -| 9 | Scaling for spherical tokamaks, based on a fit to a family of equilibria derived by Fiesta: $f_q = 0.538 (1 + 2.44\epsilon^{2.736}) \kappa^{2.154} \delta^{0.06}$| +triangularity). Several formulae for this factor are available depending on the value of +the switch `i_plasma_current`, as follows: + +--------------- + +### Peng analytic fit + +Switch value: `i_plasma_current = 1` + +The formula for calculating `fq` is: + +$$f_q = \left(\frac{{1.22 - 0.68 \epsilon}}{{(1.0 - \epsilon^2)^2}}\right) \mathtt{{sf}}^2$$ + +Where $\epsilon$ is the inverse [aspect ratio](../plasma_geometry.md) ($\mathtt{eps}$) and $\mathtt{sf}$ is the shaping factor calculated in the [poloidal perimeter](../plasma_geometry.md#poloidal-perimeter) function in `plasma_geometry.py` + +----------- + +### 2.Peng double null divertor scaling (ST) +[^4] + +### 3. Simple ITER scaling + +### 4. Revised ITER scaling +[^5] + +### 5. Todd empirical scaling, I + +### 6. Todd empirical scaling, II + +### 7. Connor-Hastie model + +### 8. Sauter model, allows negative $\delta$ + +### 9. Scaling for spherical tokamaks, based on a fit to a family of equilibria derived by Fiesta: ## Plasma Current Profile Consistency @@ -43,7 +73,7 @@ $$\begin{aligned} g = 4 l_i \end{aligned}$$ -It is recommended that current scaling law `icurr = 4` is used if `iprofile = 1`. +It is recommended that current scaling law `i_plasma_current = 4` is used if `iprofile = 1`. This relation is only applicable to large aspect ratio tokamaks. For spherical tokamaks, the normalised internal inductance can be set from the elongation using `iprofile = 4` or `iprofile = 5`: diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 427bad0289..a0229dea46 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -377,7 +377,7 @@ $$ \mathtt{pperim} = 2.0 \times (\mathtt{xo} \times \mathtt{thetao} + \mathtt{xi} \times \mathtt{thetai}) $$ -The shaping factor for `i_plasma_current=1` is also claculated here: +The shaping factor for `i_plasma_current = 1` is also calculated here: $$ \mathtt{sf} = \frac{\mathtt{pperim}}{ 2.0\pi a} From ca530171e8107f977402c5c06281ad69fb296531 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 2 Aug 2024 15:53:44 +0100 Subject: [PATCH 007/108] Rename plasc to calculate_plasma_current_peng --- process/physics.py | 4 ++-- tests/unit/test_physics.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/process/physics.py b/process/physics.py index f08b436857..c2f7288301 100644 --- a/process/physics.py +++ b/process/physics.py @@ -147,7 +147,7 @@ def bpol(i_plasma_current, ip, qbar, aspect, eps, bt, kappa, delta, perim, rmu0) @nb.jit(nopython=True, cache=True) -def plasc(qbar, aspect, eps, rminor, bt, kappa, delta): +def calculate_plasma_current_peng(qbar, aspect, eps, rminor, bt, kappa, delta): """Function to calculate plasma current (Peng scaling) author: J Galambos, FEDC/ORNL author: P J Knight, CCFE, Culham Science Centre @@ -2097,7 +2097,7 @@ def calculate_plasma_current( # Peng scaling for double null divertor; TARTs [STAR Code] elif i_plasma_current == 2: - plascur = 1.0e6 * plasc(q95, aspect_ratio, eps, rminor, bt, kappa, triang) + plascur = 1.0e6 * calculate_plasma_current_peng(q95, aspect_ratio, eps, rminor, bt, kappa, triang) # Simple ITER scaling (simply the cylindrical case) elif i_plasma_current == 3: diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index d9fb30a846..5ba22e1507 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -16,7 +16,7 @@ diamagnetic_fraction_scene, diamagnetic_fraction_hender, ps_fraction_scene, - plasc, + calculate_plasma_current_peng, culblm, conhas, vscalc, @@ -666,7 +666,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): ), ) def test_plasc(arguments, expected): - assert plasc(**arguments) == pytest.approx(expected) + assert calculate_plasma_current_peng(**arguments) == pytest.approx(expected) @pytest.mark.parametrize( From 90d824183486c649a9cf6f7abb279834b24540b8 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 7 Aug 2024 11:49:12 +0100 Subject: [PATCH 008/108] Fix calling of i_plasma_current == 6 for the 2nd Todd scaling --- process/physics.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/process/physics.py b/process/physics.py index c2f7288301..3e9c482e52 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2097,7 +2097,9 @@ def calculate_plasma_current( # Peng scaling for double null divertor; TARTs [STAR Code] elif i_plasma_current == 2: - plascur = 1.0e6 * calculate_plasma_current_peng(q95, aspect_ratio, eps, rminor, bt, kappa, triang) + plascur = 1.0e6 * calculate_plasma_current_peng( + q95, aspect_ratio, eps, rminor, bt, kappa, triang + ) # Simple ITER scaling (simply the cylindrical case) elif i_plasma_current == 3: @@ -2116,11 +2118,11 @@ def calculate_plasma_current( ) # Todd empirical scalings + # D.C.Robinson and T.N.Todd, Plasma and Contr Fusion 28 (1986) 1181 elif i_plasma_current in [5, 6]: fq = ( - (1.0 + 2.0 * eps * eps) - * 0.5 - * (1.0 + kappa95**2) + (1.0 + 2.0 * eps**2) + * ((1.0 + kappa95**2) / 0.5) * ( 1.24 - 0.54 * kappa95 @@ -2129,7 +2131,8 @@ def calculate_plasma_current( ) ) - fq *= 1 if i_plasma_current == 7 else (1.0 + (abs(kappa95 - 1.2)) ** 3) + if i_plasma_current == 6: + fq *= 1.0 + (abs(kappa95 - 1.2)) ** 3 # Connor-Hastie asymptotically-correct expression elif i_plasma_current == 7: From 6331862c3cfbbe9431d9a7adf0d394f2628e20f7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 8 Aug 2024 09:29:46 +0100 Subject: [PATCH 009/108] Rename idia to i_diamagnetic_fraction and place idia into the obsolete variables list --- .../plasma_current/diamagnetic_current.md | 6 +++--- process/io/obsolete_vars.py | 1 + process/physics.py | 10 +++++----- process/utilities/errorlist.json | 2 +- source/fortran/input.f90 | 6 +++--- source/fortran/physics_variables.f90 | 4 ++-- tests/integration/ref_dicts.json | 10 +++++----- tests/regression/input_files/st_regression.IN.DAT | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md b/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md index 904a5429ce..87f7d1baa9 100644 --- a/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md @@ -4,12 +4,12 @@ aspect ratio, it should be included and two scalings are offered. If the diamag current is expected to be above one per cent of the plasma current, a warning is issued to calculate it. -`idia = 0` Diamagnetic current fraction is zero. +`i_diamagnetic_current = 0` Diamagnetic current fraction is zero. -`idia = 1` Diamagnetic current fraction is calculated using a fit to spherical tokamak calculations by Tim Hender: +`i_diamagnetic_current = 1` Diamagnetic current fraction is calculated using a fit to spherical tokamak calculations by Tim Hender: $$f_{dia} = \frac{\beta}{2.8}$$ -`idia = 2` Diamagnetic current fraction is calculated using a SCENE fit for all aspect ratios: +`i_diamagnetic_current = 2` Diamagnetic current fraction is calculated using a SCENE fit for all aspect ratios: $$f_{dia} = 0.414 \space \beta \space (\frac{0.1 q_{95}}{q_0} + 0.44)$$ \ No newline at end of file diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index fc8d615fdd..e044ec7a26 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -114,6 +114,7 @@ "ieped": None, "eped_sf": None, "icurr": "i_plasma_current", + "idia": "i_diamagnetic_current", } OBS_VARS_HELP = { diff --git a/process/physics.py b/process/physics.py index 3e9c482e52..344b142fce 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1016,9 +1016,9 @@ def physics(self): ) physics_module.err242 = 1 - if physics_variables.idia == 1: + if physics_variables.i_diamagnetic_current == 1: current_drive_variables.diaipf = current_drive_variables.diacf_hender - elif physics_variables.idia == 2: + elif physics_variables.i_diamagnetic_current == 2: current_drive_variables.diaipf = current_drive_variables.diacf_scene if physics_variables.ips == 1: @@ -4150,7 +4150,7 @@ def outplas(self): " (Sauter et al bootstrap current fraction model used)", ) - if physics_variables.idia == 0: + if physics_variables.i_diamagnetic_current == 0: po.ocmmnt( self.outfile, " (Diamagnetic current fraction not calculated)" ) @@ -4158,11 +4158,11 @@ def outplas(self): if current_drive_variables.diacf_scene > 0.01e0: error_handling.report_error(244) - elif physics_variables.idia == 1: + elif physics_variables.i_diamagnetic_current == 1: po.ocmmnt( self.outfile, " (Hender diamagnetic current fraction scaling used)" ) - elif physics_variables.idia == 2: + elif physics_variables.i_diamagnetic_current == 2: po.ocmmnt( self.outfile, " (SCENE diamagnetic current fraction scaling used)" ) diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index ba23e36b35..0489fd24fc 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -1228,7 +1228,7 @@ { "no": 244, "level": 2, - "message": "PHYSICS: Diamagnetic fraction is more than 1%, but not calculated. Consider using idia=2 and ips=1." + "message": "PHYSICS: Diamagnetic fraction is more than 1%, but not calculated. Consider using i_diamagnetic_current=2 and ips=1." }, { "no": 245, diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 1b5f5ac8ca..3bf37863bd 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -312,7 +312,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) teped, fhe3, iwalld, gamma, falpha, fgwped, tbeta, ibss, & iradloss, te, alphan, rmajor, kappa, iinvqd, fkzohm, beamfus0, & tauratio, idensl, bt, iscrp, ipnlaws, betalim, betalim_lower, & - idia, ips, m_s_limit, burnup_in + i_diamagnetic_current, ips, m_s_limit, burnup_in use pf_power_variables, only: iscenr, maxpoloidalpower use pulse_variables, only: lpulse, dtstor, itcycl, istore, bctmp @@ -630,8 +630,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('idensl') call parse_int_variable('idensl', idensl, 1, 7, & 'Switch for enforced density limit') - case ('idia') - call parse_int_variable('idia', idia, 0, 2, & + case ('i_diamagnetic_current') + call parse_int_variable('i_diamagnetic_current', i_diamagnetic_current, 0, 2, & 'Switch for diamagnetic scaling') case ('ifalphap') call parse_int_variable('ifalphap', ifalphap, 0, 1, & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index ecd5e97017..e6eec3c034 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -271,7 +271,7 @@ module physics_variables !! - =8 Sauter scaling allowing negative triangularity !! - =9 FIESTA ST fit - integer :: idia + integer :: i_diamagnetic_current !! switch for diamagnetic current scaling !! !! - =0 Do not calculate @@ -951,7 +951,7 @@ subroutine init_physics_variables ibss = 3 iculbl = 0 i_plasma_current = 4 - idia = 0 + i_diamagnetic_current = 0 idensl = 7 idivrt = 2 ifalphap = 1 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 412d769ec2..5cced39992 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -2430,7 +2430,7 @@ "iculbl": 0.0, "i_plasma_current": 4.0, "idensl": 7.0, - "idia": 0.0, + "i_diamagnetic_current": 0.0, "idiags": [ "INT_DEFAULT", "INT_DEFAULT", @@ -9805,7 +9805,7 @@ "iculbl": "switch for beta limit scaling (`constraint equation 24`)\n
      \n
    • =0 apply limit to total beta
    • \n
    • =1 apply limit to thermal beta
    • \n
    • =2 apply limit to thermal + neutral beam beta
    • \n
    • =3 apply limit to toroidal beta
    • \n
    ", "i_plasma_current": "switch for plasma current scaling to use\n
      \n
    • =1 Peng analytic fit
    • \n
    • =2 Peng double null divertor scaling (ST)
    • \n
    • =3 simple ITER scaling (k = 2.2, d = 0.6)
    • \n
    • =4 later ITER scaling, a la Uckan
    • \n
    • =5 Todd empirical scaling I
    • \n
    • =6 Todd empirical scaling II
    • \n
    • =7 Connor-Hastie model
    • \n
    • =8 Sauter scaling allowing negative triangularity
    • \n
    • =9 FIESTA ST fit
    • \n
    ", "idensl": "switch for density limit to enforce (`constraint equation 5`)\n
      \n
    • =1 old ASDEX
    • \n
    • =2 Borrass model for ITER (I)
    • \n
    • =3 Borrass model for ITER (II)
    • \n
    • =4 JET edge radiation
    • \n
    • =5 JET simplified
    • \n
    • =6 Hugill-Murakami Mq limit
    • \n
    • =7 Greenwald limit
    • \n
    ", - "idia": "switch for diamagnetic current scaling\n
      \n
    • =0 Do not calculate
    • \n
    • =1 Use original TART scaling
    • \n
    • =2 Use SCENE scaling
    • \n
    ", + "i_diamagnetic_current": "switch for diamagnetic current scaling\n
      \n
    • =0 Do not calculate
    • \n
    • =1 Use original TART scaling
    • \n
    • =2 Use SCENE scaling
    • \n
    ", "idiags": "", "idivrt": "number of divertors (calculated from `i_single_null`)", "iefrf": "Switch for current drive efficiency model:\n
      \n
    • =1 Fenstermacher Lower Hybrid
    • \n
    • =2 Ion Cyclotron current drive
    • \n
    • =3 Fenstermacher ECH
    • \n
    • =4 Ehst Lower Hybrid
    • \n
    • =5 ITER Neutral Beam
    • \n
    • =6 new Culham Lower Hybrid model
    • \n
    • =7 new Culham ECCD model
    • \n
    • =8 new Culham Neutral Beam model
    • \n
    • =9 RFP option removed in PROCESS (issue #508)
    • \n
    • =10 ECRH user input gamma
    • \n
    • =11 ECRH \"HARE\" model (E. Poli, Physics of Plasmas 2019)
    • \n
    • =12 EBW user scaling input. Scaling (S. Freethy)
    • \n
    ", @@ -13324,7 +13324,7 @@ "lb": 1, "ub": 7 }, - "idia": { + "i_diamagnetic_current": { "lb": 0, "ub": 2 }, @@ -19105,7 +19105,7 @@ "ibss", "iculbl", "i_plasma_current", - "idia", + "i_diamagnetic_current", "idensl", "idivrt", "ifalphap", @@ -20429,7 +20429,7 @@ "iculbl": "int_variable", "i_plasma_current": "int_variable", "idensl": "int_variable", - "idia": "int_variable", + "i_diamagnetic_current": "int_variable", "iefrf": "int_variable", "iefrffix": "int_variable", "ifalphap": "int_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 3e9a6220ae..6b8ef1c74a 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -2964,7 +2964,7 @@ icurr = 9 * JUSTIFICATION: Fit derived from FIESTA for FNSF-like Plasmas * REFERENCE: Muldrew et al. (2020), Fus. Eng. & Des., 154, 111530 -idia = 2 +i_diamagnetic_current = 2 * DESCRIPTION: Switch for Diamagnetic Current Scaling (2: SCENE Fit) * JUSTIFICATION: From bb97f2f40a7976623106ee57467738f106d155e9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 8 Aug 2024 10:56:36 +0100 Subject: [PATCH 010/108] Add type hints and expanded docstrings to the Hender and SCENE diamagnetic plasma current functions --- process/physics.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/process/physics.py b/process/physics.py index 344b142fce..38bb5377ff 100644 --- a/process/physics.py +++ b/process/physics.py @@ -436,20 +436,32 @@ def bsinteg( return (q / q95) * (al1 * (a1 + pratio * (a1 + alphai * a2)) + al2 * a2) -def diamagnetic_fraction_hender(beta): - """author: S.I. Muldrew, CCFE, Culham Science Centre - Diamagnetic contribution at tight aspect ratio. - Tim Hender fit +def diamagnetic_fraction_hender(beta: float) -> float: + """ + Calculate the diamagnetic fraction based on the Hender fit. + + Parameters: + - beta: float, the plasma beta value + + Returns: + - float, the diamagnetic fraction """ return beta / 2.8 -def diamagnetic_fraction_scene(beta, q95, q0): - """author: S.I. Muldrew, CCFE, Culham Science Centre - Diamagnetic fraction based on SCENE fit by Tim Hender - See Issue #992 +def diamagnetic_fraction_scene(beta: float, q95: float, q0: float) -> float: + """ + Calculate the diamagnetic fraction based on the SCENE fit by Tim Hender. + + Parameters: + - beta: float, the plasma beta value + - q95: float, the normalized safety factor at 95% of the plasma radius + - q0: float, the normalized safety factor at the magnetic axis + + Returns: + - float, the diamagnetic fraction """ - return beta * (0.1 * q95 / q0 + 0.44) * 4.14e-1 + return beta * (0.1 * q95 / q0 + 0.44) * 0.414 def ps_fraction_scene(beta): From 11e2aed9e9ead59a9019eb6e117f5a8e69fe6b60 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 15 Aug 2024 14:51:00 +0100 Subject: [PATCH 011/108] :memo: chore: Update diamagnetic current documentation --- .../plasma_current/diamagnetic_current.md | 50 ++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md b/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md index 87f7d1baa9..17fd97a716 100644 --- a/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/diamagnetic_current.md @@ -1,15 +1,53 @@ -The diamagnetic current fraction $f_{dia}$ is strongly related to $\beta$ and is typically small, + + +## Overview + +The diamagnetic current fraction $f_{\text{dia}}$ is strongly related to $\beta$ and is typically small, hence it is usually neglected. For high $\beta$ plasmas, such as those at tight aspect ratio, it should be included and two scalings are offered. If the diamagnetic current is expected to be above one per cent of the plasma current, a warning is issued to calculate it. -`i_diamagnetic_current = 0` Diamagnetic current fraction is zero. +$$ +J_{\text{dia}} = \frac{RB_{\theta}}{B^2}\frac{dP}{d\psi} +$$ + +$$ +\frac{I_{\text{dia}}}{I_{\text{p}}} = \frac{\beta_0}{2}\int_0^1 \frac{\rho^2q(a)}{q(\rho)}\frac{d\left(\frac{P}{P(0)}\right)}{dx} dx +$$ + +Where $\rho$ is the normalised radius = $\frac{r}{a}$ + +----------------------------------- + +### No diamagnetic current + +To have it so that the diamagnetic current is not calculated you can set `i_diamagnetic_current = 0` + +------------------------------------ + +### T.Hender fit for ST's: + +This model can be used by setting: `i_diamagnetic_current = 1` + + +$$f_{\text{dia}} = \frac{\beta}{2.8}$$ + + + +------------------------------------ + +### SCENE fit: -`i_diamagnetic_current = 1` Diamagnetic current fraction is calculated using a fit to spherical tokamak calculations by Tim Hender: +This model can be used by setting: `i_diamagnetic_current = 2` -$$f_{dia} = \frac{\beta}{2.8}$$ +This model is based off of 108 equlibria from SCENE. +Overall the equilibria cover: -`i_diamagnetic_current = 2` Diamagnetic current fraction is calculated using a SCENE fit for all aspect ratios: +- $A$ = 1.6 to 3.2 +- $\beta$ = 0.5% to 26% +- $\frac{P(0)}{\langle P \rangle}$ = 1.8 to 7.2 +- $l_i$(2) = 0.21 to 1.0 +- $\frac{q_{95}}{q(0)}$ = 0.9 to 16 \ \ (i.e. deeply hollow current to very peaked) -$$f_{dia} = 0.414 \space \beta \space (\frac{0.1 q_{95}}{q_0} + 0.44)$$ \ No newline at end of file +$$f_{\text{dia}} = 0.414 \space \beta \space \left(\frac{0.1 q_{95}}{q_0} + 0.44\right)$$ \ No newline at end of file From edc4afecc49740e62d62f7cd8f1268ac8168eaa7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 15 Aug 2024 15:07:12 +0100 Subject: [PATCH 012/108] =?UTF-8?q?:memo:=20chore:=20Update=20Pfirsch-Schl?= =?UTF-8?q?=C3=BCter=20current=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pfirsch_schl\303\274ter_current_drive.md" | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git "a/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" "b/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" index 99c8b2941f..06d8ac494f 100644 --- "a/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" +++ "b/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" @@ -1,12 +1,34 @@ -A similar scaling is available for the Pfirsch-Schlüter current fraction $f_{PS}$. This is +## Overview + +A similar scaling is available for the Pfirsch-Schlüter current fraction $f_{\text{PS}}$. This is typically smaller than the diamagnetic current, but is negative. -`ips = 0` Pfirsch-Schlüter current fraction is set to zero. +There is no ability to input the diamagnetic and Pfirsch-Schlüter current +directly. In this case, it is recommended to turn off these two scalings +and to use the method of fixing the bootstrap current fraction. -`ips = 1` Pfirsch-Schlüter current fraction is calculated using a SCENE fit for all aspect ratios: +-------------- -$$ f_{PS} = -0.09 \beta $$ +### No Pfirsch-Schlüter current + +To have it so that the Pfirsch-Schlüter current is not calculated you can set `ips = 0` + +------------------ + +### SCENE Fit: + +This model can be used by setting: `ips = 2` + +This model is based off of 108 equlibria from SCENE. +Overall the equilibria cover: + +- $A$ = 1.6 to 3.2 +- $\beta$ = 0.5% to 26% +- $\frac{P(0)}{\langle P \rangle}$ = 1.8 to 7.2 +- $l_i$(2) = 0.21 to 1.0 +- $\frac{q_{95}}{q(0)}$ = 0.9 to 16 \ \ (i.e. deeply hollow current to very peaked) + +This fit is derived from the sama dataset used to derive the diamagnetic current fraction for [`i_diamagnetic_current = 2`](diamagnetic_current.md#scene-fit) + +$$ f_{\text{PS}} = -0.09 \beta $$ -There is no ability to input the diamagnetic and Pfirsch-Schlüter current -directly. In this case, it is recommended to turn off these two scalings -and to use the method of fixing the bootstrap current fraction. \ No newline at end of file From 44f9a97e26fbb24b9f09ca12481827f00b8899ba Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 15 Aug 2024 15:11:41 +0100 Subject: [PATCH 013/108] :art: refactor: Update ps_fraction_scene function documentation Update the documentation for the ps_fraction_scene function to provide a clear explanation of its purpose and parameters. --- process/physics.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/process/physics.py b/process/physics.py index b1b6061957..b0fc258813 100644 --- a/process/physics.py +++ b/process/physics.py @@ -464,10 +464,15 @@ def diamagnetic_fraction_scene(beta: float, q95: float, q0: float) -> float: return beta * (0.1 * q95 / q0 + 0.44) * 0.414 -def ps_fraction_scene(beta): - """author: S.I. Muldrew, CCFE, Culham Science Centre - Pfirsch-Schlüter fraction based on SCENE fit by Tim Hender - See Issue #992 +def ps_fraction_scene(beta: float) -> float: + """ + Calculate the Pfirsch-Schlüter fraction based on the SCENE fit by Tim Hender 2019. + + Parameters: + - beta: float, the plasma beta value + + Returns: + - float, the Pfirsch-Schlüter current fraction """ return -9e-2 * beta From c9a74203721f3888e673049c2b5ac96e6e1c7614 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 15 Aug 2024 16:26:41 +0100 Subject: [PATCH 014/108] :bug: refactor: Update i_diamagnetic_current variable name in initial.f90 --- source/fortran/initial.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/fortran/initial.f90 b/source/fortran/initial.f90 index 5a0bfd63ba..f931060c28 100755 --- a/source/fortran/initial.f90 +++ b/source/fortran/initial.f90 @@ -258,7 +258,7 @@ subroutine check use physics_variables, only: aspect, fdeut, fgwped, fhe3, & fgwsep, ftrit, ibss, i_single_null, i_plasma_current, idivrt, ishape, & iradloss, isc, ipedestal, ilhthresh, itart, nesep, rhopedn, rhopedt, & - rnbeam, neped, te, tauee_in, tesep, teped, itartpf, ftar, idia + rnbeam, neped, te, tauee_in, tesep, teped, itartpf, ftar, i_diamagnetic_current use pulse_variables, only: lpulse use reinke_variables, only: fzactual, impvardiv use tfcoil_variables, only: casthi, casthi_is_fraction, casths, i_tf_sup, & @@ -828,7 +828,7 @@ subroutine check call report_error(283) end if - if ( ibss == 5 .and. idia /= 0 ) then + if ( ibss == 5 .and. i_diamagnetic_current /= 0 ) then call report_error(284) end if From adfca06d3c53cbf959e739811604c4317825479a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 15 Aug 2024 16:32:45 +0100 Subject: [PATCH 015/108] :art: refactor: Update "ibss" to "i_bootstrap_current" variable name and value in multiple files. "ibss" added to obsolete variables list --- .../fusion-devices/spherical-tokamak.md | 2 +- .../proc-pages/physics-models/error.txt | 6 ++--- .../plasma_current/bootstrap_current.md | 6 ++--- process/io/obsolete_vars.py | 1 + process/physics.py | 22 +++++++++---------- process/utilities/errorlist.json | 4 ++-- source/fortran/current_drive_variables.f90 | 4 ++-- source/fortran/initial.f90 | 6 ++--- source/fortran/input.f90 | 6 ++--- source/fortran/physics_variables.f90 | 4 ++-- tests/integration/ref_dicts.json | 14 ++++++------ .../input_files/large_tokamak.IN.DAT | 2 +- .../input_files/large_tokamak_nof.IN.DAT | 2 +- .../large_tokamak_once_through.IN.DAT | 2 +- .../input_files/st_regression.IN.DAT | 4 ++-- 15 files changed, 43 insertions(+), 42 deletions(-) diff --git a/documentation/proc-pages/fusion-devices/spherical-tokamak.md b/documentation/proc-pages/fusion-devices/spherical-tokamak.md index 0b7c4e170c..1a48d8ca6f 100644 --- a/documentation/proc-pages/fusion-devices/spherical-tokamak.md +++ b/documentation/proc-pages/fusion-devices/spherical-tokamak.md @@ -43,7 +43,7 @@ Switch `itart` provides overall control of the ST switches within the code, and | Switch | Conventional aspect ratio (`itart = 0`) | Low aspect ratio (`itart = 1`) | | --- | --- | --- | | `ishape` | 0, 2, 3, 4 | 1, 5, 6, 7, 8 | -| `ibss` | 1, 2, 3 | 2, 3 | +| `i_bootstrap_current` | 1, 2, 3 | 2, 3 | | `i_plasma_current` | 1, 3, 4, 5, 6, 7 | 2, 9 | | `itfsup` | 0, 1 | 0 | diff --git a/documentation/proc-pages/physics-models/error.txt b/documentation/proc-pages/physics-models/error.txt index 2f9529e681..35d8231d24 100644 --- a/documentation/proc-pages/physics-models/error.txt +++ b/documentation/proc-pages/physics-models/error.txt @@ -1042,15 +1042,15 @@ Scalings}\label{bootstrap-diamagnetic-and-pfirsch-schluxfcter-current-scalings} The fraction of the plasma current provided by the so-called bootstrap effect can be either input into the code directly, or calculated using one of four methods, as summarised here. Note that methods -\texttt{ibss\ =\ 1-3} use fits to parabolic density and temperature +\texttt{i_bootstrap_current\ =\ 1-3} use fits to parabolic density and temperature profiles, and do not take into account the existence of pedestals (\texttt{ipedestal\ =\ 1}), whereas the Sauter et al. scaling -(\texttt{ibss\ =\ 4}) allows general profiles to be used. +(\texttt{i_bootstrap_current\ =\ 4}) allows general profiles to be used. \begin{longtable}[]{@{}cl@{}} \toprule \begin{minipage}[b]{0.05\columnwidth}\centering\strut -\texttt{ibss}\strut +\texttt{i_bootstrap_current}\strut \end{minipage} & \begin{minipage}[b]{0.03\columnwidth}\raggedright\strut Description\strut \end{minipage}\tabularnewline diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index 9a6ed70f60..066e62f5b2 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -1,10 +1,10 @@ The fraction of the plasma current provided by the bootstrap effect can be either input into the code directly, or calculated using one of four -methods, as summarised here. Note that methods `ibss = 1-3` do not take into account the +methods, as summarised here. Note that methods `i_bootstrap_current = 1-3` do not take into account the existence of pedestals, whereas the Sauter et al. scaling -(`ibss = 4`) allows general profiles to be used. +(`i_bootstrap_current = 4`) allows general profiles to be used. -| `ibss` | Description | +| `i_bootstrap_current` | Description | | :-: | - | | 1 | ITER scaling -- To use the ITER scaling method for the bootstrap current fraction. Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). This method is valid at high aspect ratio only. | 2 | General scaling -- To use a more general scaling method, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index e044ec7a26..b5d5ecdefe 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -115,6 +115,7 @@ "eped_sf": None, "icurr": "i_plasma_current", "idia": "i_diamagnetic_current", + "ibss": "i_bootstrap_current", } OBS_VARS_HELP = { diff --git a/process/physics.py b/process/physics.py index b0fc258813..322b9a1341 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1027,20 +1027,20 @@ def physics(self): current_drive_variables.bootipf = abs(current_drive_variables.bscfmax) current_drive_variables.plasipf = current_drive_variables.bootipf else: - if physics_variables.ibss == 1: + if physics_variables.i_bootstrap_current == 1: current_drive_variables.bootipf = current_drive_variables.bscf_iter89 - elif physics_variables.ibss == 2: + elif physics_variables.i_bootstrap_current == 2: current_drive_variables.bootipf = current_drive_variables.bscf_nevins - elif physics_variables.ibss == 3: + elif physics_variables.i_bootstrap_current == 3: current_drive_variables.bootipf = current_drive_variables.bscf_wilson - elif physics_variables.ibss == 4: + elif physics_variables.i_bootstrap_current == 4: current_drive_variables.bootipf = current_drive_variables.bscf_sauter - elif physics_variables.ibss == 5: + elif physics_variables.i_bootstrap_current == 5: # Sakai states that the ACCOME dataset used has the toridal diamagnetic current included in the bootstrap current # So the diamagnetic current calculation should be turned off when using, (idia = 0). current_drive_variables.bootipf = current_drive_variables.bscf_sakai else: - error_handling.idiags[0] = physics_variables.ibss + error_handling.idiags[0] = physics_variables.i_bootstrap_current error_handling.report_error(75) physics_module.err242 = 0 @@ -4173,25 +4173,25 @@ def outplas(self): po.ocmmnt( self.outfile, " (User-specified bootstrap current fraction used)" ) - elif physics_variables.ibss == 1: + elif physics_variables.i_bootstrap_current == 1: po.ocmmnt( self.outfile, " (ITER 1989 bootstrap current fraction model used)" ) - elif physics_variables.ibss == 2: + elif physics_variables.i_bootstrap_current == 2: po.ocmmnt( self.outfile, " (Nevins et al bootstrap current fraction model used)", ) - elif physics_variables.ibss == 3: + elif physics_variables.i_bootstrap_current == 3: po.ocmmnt( self.outfile, " (Wilson bootstrap current fraction model used)" ) - elif physics_variables.ibss == 4: + elif physics_variables.i_bootstrap_current == 4: po.ocmmnt( self.outfile, " (Sauter et al bootstrap current fraction model used)", ) - elif physics_variables.ibss == 5: + elif physics_variables.i_bootstrap_current == 5: po.ocmmnt( self.outfile, " (Sakai et al bootstrap current fraction model used)", diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index 2c1347f17c..b6a496734d 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -198,7 +198,7 @@ { "no": 38, "level": 3, - "message": "CHECK: Invalid boostrap current law for ST, do not use ibss = 1" + "message": "CHECK: Invalid boostrap current law for ST, do not use i_bootstrap_current = 1" }, { "no": 39, @@ -383,7 +383,7 @@ { "no": 75, "level": 3, - "message": "PHYSICS: Illegal value of ibss" + "message": "PHYSICS: Illegal value of i_bootstrap_current" }, { "no": 76, diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index d8db4048a5..6d18a01286 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -24,7 +24,7 @@ module current_drive_variables !! Fusion gain; P_fusion / (P_injection + P_ohmic) real(dp) :: bootipf - !! bootstrap current fraction (enforced; see ibss) + !! bootstrap current fraction (enforced; see i_bootstrap_current) real(dp) :: bscfmax !! maximum fraction of plasma current from bootstrap; if `bscfmax < 0`, @@ -46,7 +46,7 @@ module current_drive_variables !! Bootstrap current fraction, Sakai et al model real(dp) :: cboot - !! bootstrap current fraction multiplier (`ibss=1`) + !! bootstrap current fraction multiplier (`i_bootstrap_current=1`) real(dp) :: cnbeam !! neutral beam current (A) diff --git a/source/fortran/initial.f90 b/source/fortran/initial.f90 index f931060c28..55151e6b00 100755 --- a/source/fortran/initial.f90 +++ b/source/fortran/initial.f90 @@ -256,7 +256,7 @@ subroutine check boundu use pfcoil_variables, only: ipfres, ngrp, pfclres, ipfloc, ncls, isumatoh use physics_variables, only: aspect, fdeut, fgwped, fhe3, & - fgwsep, ftrit, ibss, i_single_null, i_plasma_current, idivrt, ishape, & + fgwsep, ftrit, i_bootstrap_current, i_single_null, i_plasma_current, idivrt, ishape, & iradloss, isc, ipedestal, ilhthresh, itart, nesep, rhopedn, rhopedt, & rnbeam, neped, te, tauee_in, tesep, teped, itartpf, ftar, i_diamagnetic_current use pulse_variables, only: lpulse @@ -560,7 +560,7 @@ subroutine check end if ! Check if the boostrap current selection is addapted to ST - if (ibss == 1) call report_error(38) + if (i_bootstrap_current == 1) call report_error(38) ! Check if a single null divertor is used in double null machine if (i_single_null == 0 .and. (ftar == 1.0 .or. ftar == 0.0)) then @@ -828,7 +828,7 @@ subroutine check call report_error(283) end if - if ( ibss == 5 .and. i_diamagnetic_current /= 0 ) then + if ( i_bootstrap_current == 5 .and. i_diamagnetic_current /= 0 ) then call report_error(284) end if diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 8783f1a6e4..64b742a2be 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -309,7 +309,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, ftrit, & ifalphap, tauee_in, alphaj, alphat, i_plasma_current, q, ti, tesep, rli, triang, & itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & - teped, fhe3, iwalld, gamma, falpha, fgwped, tbeta, ibss, & + teped, fhe3, iwalld, gamma, falpha, fgwped, tbeta, i_bootstrap_current, & iradloss, te, alphan, rmajor, kappa, iinvqd, fkzohm, beamfus0, & tauratio, idensl, bt, iscrp, ipnlaws, betalim, betalim_lower, & i_diamagnetic_current, ips, m_s_limit, burnup_in @@ -618,8 +618,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('taumax') call parse_real_variable('taumax', taumax, 0.1D0, 100.0D0, & 'Maximum allowed energy confinement time (s)') - case ('ibss') - call parse_int_variable('ibss', ibss, 1, 5, & + case ('i_bootstrap_current') + call parse_int_variable('i_bootstrap_current', i_bootstrap_current, 1, 5, & 'Switch for bootstrap scaling') case ('iculbl') call parse_int_variable('iculbl', iculbl, 0, 3, & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 1cabc45932..d7c39d05f3 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -242,7 +242,7 @@ module physics_variables real(dp) :: taumax !! Maximum allowed energy confinement time (s) - integer :: ibss + integer :: i_bootstrap_current !! switch for bootstrap current scaling !! !! - =1 ITER 1989 bootstrap scaling (high R/a only) @@ -949,7 +949,7 @@ subroutine init_physics_variables hfac = 0.0D0 hfact = 1.0D0 taumax = 10.0D0 - ibss = 3 + i_bootstrap_current = 3 iculbl = 0 i_plasma_current = 4 i_diamagnetic_current = 0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 5cced39992..cb5d7460fe 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -2332,7 +2332,7 @@ "iblanket": 1.0, "iblanket_thickness": 2.0, "iblnkith": 1.0, - "ibss": 3.0, + "i_bootstrap_current": 3.0, "icase": "'Steady-state tokamak model'", "icc": [ 0.0, @@ -8923,7 +8923,7 @@ "bndu": "", "bondl": "", "bondu": "", - "bootipf": "bootstrap current fraction (enforced; see ibss)", + "bootipf": "bootstrap current fraction (enforced; see i_bootstrap_current)", "bore": "central solenoid inboard radius (m) (`iteration variable 29`)", "boundl": "boundl(ipnvars) /../ : lower bounds used on ixc variables during\n VMCON optimisation runs", "boundu": "", @@ -9058,7 +9058,7 @@ "casthi_is_fraction": "logical switch to make casthi a fraction of TF coil thickness (`casthi_fraction`)", "casths": "inboard TF coil sidewall case thickness (m) (calculated for stellarators)", "casths_fraction": "inboard TF coil sidewall case thickness as a fraction of tftort", - "cboot": "bootstrap current fraction multiplier (`ibss=1`)", + "cboot": "bootstrap current fraction multiplier (`i_bootstrap_current=1`)", "ccl0": "", "ccl0_ma": "PF group current array, flux-swing cancellation current (MA)\n Input if i_pf_current=0, computed otherwise", "ccls": "", @@ -9798,7 +9798,7 @@ "iblanket": "switch for blanket model:\n
      \n
    • =1 CCFE HCPB model
    • \n
    • =2 KIT HCPB model
    • \n
    • =3 CCFE HCPB model with Tritium Breeding Ratio calculation
    • \n
    • =4 KIT HCLL model
    • \n
    ", "iblanket_thickness": "Blanket thickness switch (Do not set blnkith, blnkoth, fwith or fwoth when `iblanket=3`):\n
      \n
    • =1 thin 0.53 m inboard, 0.91 m outboard
    • \n
    • =2 medium 0.64 m inboard, 1.11 m outboard
    • \n
    • =3 thick 0.75 m inboard, 1.30 m outboard
    • \n
    ", "iblnkith": "switch for inboard blanket:\n
      \n
    • =0 No inboard blanket (blnkith=0.0)
    • \n
    • =1 Inboard blanket present
    • \n
    ", - "ibss": "switch for bootstrap current scaling\n
      \n
    • =1 ITER 1989 bootstrap scaling (high R/a only)
    • \n
    • =2 for Nevins et al general scaling
    • \n
    • =3 for Wilson et al numerical scaling
    • \n
    • =4 for Sauter et al scaling
    • \n
    ", + "i_bootstrap_current": "switch for bootstrap current scaling\n
      \n
    • =1 ITER 1989 bootstrap scaling (high R/a only)
    • \n
    • =2 for Nevins et al general scaling
    • \n
    • =3 for Wilson et al numerical scaling
    • \n
    • =4 for Sauter et al scaling
    • \n
    ", "icase": "power plant type", "icc": "", "icode": "", @@ -13308,7 +13308,7 @@ "lb": 0, "ub": 1 }, - "ibss": { + "i_bootstrap_current": { "lb": 1, "ub": 4 }, @@ -19102,7 +19102,7 @@ "hfac", "hfact", "taumax", - "ibss", + "i_bootstrap_current", "iculbl", "i_plasma_current", "i_diamagnetic_current", @@ -20424,7 +20424,7 @@ "iblanket": "int_variable", "iblanket_thickness": "int_variable", "iblnkith": "int_variable", - "ibss": "int_variable", + "i_bootstrap_current": "int_variable", "icc": "int_array", "iculbl": "int_variable", "i_plasma_current": "int_variable", diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT index 3810d6c24a..a26d7b01e3 100644 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ b/tests/regression/input_files/large_tokamak.IN.DAT @@ -372,7 +372,7 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index 2499763cc3..394369b786 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -354,7 +354,7 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 diff --git a/tests/regression/input_files/large_tokamak_once_through.IN.DAT b/tests/regression/input_files/large_tokamak_once_through.IN.DAT index 2014807a25..76da0521cc 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -324,7 +324,7 @@ fkzohm = 1.02 * Zohm elongation scaling adjustment factor (`ishape=2; 3`) fvsbrnni = 0.4242184436680697 * fraction of the plasma current produced by non-inductive means (`iteration variable 44`) gamma = 0.3 * Ejima coefficient for resistive startup V-s formula hfact = 1.185971818905028 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); -ibss = 4 * switch for bootstrap current scaling +i_bootstrap_current = 4 * switch for bootstrap current scaling iculbl = 1 * switch for beta limit scaling (`constraint equation 24`) icurr = 4 * switch for plasma current scaling to use idensl = 7 * switch for density limit to enforce (`constraint equation 5`) diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 6b8ef1c74a..3f1776b287 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -2934,12 +2934,12 @@ bscfmax = 0.9 * JUSTIFICATION: upper limit set for plasma stability * -ibss = 4 +i_bootstrap_current = 4 * DESCRIPTION: Switch for Bootstrap Current Scaling (4: Sauter scaling) * JUSTIFICATION: Wilson model was previously used for STs *cboot = -* DESCRIPTION: Bootstrap current fraction multiplier (ibss=1) +* DESCRIPTION: Bootstrap current fraction multiplier (i_bootstrap_current=1) * JUSTIFICATION: Not used, not scaling bootstrap current *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 187a2950d09f5fb93f1c02fe4c6c0ae14169754e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 20 Aug 2024 11:10:00 +0100 Subject: [PATCH 016/108] refactor: Add type hints and revised docstrings for calculate_plasma_current_peng() and conhas() --- process/physics.py | 90 ++++++++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 31 deletions(-) diff --git a/process/physics.py b/process/physics.py index 322b9a1341..85f88a5067 100644 --- a/process/physics.py +++ b/process/physics.py @@ -147,24 +147,40 @@ def bpol(i_plasma_current, ip, qbar, aspect, eps, bt, kappa, delta, perim, rmu0) @nb.jit(nopython=True, cache=True) -def calculate_plasma_current_peng(qbar, aspect, eps, rminor, bt, kappa, delta): - """Function to calculate plasma current (Peng scaling) - author: J Galambos, FEDC/ORNL - author: P J Knight, CCFE, Culham Science Centre - aspect : input real : plasma aspect ratio - bt : input real : toroidal field on axis (T) - delta : input real : plasma triangularity - kappa : input real : plasma elongation - qbar : input real : edge q-bar - rminor : input real : plasma minor radius (m) +def calculate_plasma_current_peng( + qbar: float, + aspect: float, + eps: float, + rminor: float, + bt: float, + kappa: float, + delta: float, +) -> float: + """ + Function to calculate plasma current (Peng scaling from the STAR code) + + Parameters: + - qbar: float, edge q-bar + - aspect: float, plasma aspect ratio + - eps: float, inverse aspect ratio + - rminor: float, plasma minor radius (m) + - bt: float, toroidal field on axis (T) + - kappa: float, plasma elongation + - delta: float, plasma triangularity + + Returns: + - float, plasma current in MA + This function calculates the plasma current in MA, using a scaling from Peng, Galambos and Shipe (1992). It is primarily used for Tight Aspect Ratio Tokamaks and is - selected via i_plasma_current=2. - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, - unpublished internal Oak Ridge document - Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, - Fusion Technology, 21, 1729 + selected via i_plasma_current=2. + + References: + - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, + unpublished internal Oak Ridge document + - Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, + Fusion Technology, 21, 1729 """ ff1, ff2, d1, d2 = _plascar_bpol(aspect, eps, kappa, delta) @@ -317,24 +333,36 @@ def culblm(bt, dnbeta, plascur, rminor): @nb.jit(nopython=True, cache=True) -def conhas(alphaj, alphap, bt, delta95, eps, kappa95, p0, rmu0): - """Routine to calculate the F coefficient used for scaling the - plasma current - author: P J Knight, CCFE, Culham Science Centre - alphaj : input real : current profile index - alphap : input real : pressure profile index - bt : input real : toroidal field on axis (T) - delta95 : input real : plasma triangularity 95% - eps : input real : inverse aspect ratio - kappa95 : input real : plasma elongation 95% - p0 : input real : central plasma pressure (Pa) - fq : output real : scaling for edge q from circular - cross-section cylindrical case - This routine calculates the F coefficient used for scaling the - plasma current, using the Connor-Hastie scaling given in - AEA FUS 172: Physics Assessment for the European Reactor Study +def conhas( + alphaj: float, + alphap: float, + bt: float, + delta95: float, + eps: float, + kappa95: float, + p0: float, + rmu0: float, +) -> float: """ + Routine to calculate the F coefficient used for scaling the plasma current. + + Parameters: + - alphaj: float, the current profile index + - alphap: float, the pressure profile index + - bt: float, the toroidal field on axis (T) + - delta95: float, the plasma triangularity 95% + - eps: float, the inverse aspect ratio + - kappa95: float, the plasma elongation 95% + - p0: float, the central plasma pressure (Pa) + - rmu0: float, the vacuum permeability (H/m) + Returns: + - float, the F coefficient + + This routine calculates the F coefficient used for scaling the plasma current, + using the Connor-Hastie scaling given in AEA FUS 172: Physics Assessment for + the European Reactor Study. + """ # Exponent in Connor-Hastie current profile - matching total # current gives the following trivial relation lamda = alphaj From 3df026bff05e628f131262e0af245de6a4bd29fc Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 20 Aug 2024 14:59:19 +0100 Subject: [PATCH 017/108] refactor: Update _plascar_bpol function with type hints and revised docstring --- process/physics.py | 49 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/process/physics.py b/process/physics.py index 85f88a5067..ec65f02183 100644 --- a/process/physics.py +++ b/process/physics.py @@ -86,26 +86,51 @@ def nui(j, zmain, ni, tempi, amain): @nb.jit(nopython=True, cache=True) -def _plascar_bpol(aspect, eps, kappa, delta): +def _plascar_bpol( + aspect: float, eps: float, kappa: float, delta: float +) -> Tuple[float, float, float, float]: + """ + Calculate the poloidal field coefficients for determining the plasma current + and poloidal field. + + Parameters: + - aspect: float, plasma aspect ratio + - eps: float, inverse aspect ratio + - kappa: float, plasma elongation + - delta: float, plasma triangularity + + Returns: + - Tuple[float, float, float, float], coefficients ff1, ff2, d1, d2 + + This internal function calculates the poloidal field coefficients, + which is used to calculate the poloidal field and the plasma current. + + References: + - Peng, Y. K. M., Galambos, J. D., & Shipe, P. C. (1992). + 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), + 1729–1738. https://doi.org/10.13182/FST92-A29971 + - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, + unpublished internal Oak Ridge document + """ # Original coding, only suitable for TARTs [STAR Code] - c1 = kappa**2 / (1.0 + delta) + delta - c2 = kappa**2 / (1.0 - delta) - delta + c1 = (kappa**2 / (1.0 + delta)) + delta + c2 = (kappa**2 / (1.0 - delta)) - delta d1 = (kappa / (1.0 + delta)) ** 2 + 1.0 d2 = (kappa / (1.0 - delta)) ** 2 + 1.0 - c1_aspect = (c1 * eps - 1.0) if aspect < c1 else (1.0 - c1 * eps) + c1_aspect = ((c1 * eps) - 1.0) if aspect < c1 else (1.0 - (c1 * eps)) - y1 = np.sqrt(c1_aspect / (1.0 + eps)) * (1.0 + delta) / kappa - y2 = np.sqrt((c2 * eps + 1.0) / (1.0 - eps)) * (1.0 - delta) / kappa + y1 = np.sqrt(c1_aspect / (1.0 + eps)) * ((1.0 + delta) / kappa) + y2 = np.sqrt((c2 * eps + 1.0) / (1.0 - eps)) * ((1.0 - delta) / kappa) - h2 = (1.0 + (c2 - 1.0) * eps / 2.0) / np.sqrt((1.0 - eps) * (c2 * eps + 1.0)) - f2 = (d2 * (1.0 - delta) * eps) / ((1.0 - eps) * (c2 * eps + 1.0)) - g = eps * kappa / (1.0 - eps * delta) + h2 = (1.0 + (c2 - 1.0) * (eps / 2.0)) / np.sqrt((1.0 - eps) * (c2 * eps + 1.0)) + f2 = (d2 * (1.0 - delta) * eps) / ((1.0 - eps) * ((c2 * eps) + 1.0)) + g = (eps * kappa) / (1.0 - (eps * delta)) ff2 = f2 * (g + 2.0 * h2 * np.arctan(y2)) - h1 = (1.0 + (1.0 - c1) * eps / 2.0) / np.sqrt((1.0 + eps) * c1_aspect) + h1 = (1.0 + (1.0 - c1) * (eps / 2.0)) / np.sqrt((1.0 + eps) * c1_aspect) f1 = (d1 * (1.0 + delta) * eps) / ((1.0 + eps) * (c1 * eps - 1.0)) if aspect < c1: @@ -185,8 +210,8 @@ def calculate_plasma_current_peng( ff1, ff2, d1, d2 = _plascar_bpol(aspect, eps, kappa, delta) - e1 = 2.0 * kappa / (d1 * (1.0 + delta)) - e2 = 2.0 * kappa / (d2 * (1.0 - delta)) + e1 = (2.0 * kappa) / (d1 * (1.0 + delta)) + e2 = (2.0 * kappa) / (d2 * (1.0 - delta)) return ( rminor From 89af8ad03a2580d37afafa9a4fbfe5d110f79969 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 08:45:41 +0100 Subject: [PATCH 018/108] :memo: refactor: Added first instance of all models for calculating the plasma current shaping function for calculate_plasma_current --- .../plasma_current/plasma_current.md | 316 ++++++++++++++++-- 1 file changed, 294 insertions(+), 22 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 5274c676cf..e9fafc9473 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -10,21 +10,36 @@ ## Plasma Current Calculation | `calculate_plasma_current()` -A number of plasma current scaling laws are available in PROCESS [^1]. These are calculated in -routine `calculate_plasma_current()`, in `physics.py`. The safety factor $q_{95}$ required to prevent -disruptive MHD instabilities dictates the plasma current $I_{\text{p}}$: +This function calculates the plasma current shaping factor ($f_q$), then plasma current ($I_{\text{p}}$) then qstar ($q^*$) then normalized beta ($\beta_{\text{N}}$) then poloidal field and the profile settings for $\mathtt{alphaj}$ ($\alpha_J$) and $\mathtt{rli}$ ($l_{\mathtt{i}}$) + +A number of plasma current scaling laws are available in PROCESS. These are calculated in +routine `calculate_plasma_current()`, in `physics.py`. The safety factor $q_{95}$ required to prevent disruptive MHD instabilities dictates the plasma current $I_{\text{p}}$: $$\begin{aligned} I_{\text{p}} = f_q \frac{2\pi}{\mu_0} \frac{a^2 B_{\text{T}}}{R \ q_{95}} \end{aligned}$$ +$$ +\mu_0 I = \mu_0 \int j_{\phi}\cdot \text{d}s = \int \nabla \times B \cdot \text{d}s = \oint B \cdot \text{d}l_{\text{p}} = 2\pi a l B_{\text{p}}(a) +$$ + +Where $l$ is the ratio of the poloidal plasma circumference to the circumference of the inscribed circle of radius $a$. The function $q$ becomes: + +$$ +q(r) = \frac{RB_{\phi}}{2\pi}\oint \frac{\text{d}l_{\text{p}}}{R^2B_{\text{p}}} = \frac{rlB_{\phi}}{RB_{\text{p}(r)}} +$$ + The factor $f_q$ makes allowance for toroidal effects and plasma shaping (elongation and triangularity). Several formulae for this factor are available depending on the value of the switch `i_plasma_current`, as follows: --------------- -### Peng analytic fit +### Calculate plasma current shaping function $f_q$ + +------------ + +#### Peng analytic fit Switch value: `i_plasma_current = 1` @@ -36,27 +51,200 @@ Where $\epsilon$ is the inverse [aspect ratio](../plasma_geometry.md) ($\mathtt{ ----------- -### 2.Peng double null divertor scaling (ST) -[^4] +#### STAR, Peng double null divertor scaling (ST) + +Switch value: `i_plasma_current = 2` [^3] [^4] + +This is currently the only scaling in which the calculated plasma current does not follow the form of that show above. The bounds of applicability is for aspect ratios $\le 3$ +It uses the `calculate_plasma_current_peng()` function. + +##### `calculate_plasma_current_peng()` + +The plasma current is given by: + +$$ +I_{\text{p}} = \frac{5a B_{\text{T}}\kappa}{2\pi^2 \bar{q}}(F_1+F_2)\left(\frac{\arcsin{E_1}}{E_1}+\frac{\arcsin{E_2}}{E_2}\right) +$$ + +The values of $F_1$, $F_2$, $d_1$ & $d_2$ are first calculated from the `_plascar_bpol` function. + +The values of $E_1$ & $E_2$ are then calculated such as + +$$ +E_1 = \frac{2\kappa}{d_1(1+\delta)} +$$ + +$$ +E_2 = \frac{2\kappa}{d_2(1.0 - \delta)} +$$ + +$I_{\text{p}}$ from above is then calculated from these values + +---------------- + +#### Simple ITER scaling + +Switch value: `i_plasma_current = 3` [^5] + +The simple cyclindrical case is assumed so: + +$$ +f_q = 1 +$$ + +----------------- +#### ITER IPDG89 scaling + +Switch value: `i_plasma_current = 4`[^5] [^7] + +The formula for calculating `fq` is: + +$$ +f_q = \left(\frac{{0.5 \cdot (1.17 - 0.65 \cdot \epsilon)}}{{(1.0 - \epsilon^2)^2}} \cdot \left(1.0 + \kappa_{95}^2 \cdot \left(1.0 + 2.0 \cdot \delta_{95}^2 - 1.2 \cdot \delta_{95}^3\right)\right)\right) +$$ + + + + + +-------------- + +#### Todd empirical scaling, I + +Switch value: `i_plasma_current = 5`[^6] [^7] + +The formula for calculating `fq` is: + +$$ +F_{T1} | f_q = \left( + (1.0 + 2.0\epsilon^2) + \cdot 0.5 + \cdot (1.0 + \kappa_{95}^2) + \cdot ( + 1.24 + - 0.54 \cdot \kappa_{95} + + 0.3 \cdot (\kappa_{95}^2 + \delta_{95}^2) + + 0.125 \cdot \delta_{95} + ) + \right) +$$ + + +------------------- + +#### Todd empirical scaling, II + +Switch value: `i_plasma_current = 6` [^6] [^7] + +This function is similar to the previous [Todd scaling](#todd-empirical-scaling-i) except it is mltiplied by a new elongation dependant term + + +$$ +f_q = F_{T1} \times \left(1+[\kappa-1.2]^3\right) +$$ + +------------------ + + +#### Connor-Hastie model + +Switch value: `i_plasma_current = 7` [^7] [^8] + +Asymptotically correct in the range of: + +- $\epsilon \ll 1$ +- $\delta \ll 1$ +- $(\kappa - 1) \ll 1$ + +Assumes a parabolic profile as seen [here](../profiles/plasma_profiles.md#parabolic-profile-l-mode) + +Ran by the `conhas()` +function + +$$ +f_q = \left(\frac{(\kappa+1)^2}{2}\right)\left(1+\left(\frac{\kappa+1}{2}\right)^2\epsilon^2+\frac{1}{2}\Delta^{\prime 2}+2\frac{\Delta}{R_0} \\ ++ \frac{1}{2}\left(E^{\prime 2}+\frac{E^2}{r^2}\right)+\frac{1}{2}\left(T^{\prime 2}+\frac{4T^2}{r^2}\right)\right) +$$ -### 3. Simple ITER scaling +where: -### 4. Revised ITER scaling -[^5] +$$ +\frac{T}{r} = \frac{\kappa \delta}{(\kappa+1)^2} \ \ \ ; \ \ \ \frac{E}{r} = \frac{\kappa-1}{\kappa+1} +$$ -### 5. Todd empirical scaling, I +$$ +T^{\prime} = 2 \left(\frac{1+\lambda}{1+\frac{\lambda}{2}}\right)\frac{T}{r} \ \ \ ; \ \ \ E^{\prime} = 2 \left(\frac{1+\lambda}{1+\frac{\lambda}{3}}\right)\frac{E}{r} +$$ -### 6. Todd empirical scaling, II +$$ +\Delta^{\prime} = \frac{\kappa+1}{2}\epsilon\frac{l_i}{2}+\frac{\beta_0 (1+\lambda)^2}{(\frac{\kappa+1}{2}\epsilon)(1+\nu)} +$$ -### 7. Connor-Hastie model +with -### 8. Sauter model, allows negative $\delta$ +$$ +l_i = \frac{1+\lambda}{\lambda}\left(\frac{1+\lambda}{\lambda}\text{ln}(1-\lambda)-1\right) +$$ + +$$ +\frac{\Delta}{R_0} = \frac{\beta_0}{6}\left[1+\frac{5}{6}\lambda+\frac{1}{4}\lambda^2\right]+\left(\frac{\kappa+1}{2}\epsilon\right)^2 \frac{1}{8}\left(1-\frac{\lambda^2}{3}\right) +$$ + +and the parameters $\lambda$ and $\nu$ characterise the current profile $J_{\phi} = \frac{j_0}{(1+\lambda r^2)^2}$ and pressure profile $p = p_0(1-r^2)^{\nu}$ + + + +--------------- + +#### Sauter model, allows negative triangularity + +Switch value: `i_plasma_current = 8`[^9] + +Assumes zero squareness with the $w_{07}$ parameter ($w_{07}$ = 1). + +The values for $\kappa$ and $\delta$ is taken at the separatrix and is not the 95% values. + +!!! note "$w_{07}$ setting" + + There is currently no parameter to set in the input file in order to change $w_{07}$ directly. This can be done directly through the code in `physics.py` + +$$ +f_q = \frac{4.1 \times 10^6}{\frac{2\pi}{\mu_0}}[1+1.2(\kappa-1)+0.56(\kappa-1)^2] \\ +\times (1+0.09\delta +0.16\delta^2)\frac{1+0.45\delta \epsilon}{1-0.74\epsilon}[1+0.55(w_{07}-1)] +$$ + +---------------------- + +#### FIESTA for ST's: + +Switch value: `i_plasma_current = 9`[^10] + + + +Assumptions: + + - D-shaped plasmas with $A < 3$: + - X-pont values of $\kappa$ & $\delta$ used + +A set of eqlibria from FIESTA were created and compared to the calculatons from the [Peng double null divertor scaling](plasma_current.md#peng-double-null-divertor-scaling-st) For the low elongation equilibria, the calculated values for +the plasma current were close to those from FIESTA, however moving to +higher elongations causes an underestimate by up to 20%. + +Given the parameter dependencies a new plasma current relation based on fits to FIESTA +equilibria was created. It showed no bias with any parameter fitted and that the fit is accurate to 10%. +The linear relation between these and the 95% values expressed in does not hold at high values of elongation and triangularity as per the [`ishape = 0`](../plasma_geometry.md#plasma-geometry-parameters-geomty) relation. + + +$$ +f_q = 0.538 (1.0 + 2.440 \epsilon^{2.736}) \kappa^{2.154}\delta^{0.060} +$$ + +----------------------------- -### 9. Scaling for spherical tokamaks, based on a fit to a family of equilibria derived by Fiesta: ## Plasma Current Profile Consistency -A limited degree of self-consistency between the plasma current profile and other parameters [^6] can be +A limited degree of self-consistency between the plasma current profile and other parameters [^11] can be enforced by setting switch `iprofile = 1`. This sets the current profile peaking factor $\alpha_J$ (`alphaj`), the normalised internal inductance $l_i$ (`rli`) and beta limit $g$-factor (`dnbeta`) using the safety factor on axis `q0` and the cylindrical safety factor $q*$ (`qstar`): @@ -84,12 +272,96 @@ l_i = 3.4 - \kappa_x Further desciption of `iprofile` is given in [Beta Limit](./plasma_beta.md). -[^1]: D.J. Ward, 'PROCESS Fast Alpha Pressure', Work File Note F/PL/PJK/PROCESS/CODE/050 -[^2]: Albajar, Nuclear Fusion **41** (2001) 665 -[^3]: M. Kovari, R. Kemp, H. Lux, P. Knight, J. Morris, D.J. Ward, '“PROCESS”: A systems code for fusion power plants—Part 1: Physics' Fusion Engineering and Design 89 (2014) 3054–3069 +-------------- + +## _plasc_bpol + +This intenral function is used to calculate the plasma shape and poloidal coefficients for calculating the plasma current in the [Peng double null scaling from the STAR code](plasma_current.md#star-peng-double-null-divertor-scaling-st). If this scaling is selected the coefficents are also used to calculate the [poloidal field from the plasma current](plasma_current.md#plasma-current-poloidal-field). + + +where if $A < \frac{\kappa^2}{(1+\delta)}+\delta$: + +$$ +F_1 = f_1\left(g-h_1\ln \left(\frac{1+y_1}{1-y_1}\right)\right) +$$ + +$$ +f_1 = \frac{d_1(1+\delta)\epsilon}{(1+\epsilon)(c_1\epsilon -1)} +$$ + +$$ +h_1 = \frac{1+(1-c_1)\frac{\epsilon}{2}}{(1+\epsilon)(c_1 \epsilon -1)} +$$ + +$$ +y_1 = \frac{\sqrt{c_1\epsilon-1}}{1+\epsilon}\frac{1+\delta}{\kappa} +$$ + +and if $A > \frac{\kappa^2}{(1+\delta)}+\delta$: + +$$ +F_1 = f_1\left(-g +2h_1 \arctan(y_1)\right) +$$ + +$$ +f_1 = -\frac{d_1(1+\delta)\epsilon}{(1+\epsilon)(c_1\epsilon -1)} +$$ + +$$ +h_1 = \frac{1+(1-c_1)\frac{\epsilon}{2}}{(1+\epsilon)(1-c_1 \epsilon)} +$$ + +$$ +y_1 = \frac{\sqrt{1-c_1\epsilon}}{1+\epsilon}\frac{1+\delta}{\kappa} +$$ + +where both conditions share: + +$$ +g = \frac{\epsilon \kappa}{(1-\epsilon \delta)} +$$ + +$$ +F_2 = f_2\left(g +2h_2 \arctan(y_2)\right) +$$ + +$$ +f_2 = -\frac{d_2(1-\delta)\epsilon}{(1-\epsilon)(c_2\epsilon -1)} +$$ + +$$ +h_2 = \frac{1+(c_2-1)\frac{\epsilon}{2}}{(1-\epsilon)(c_2 \epsilon+1)} +$$ + +$$ +E_1 = \frac{2\kappa}{d_1(1+\delta)} ; \ \ E_2 = \frac{2\kappa}{d_2(1-\delta)} +$$ + +$$ +c_1 = \frac{\kappa^2}{(1+\delta)}+\delta \ ; \ \ c_2 = \frac{\kappa^2}{(1-\delta)}+\delta +$$ + +$$ +d_1 = \left(\frac{\kappa}{1+\delta}\right)^2+1 \ ; \ \ d_2 = \left(\frac{\kappa}{1-\delta}\right)^2+1 +$$ + +$$ +y_2 = \frac{\sqrt{c_2\epsilon+1}}{1-\epsilon}\frac{1-\delta}{\kappa} +$$ + +## Plasma Current Poloidal Field + +[^3]: Peng, Y. K. M., Galambos, J. D., & Shipe, P. C. (1992). 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), 1729–1738. https://doi.org/10.13182/FST92-A29971 [^4]: J.D. Galambos, 'STAR Code : Spherical Tokamak Analysis and Reactor Code', Unpublished internal Oak Ridge document. -[^5]: W.M. Nevins, 'Summary Report: ITER Specialists' Meeting on Heating and -Current Drive', ITER-TN-PH-8-4, 13--17 June 1988, Garching, FRG -[^6]: Y. Sakamoto, 'Recent progress in vertical stability analysis in JA', -Task meeting EU-JA #16, Fusion for Energy, Garching, 24--25 June 2014 \ No newline at end of file +[^5]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', +[^6]: D.C.Robinson and T.N.Todd, Plasma and Contr Fusion 28 (1986) 1181 +[^7]: T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 +[^8]: J.W.Connor and R.J.Hastie, Culham Lab Report CLM-M106 (1985). https://scientific-publications.ukaea.uk/wp-content/uploads/CLM-M106-1.pdf +[^9]: O. Sauter, Geometric formulas for system codes including the effect of negative triangularity, Fusion Engineering and Design, Volume 112, 2016, Pages 633-645, ISSN 0920-3796, +https://doi.org/10.1016/j.fusengdes.2016.04.033. +[^10]: Stuart I. Muldrew, Hanni Lux, Geof Cunningham, Tim C. Hender, Sebastien Kahn, Peter J. Knight, Bhavin Patel, Garry M. Voss, Howard R. Wilson, “PROCESS”: Systems studies of spherical tokamaks, Fusion Engineering and Design, Volume 154, 2020, 111530, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2020.111530. +[^11]: Y. Sakamoto, 'Recent progress in vertical stability analysis in JA', +Task meeting EU-JA #16, Fusion for Energy, Garching, 24--25 June 2014 + + From 7837a54567e6127d81e86c4217f95c82a693aebb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 11:46:17 +0100 Subject: [PATCH 019/108] refactor: Update bpol function with type hints and revised docstring --- process/physics.py | 79 ++++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/process/physics.py b/process/physics.py index ec65f02183..5eaf5ef390 100644 --- a/process/physics.py +++ b/process/physics.py @@ -142,26 +142,47 @@ def _plascar_bpol( @nb.jit(nopython=True, cache=True) -def bpol(i_plasma_current, ip, qbar, aspect, eps, bt, kappa, delta, perim, rmu0): - """Function to calculate poloidal field - author: J Galambos, FEDC/ORNL - author: P J Knight, CCFE, Culham Science Centre - i_plasma_current : input integer : current scaling model to use - ip : input real : plasma current (A) - qbar : input real : edge q-bar - aspect : input real : plasma aspect ratio - bt : input real : toroidal field on axis (T) - kappa : input real : plasma elongation - delta : input real : plasma triangularity - perim : input real : plasma perimeter (m) - This function calculates the poloidal field in Tesla, +def bpol( + i_plasma_current: int, + ip: float, + qbar: float, + aspect: float, + eps: float, + bt: float, + kappa: float, + delta: float, + perim: float, + rmu0: float, +) -> float: + """ + Function to calculate poloidal field from the plasma current + + Parameters: + - i_plasma_current: int, current scaling model to use + - ip: float, plasma current (A) + - qbar: float, edge q-bar + - aspect: float, plasma aspect ratio + - eps: float, inverse aspect ratio + - bt: float, toroidal field on axis (T) + - kappa: float, plasma elongation + - delta: float, plasma triangularity + - perim: float, plasma perimeter (m) + - rmu0: float, vacuum permeability (H/m) + + Returns: + - float, poloidal field in Tesla + + This function calculates the poloidal field from the plasma current in Tesla, using a simple calculation using Stoke's Law for conventional tokamaks, or for TARTs, a scaling from Peng, Galambos and Shipe (1992). - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, - unpublished internal Oak Ridge document - Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, - Fusion Technology, 21, 1729 + + References: + - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, + unpublished internal Oak Ridge document + - Peng, Y. K. M., Galambos, J. D., & Shipe, P. C. (1992). + 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), + 1729–1738. https://doi.org/10.13182/FST92-A29971 """ if i_plasma_current != 2: return rmu0 * ip / perim @@ -204,8 +225,9 @@ def calculate_plasma_current_peng( References: - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, unpublished internal Oak Ridge document - - Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, - Fusion Technology, 21, 1729 + - Peng, Y. K. M., Galambos, J. D., & Shipe, P. C. (1992). + 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), + 1729–1738. https://doi.org/10.13182/FST92-A29971 """ ff1, ff2, d1, d2 = _plascar_bpol(aspect, eps, kappa, delta) @@ -861,14 +883,6 @@ def physics(self): implications of physics assumptions on the design of a demonstration fusion power plant https://inis.iaea.org/search/search.aspx?orig_q=RN:45031642 """ - # kappaa_IPB = physics_variables.vol / ( - # 2.0e0 - # * numpy.pi - # * numpy.pi - # * physics_variables.rminor - # * physics_variables.rminor - # * physics_variables.rmajor - # ) if physics_variables.i_plasma_current == 2: physics_variables.q95 = ( @@ -2120,13 +2134,14 @@ def calculate_plasma_current( eps (float): Inverse aspect ratio. i_plasma_current (int): Current scaling model to use. 1 = Peng analytic fit - 2 = Peng divertor scaling (TART) - 3 = simple ITER scaling - 4 = revised ITER scaling + 2 = Peng divertor scaling (TART,STAR) + 3 = Simple ITER scaling + 4 = Revised ITER scaling 5 = Todd empirical scaling I 6 = Todd empirical scaling II 7 = Connor-Hastie model 8 = Sauter scaling (allowing negative triangularity) + 9 = FIESTA ST scaling iprofile (int): Switch for current profile consistency. 0: Use input values for alphaj, rli, dnbeta. 1: Make these consistent with input q, q_0 values. @@ -2159,7 +2174,9 @@ def calculate_plasma_current( References: - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, unpublished internal Oak Ridge document - - Y.-K. M. Peng, J. Galambos and P.C. Shipe, 1992, Fusion Technology, 21, 1729 + - Peng, Y. K. M., Galambos, J. D., & Shipe, P. C. (1992). + 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), + 1729–1738. https://doi.org/10.13182/FST92-A29971 - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 - M. Kovari et al, 2014, "PROCESS": A systems code for fusion power plants - Part 1: Physics - H. Zohm et al, 2013, On the Physics Guidelines for a Tokamak DEMO From 64ab3280f9876f1774df783f982ccbb93d2e6ae3 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 11:53:09 +0100 Subject: [PATCH 020/108] refactor: Rename bpol function to calculate_poloidal_field and update related tests --- process/physics.py | 4 ++-- tests/unit/test_physics.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/process/physics.py b/process/physics.py index 5eaf5ef390..68898aef63 100644 --- a/process/physics.py +++ b/process/physics.py @@ -142,7 +142,7 @@ def _plascar_bpol( @nb.jit(nopython=True, cache=True) -def bpol( +def calculate_poloidal_field( i_plasma_current: int, ip: float, qbar: float, @@ -2288,7 +2288,7 @@ def calculate_plasma_current( ) # Calculate the poloidal field generated by the plasma current - bp = bpol( + bp = calculate_poloidal_field( i_plasma_current, plascur, q95, diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 564894cfba..6822b450b0 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -12,7 +12,7 @@ import pytest from process.physics import ( Physics, - bpol, + calculate_poloidal_field, diamagnetic_fraction_scene, diamagnetic_fraction_hender, ps_fraction_scene, @@ -803,8 +803,8 @@ def test_plasc(arguments, expected): ), ), ) -def test_bpol(arguments, expected): - assert bpol(**arguments) == pytest.approx(expected) +def test_calculate_poloidal_field(arguments, expected): + assert calculate_poloidal_field(**arguments) == pytest.approx(expected) def test_culblm(): From ee2371727f330dc8417f4edc8af7ec929062a841 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 13:56:39 +0100 Subject: [PATCH 021/108] :memo: Complete the initial documentation section for the calculate_plasma_current function --- .../plasma_current/plasma_current.md | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index e9fafc9473..e27ab2d8f6 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -35,7 +35,7 @@ the switch `i_plasma_current`, as follows: --------------- -### Calculate plasma current shaping function $f_q$ +### 1. Calculate plasma current shaping function $f_q$ ------------ @@ -241,10 +241,43 @@ $$ ----------------------------- +### 2. Calculate the cylidrical safety factor -## Plasma Current Profile Consistency +$$ +q^* = \frac{5 \times 10^6a^2B_T}{RI_{\text{p}}}\frac{(1+\kappa^2(1+2\delta^2-1.2\delta^3))}{2} +$$ + +-------------- + +### 3. Caclulate the normalized beta + +The total normlaized beta is calculated as per: + +$$ +\beta_N = \beta\frac{1\times10^8 a B_{\text{T}}}{I_{\text{P}}} +$$ + +### 4. Plasma Current Poloidal Field + +For calculating the poloidal magnetic field created due to the presence of the plasma current, [Ampere's law](https://en.wikipedia.org/wiki/Amp%C3%A8re%27s_circuital_law) can simply be used. In this case the poloidal field is simply returned as: + +$$ +B_{\text{p}} = \frac{\mu_0 I_{\text{p}}}{\mathtt{pperim}} +$$ + +Where `pperim` is the plasma poloidal perimieter calculated [here](../plasma_geometry.md#poloidal-perimeter). -A limited degree of self-consistency between the plasma current profile and other parameters [^11] can be +In the case of using the Peng double null scaling ([`i_plasma_current = 2`](plasma_current.md#star-peng-double-null-divertor-scaling-st)), the values $F_1$ and $F_2$ are calculated from [_plasc_bpol](plasma_current.md#_plasc_bpol) and used to calculated the poloidal field from the toroidal field as per: + +$$ +B_{\text{p}} = B_{\text{T}}\frac{F_1 + F_2}{2\pi \overline{q}} +$$ + +------------ + +### 5. Plasma Current Profile Consistency + +A limited degree of self-consistency between the plasma current profile and other parameters can be enforced by setting switch `iprofile = 1`. This sets the current profile peaking factor $\alpha_J$ (`alphaj`), the normalised internal inductance $l_i$ (`rli`) and beta limit $g$-factor (`dnbeta`) using the safety factor on axis `q0` and the cylindrical safety factor $q*$ (`qstar`): @@ -264,15 +297,13 @@ g = 4 l_i It is recommended that current scaling law `i_plasma_current = 4` is used if `iprofile = 1`. This relation is only applicable to large aspect ratio tokamaks. -For spherical tokamaks, the normalised internal inductance can be set from the elongation using `iprofile = 4` or `iprofile = 5`: +For spherical tokamaks, the normalised internal inductance can be set from the elongation using `iprofile = 4` or `iprofile = 5` or `iprofile = 6`[^11]: $$\begin{aligned} l_i = 3.4 - \kappa_x \end{aligned}$$ -Further desciption of `iprofile` is given in [Beta Limit](./plasma_beta.md). - --------------- +Further desciption of `iprofile` is given in [Beta Limit](../plasma_beta.md). ## _plasc_bpol @@ -349,8 +380,6 @@ $$ y_2 = \frac{\sqrt{c_2\epsilon+1}}{1-\epsilon}\frac{1-\delta}{\kappa} $$ -## Plasma Current Poloidal Field - [^3]: Peng, Y. K. M., Galambos, J. D., & Shipe, P. C. (1992). 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), 1729–1738. https://doi.org/10.13182/FST92-A29971 [^4]: J.D. Galambos, 'STAR Code : Spherical Tokamak Analysis and Reactor Code', Unpublished internal Oak Ridge document. @@ -361,7 +390,5 @@ Unpublished internal Oak Ridge document. [^9]: O. Sauter, Geometric formulas for system codes including the effect of negative triangularity, Fusion Engineering and Design, Volume 112, 2016, Pages 633-645, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2016.04.033. [^10]: Stuart I. Muldrew, Hanni Lux, Geof Cunningham, Tim C. Hender, Sebastien Kahn, Peter J. Knight, Bhavin Patel, Garry M. Voss, Howard R. Wilson, “PROCESS”: Systems studies of spherical tokamaks, Fusion Engineering and Design, Volume 154, 2020, 111530, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2020.111530. -[^11]: Y. Sakamoto, 'Recent progress in vertical stability analysis in JA', -Task meeting EU-JA #16, Fusion for Energy, Garching, 24--25 June 2014 - +[^11]: J. E. Menard et al., “Fusion nuclear science facilities and pilot plants based on the spherical tokamak,” Nuclear Fusion, vol. 56, no. 10, p. 106023, Aug. 2016, doi: https://doi.org/10.1088/0029-5515/56/10/106023. From fa399993e798a90d56565f6c1694d04dc99e9edb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 14:09:16 +0100 Subject: [PATCH 022/108] :memo: Tidy up comments in calculate_poloidal_field() --- process/physics.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/process/physics.py b/process/physics.py index 68898aef63..b28faf5d01 100644 --- a/process/physics.py +++ b/process/physics.py @@ -173,7 +173,7 @@ def calculate_poloidal_field( - float, poloidal field in Tesla This function calculates the poloidal field from the plasma current in Tesla, - using a simple calculation using Stoke's Law for conventional + using a simple calculation using Ampere's law for conventional tokamaks, or for TARTs, a scaling from Peng, Galambos and Shipe (1992). @@ -184,12 +184,14 @@ def calculate_poloidal_field( 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), 1729–1738. https://doi.org/10.13182/FST92-A29971 """ + # Use Ampere's law using the plasma poloidal cross-section if i_plasma_current != 2: return rmu0 * ip / perim + else: + # Use the relation from Peng, Galambos and Shipe (1992) [STAR code] otherwise + ff1, ff2, _, _ = _plascar_bpol(aspect, eps, kappa, delta) - ff1, ff2, _, _ = _plascar_bpol(aspect, eps, kappa, delta) - - return bt * (ff1 + ff2) / (2.0 * np.pi * qbar) + return bt * (ff1 + ff2) / (2.0 * np.pi * qbar) @nb.jit(nopython=True, cache=True) From 46843bfc3f2f9e1099d694e78e894392ab8e477e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 14:28:32 +0100 Subject: [PATCH 023/108] Update bootstrap_current.md to be up to date with main --- .../physics-models/plasma_current/bootstrap_current.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index 066e62f5b2..a93356d1f0 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -10,6 +10,7 @@ existence of pedestals, whereas the Sauter et al. scaling | 2 | General scaling -- To use a more general scaling method, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). | 3 | Numerically fitted scaling [^1] -- To use a numerically fitted scaling method, valid for all aspect ratios, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). | 4 | Sauter, Angioni and Lin-Liu scaling [^2] [^3] -- Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). +| 5 | Sakai, Fujita and Okamoto scaling [^4] -- Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). The model includes the toroidal diamagnetic current in the calculation due to the dataset, so `idia = 0` can only be used with it !!! Note "Fixed Bootstrap Current" Direct input -- To input the bootstrap current fraction directly, set `bscfmax` @@ -17,4 +18,5 @@ existence of pedestals, whereas the Sauter et al. scaling [^1]: H.R. Wilson, Nuclear Fusion **32** (1992) 257 [^2]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **6** (1999) 2834 -[^3]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **9** (2002) 5140 \ No newline at end of file +[^3]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **9** (2002) 5140 +[^4]: Ryosuke Sakai, Takaaki Fujita, Atsushi Okamoto, Derivation of bootstrap current fraction scaling formula for 0-D system code analysis, Fusion Engineering and Design, Volume 149, 2019, 111322, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2019.111322. \ No newline at end of file From 81f80121667760b22bddbf9af560208fa867c3db Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 14:30:52 +0100 Subject: [PATCH 024/108] :rectlye: refactor: Re-arrange the three current section sin physics.py so that they are grouped together --- process/physics.py | 55 ++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/process/physics.py b/process/physics.py index b28faf5d01..033d81de7c 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1008,6 +1008,39 @@ def physics(self): + times_variables.tdwell ) + # ***************************** # + # DIAMAGNETIC CURRENT # + # ***************************** # + + # Hender scaling for diamagnetic current at tight physics_variables.aspect ratio + current_drive_variables.diacf_hender = diamagnetic_fraction_hender( + physics_variables.beta + ) + + # SCENE scaling for diamagnetic current + current_drive_variables.diacf_scene = diamagnetic_fraction_scene( + physics_variables.beta, physics_variables.q95, physics_variables.q0 + ) + + if physics_variables.i_diamagnetic_current == 1: + current_drive_variables.diaipf = current_drive_variables.diacf_hender + elif physics_variables.i_diamagnetic_current == 2: + current_drive_variables.diaipf = current_drive_variables.diacf_scene + + # ***************************** # + # PFIRSCH-SCHLÜTER CURRENT # + # ***************************** # + + # Pfirsch-Schlüter scaling for diamagnetic current + current_drive_variables.pscf_scene = ps_fraction_scene(physics_variables.beta) + + if physics_variables.ips == 1: + current_drive_variables.psipf = current_drive_variables.pscf_scene + + # ***************************** # + # BOOTSTRAP CURRENT # + # ***************************** # + # Calculate bootstrap current fraction using various models current_drive_variables.bscf_iter89 = self.bootstrap_fraction_iter89( physics_variables.aspect, @@ -1026,6 +1059,7 @@ def physics(self): * physics_variables.btot**2 / physics_variables.bt**2 ) + current_drive_variables.bscf_nevins = ( current_drive_variables.cboot * self.bootstrap_fraction_nevins( @@ -1062,19 +1096,6 @@ def physics(self): ) ) - # Hender scaling for diamagnetic current at tight physics_variables.aspect ratio - current_drive_variables.diacf_hender = diamagnetic_fraction_hender( - physics_variables.beta - ) - - # SCENE scaling for diamagnetic current - current_drive_variables.diacf_scene = diamagnetic_fraction_scene( - physics_variables.beta, physics_variables.q95, physics_variables.q0 - ) - - # Pfirsch-Schlüter scaling for diamagnetic current - current_drive_variables.pscf_scene = ps_fraction_scene(physics_variables.beta) - current_drive_variables.bscf_sauter = ( current_drive_variables.cboot * self.bootstrap_fraction_sauter() ) @@ -1119,14 +1140,6 @@ def physics(self): ) physics_module.err242 = 1 - if physics_variables.i_diamagnetic_current == 1: - current_drive_variables.diaipf = current_drive_variables.diacf_hender - elif physics_variables.i_diamagnetic_current == 2: - current_drive_variables.diaipf = current_drive_variables.diacf_scene - - if physics_variables.ips == 1: - current_drive_variables.psipf = current_drive_variables.pscf_scene - current_drive_variables.plasipf = ( current_drive_variables.bootipf + current_drive_variables.diaipf From 764baff806aedeec6c12e7ca1d415e3702abe214 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 14:52:11 +0100 Subject: [PATCH 025/108] refactor: Remove cboot internally from bootstrap_fraction_iter89 and place it outside the function the same as the other bootstrap fraction calculations --- process/physics.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/process/physics.py b/process/physics.py index 033d81de7c..a2f21851db 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1042,11 +1042,10 @@ def physics(self): # ***************************** # # Calculate bootstrap current fraction using various models - current_drive_variables.bscf_iter89 = self.bootstrap_fraction_iter89( + current_drive_variables.bscf_iter89 = current_drive_variables.cboot * self.bootstrap_fraction_iter89( physics_variables.aspect, physics_variables.beta, physics_variables.btot, - current_drive_variables.cboot, physics_variables.plascur, physics_variables.q95, physics_variables.q0, @@ -4490,7 +4489,7 @@ def igmarcal(self): @staticmethod def bootstrap_fraction_iter89( - aspect, beta, bt, cboot, plascur, q95, q0, rmajor, vol + aspect, beta, bt, plascur, q95, q0, rmajor, vol ): """Original ITER calculation of bootstrap-driven fraction of the plasma current. @@ -4498,7 +4497,6 @@ def bootstrap_fraction_iter89( aspect : input real : plasma aspect ratio beta : input real : plasma total beta bt : input real : toroidal field on axis (T) - cboot : input real : bootstrap current fraction multiplier plascur : input real : plasma current (A) q95 : input real : safety factor at 95% surface q0 : input real : central safety factor @@ -4510,7 +4508,7 @@ def bootstrap_fraction_iter89( ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 """ xbs = min(10, q95 / q0) - cbs = cboot * (1.32 - 0.235 * xbs + 0.0185 * xbs**2) + cbs = (1.32 - 0.235 * xbs + 0.0185 * xbs**2) bpbs = ( constants.rmu0 * plascur From 73403e387befc9c82c44eaef6eafbc1d942f9535 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 15:42:01 +0100 Subject: [PATCH 026/108] Update bootstrap_current.md with overview of bootstrap current in tokamaks --- .../physics-models/plasma_current/bootstrap_current.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index a93356d1f0..e376172ffd 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -1,3 +1,10 @@ +## Overview + +Bootstrap current in tokamaks originates from the pressure gradients within the plasma and the resulting collisions between particles. As the plasma pressure varies radially, it creates a differential in particle velocities, leading to a net drift of charged particles. This drift generates a toroidal current, known as the bootstrap current, which flows parallel to the magnetic field lines. The phenomenon is a consequence of the neoclassical transport theory, where the collisional processes in a magnetically confined plasma lead to a self-sustaining current. This current is particularly advantageous as it reduces the need for external current drive systems, thereby enhancing the efficiency and stability of the tokamak operation. The bootstrap current is proportional to the pressure gradient and the collisionality of the plasma, making it a critical factor in the design and operation of advanced tokamak reactors aiming for steady-state fusion. + +Some more info can be found [here](https://wiki.fusion.ciemat.es/wiki/Bootstrap_current) +## Selection + The fraction of the plasma current provided by the bootstrap effect can be either input into the code directly, or calculated using one of four methods, as summarised here. Note that methods `i_bootstrap_current = 1-3` do not take into account the From 39f87ca04a206dbc8c9921e94b95e574eda6c545 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 21 Aug 2024 15:46:15 +0100 Subject: [PATCH 027/108] refactor: Remove cboot parameter from bootstrap_fraction_iter89 tests --- tests/unit/test_physics.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 6822b450b0..051b68187d 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -67,8 +67,6 @@ class BootstrapFractionIter89Param(NamedTuple): bt: Any = None - cboot: Any = None - plascur: Any = None q95: Any = None @@ -89,7 +87,6 @@ class BootstrapFractionIter89Param(NamedTuple): aspect=3, beta=0.030000000000000006, bt=5.7802910787445487, - cboot=1, plascur=18398455.678867526, q95=3.5, q0=1, @@ -116,7 +113,6 @@ def test_bootstrap_fraction_iter89(bootstrapfractioniter89param, physics): aspect=bootstrapfractioniter89param.aspect, beta=bootstrapfractioniter89param.beta, bt=bootstrapfractioniter89param.bt, - cboot=bootstrapfractioniter89param.cboot, plascur=bootstrapfractioniter89param.plascur, q95=bootstrapfractioniter89param.q95, q0=bootstrapfractioniter89param.q0, From 18272a53f343ebb2669948de91b3b1b007e2c2e4 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 22 Aug 2024 08:50:36 +0100 Subject: [PATCH 028/108] Add type hints and revised docstrings to ITER and Wilson bootstrap functions --- process/physics.py | 114 ++++++++++++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 44 deletions(-) diff --git a/process/physics.py b/process/physics.py index a2f21851db..ce319138a8 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1042,15 +1042,18 @@ def physics(self): # ***************************** # # Calculate bootstrap current fraction using various models - current_drive_variables.bscf_iter89 = current_drive_variables.cboot * self.bootstrap_fraction_iter89( - physics_variables.aspect, - physics_variables.beta, - physics_variables.btot, - physics_variables.plascur, - physics_variables.q95, - physics_variables.q0, - physics_variables.rmajor, - physics_variables.vol, + current_drive_variables.bscf_iter89 = ( + current_drive_variables.cboot + * self.bootstrap_fraction_iter89( + physics_variables.aspect, + physics_variables.beta, + physics_variables.btot, + physics_variables.plascur, + physics_variables.q95, + physics_variables.q0, + physics_variables.rmajor, + physics_variables.vol, + ) ) betat = ( @@ -4489,26 +4492,38 @@ def igmarcal(self): @staticmethod def bootstrap_fraction_iter89( - aspect, beta, bt, plascur, q95, q0, rmajor, vol - ): - """Original ITER calculation of bootstrap-driven fraction - of the plasma current. - author: P J Knight, CCFE, Culham Science Centre - aspect : input real : plasma aspect ratio - beta : input real : plasma total beta - bt : input real : toroidal field on axis (T) - plascur : input real : plasma current (A) - q95 : input real : safety factor at 95% surface - q0 : input real : central safety factor - rmajor : input real : plasma major radius (m) - vol : input real : plasma volume (m3) - This routine performs the original ITER calculation of the - plasma current bootstrap fraction. - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, - ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 + aspect: float, + beta: float, + bt: float, + plascur: float, + q95: float, + q0: float, + rmajor: float, + vol: float, + ) -> float: + """ + Calculate the bootstrap-driven fraction of the plasma current. + + Args: + aspect (float): Plasma aspect ratio. + beta (float): Plasma total beta. + bt (float): Toroidal field on axis (T). + plascur (float): Plasma current (A). + q95 (float): Safety factor at 95% surface. + q0 (float): Central safety factor. + rmajor (float): Plasma major radius (m). + vol (float): Plasma volume (m3). + + Returns: + float: The bootstrap-driven fraction of the plasma current. + + This function performs the original ITER calculation of the plasma current bootstrap fraction. + + Reference: ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, + ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 """ xbs = min(10, q95 / q0) - cbs = (1.32 - 0.235 * xbs + 0.0185 * xbs**2) + cbs = 1.32 - 0.235 * xbs + 0.0185 * xbs**2 bpbs = ( constants.rmu0 * plascur @@ -4522,23 +4537,34 @@ def bootstrap_fraction_iter89( @staticmethod def bootstrap_fraction_wilson( - alphaj, alphap, alphat, betpth, q0, qpsi, rmajor, rminor - ): - """Bootstrap current fraction from Wilson et al scaling - author: P J Knight, CCFE, Culham Science Centre - alphaj : input real : current profile index - alphap : input real : pressure profile index - alphat : input real : temperature profile index - beta : input real : total beta - betpth : input real : thermal component of poloidal beta - q0 : input real : safety factor on axis - qpsi : input real : edge safety factor - rmajor : input real : major radius (m) - rminor : input real : minor radius (m) - This function calculates the bootstrap current fraction - using the numerically fitted algorithm written by Howard Wilson. - AEA FUS 172: Physics Assessment for the European Reactor Study - H. R. Wilson, Nuclear Fusion 32 (1992) 257 + alphaj: float, + alphap: float, + alphat: float, + betpth: float, + q0: float, + qpsi: float, + rmajor: float, + rminor: float, + ) -> float: + """ + Bootstrap current fraction from Wilson et al scaling + + Args: + alphaj (float): Current profile index. + alphap (float): Pressure profile index. + alphat (float): Temperature profile index. + betpth (float): Thermal component of poloidal beta. + q0 (float): Safety factor on axis. + qpsi (float): Edge safety factor. + rmajor (float): Major radius (m). + rminor (float): Minor radius (m). + + Returns: + float: The bootstrap current fraction. + + This function calculates the bootstrap current fraction using the numerically fitted algorithm written by Howard Wilson. + + Reference: AEA FUS 172: Physics Assessment for the European Reactor Study, H. R. Wilson, Nuclear Fusion 32 (1992) 257 """ term1 = np.log(0.5) term2 = np.log(q0 / qpsi) From 3836cdc6c018775f0441320ce035295e1c78607b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 22 Aug 2024 14:27:23 +0100 Subject: [PATCH 029/108] :white_check_mark: Update test suite and files to use i_plasma_current and i_bootstrap_current instead of icurr and ibss --- .../data/csv_output_large_tokamak_MFILE.DAT | 6 ++-- examples/data/large_tokamak_1_MFILE.DAT | 6 ++-- examples/data/large_tokamak_2_MFILE.DAT | 6 ++-- examples/data/large_tokamak_3_MFILE.DAT | 6 ++-- examples/data/large_tokamak_4_MFILE.DAT | 6 ++-- examples/data/large_tokamak_IN.DAT | 4 +-- examples/data/scan_MFILE.DAT | 22 ++++++------ examples/data/scan_example_file_IN.DAT | 4 +-- .../data/large_tokamak_1_MFILE.DAT | 6 ++-- .../data/large_tokamak_2_MFILE.DAT | 6 ++-- .../data/large_tokamak_3_MFILE.DAT | 6 ++-- .../data/large_tokamak_4_MFILE.DAT | 6 ++-- tests/integration/data/large_tokamak_IN.DAT | 4 +-- .../integration/data/large_tokamak_MFILE.DAT | 6 ++-- tests/integration/data/ref_IN.DAT | 4 +-- tests/integration/data/scan_2D_MFILE.DAT | 34 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 22 ++++++------ .../data/uncertainties_nonopt_ref_IN.DAT | 4 +-- .../integration/data/uncertainties_ref_IN.DAT | 4 +-- .../input_files/large_tokamak.IN.DAT | 2 +- .../input_files/large_tokamak_nof.IN.DAT | 2 +- .../large_tokamak_once_through.IN.DAT | 2 +- .../input_files/st_regression.IN.DAT | 4 +-- tests/unit/data/large_tokamak_IN.DAT | 4 +-- tests/unit/data/large_tokamak_MFILE.DAT | 6 ++-- 25 files changed, 91 insertions(+), 91 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index c7cb3dbc66..8436672bb9 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -331,7 +331,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6699E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8387E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1898E+00 @@ -1568,13 +1568,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index e34aae237f..746cca4426 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 @@ -1562,13 +1562,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 0b53497232..55786a4215 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 @@ -1562,13 +1562,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index db22bbd540..06f98982c3 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 @@ -1562,13 +1562,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index 723ffcc459..eabdfb3a9b 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 @@ -1562,13 +1562,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/examples/data/large_tokamak_IN.DAT b/examples/data/large_tokamak_IN.DAT index a1298b175f..350d6727de 100644 --- a/examples/data/large_tokamak_IN.DAT +++ b/examples/data/large_tokamak_IN.DAT @@ -372,13 +372,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 4a15ec60cb..3e7b1bbfc0 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -187,7 +187,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -1182,7 +1182,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -2177,7 +2177,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -3172,7 +3172,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -4167,7 +4167,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -5162,7 +5162,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -6157,7 +6157,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -7152,7 +7152,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -8147,7 +8147,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -9239,9 +9239,9 @@ fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) fvsbrnni = 0.4434 * Fraction of the plasma current produced by gamma = 0.3 * Ejima coefficient for resistive startup v-s formula hfact = 1.1 * H factor on energy confinement times (iteration variable 10) -ibss = 4 * Switch for bootstrap current scaling; +i_bootstrap_current = 4 * Switch for bootstrap current scaling; iculbl = 1 * Switch for beta limit scaling (constraint equation 24); -icurr = 4 * Switch for plasma current scaling to use; +i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; ifispact = 0 * Switch for neutronics calculations; diff --git a/examples/data/scan_example_file_IN.DAT b/examples/data/scan_example_file_IN.DAT index 0cae5c4a77..bb6a863b62 100644 --- a/examples/data/scan_example_file_IN.DAT +++ b/examples/data/scan_example_file_IN.DAT @@ -372,13 +372,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 1046f78ab0..1ae338e1f7 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 @@ -1562,13 +1562,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 18600872f8..815c4eb482 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 @@ -1562,13 +1562,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 6e017fd942..e85015ddfe 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 @@ -1562,13 +1562,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 2a5c97aeeb..52a73a2d18 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 @@ -1562,13 +1562,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/integration/data/large_tokamak_IN.DAT b/tests/integration/data/large_tokamak_IN.DAT index a1298b175f..350d6727de 100644 --- a/tests/integration/data/large_tokamak_IN.DAT +++ b/tests/integration/data/large_tokamak_IN.DAT @@ -372,13 +372,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 1b733a972f..184867eb68 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -328,7 +328,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6521E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 2.0295E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2402E+00 @@ -1563,13 +1563,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/integration/data/ref_IN.DAT b/tests/integration/data/ref_IN.DAT index a64815b2a7..eff7d05c4d 100644 --- a/tests/integration/data/ref_IN.DAT +++ b/tests/integration/data/ref_IN.DAT @@ -260,9 +260,9 @@ fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) fvsbrnni = 0.4434 * Fraction of the plasma current produced by gamma = 0.3 * Ejima coefficient for resistive startup v-s formula hfact = 1.1 * H factor on energy confinement times (iteration variable 10) -ibss = 4 * Switch for bootstrap current scaling; +i_bootstrap_current = 4 * Switch for bootstrap current scaling; iculbl = 1 * Switch for beta limit scaling (constraint equation 24); -icurr = 4 * Switch for plasma current scaling to use; +i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; ifispact = 0 * Switch for neutronics calculations; diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 8ff45e9bd0..eb57fa6d37 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6569E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9385E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2165E+00 @@ -1496,7 +1496,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6633E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8709E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1985E+00 @@ -2659,7 +2659,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6683E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8062E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1810E+00 @@ -3822,7 +3822,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6609E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8186E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1844E+00 @@ -4985,7 +4985,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6604E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8760E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1999E+00 @@ -6148,7 +6148,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6548E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9423E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2175E+00 @@ -7311,7 +7311,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6479E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9545E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2207E+00 @@ -8474,7 +8474,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6497E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8947E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2048E+00 @@ -9637,7 +9637,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6468E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8429E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1909E+00 @@ -10800,7 +10800,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6447E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8466E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1919E+00 @@ -11963,7 +11963,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6498E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8944E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2048E+00 @@ -13126,7 +13126,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6485E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9535E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2204E+00 @@ -14289,7 +14289,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6455E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9590E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2219E+00 @@ -15452,7 +15452,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6516E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8912E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2039E+00 @@ -16615,7 +16615,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6581E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8235E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1857E+00 @@ -17848,13 +17848,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index d132e1e353..6f9fc9acee 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -187,7 +187,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -1182,7 +1182,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -2177,7 +2177,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -3172,7 +3172,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -4167,7 +4167,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -5162,7 +5162,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -6157,7 +6157,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -7152,7 +7152,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -8147,7 +8147,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 @@ -9239,9 +9239,9 @@ fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) fvsbrnni = 0.4434 * Fraction of the plasma current produced by gamma = 0.3 * Ejima coefficient for resistive startup v-s formula hfact = 1.1 * H factor on energy confinement times (iteration variable 10) -ibss = 4 * Switch for bootstrap current scaling; +i_bootstrap_current = 4 * Switch for bootstrap current scaling; iculbl = 1 * Switch for beta limit scaling (constraint equation 24); -icurr = 4 * Switch for plasma current scaling to use; +i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; ifispact = 0 * Switch for neutronics calculations; diff --git a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT index 4d33258569..7b5e292827 100644 --- a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT +++ b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT @@ -260,9 +260,9 @@ fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) fvsbrnni = 0.4434 * Fraction of the plasma current produced by gamma = 0.3 * Ejima coefficient for resistive startup v-s formula hfact = 1.1 * H factor on energy confinement times (iteration variable 10) -ibss = 4 * Switch for bootstrap current scaling; +i_bootstrap_current = 4 * Switch for bootstrap current scaling; iculbl = 1 * Switch for beta limit scaling (constraint equation 24); -icurr = 4 * Switch for plasma current scaling to use; +i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; ifispact = 0 * Switch for neutronics calculations; diff --git a/tests/integration/data/uncertainties_ref_IN.DAT b/tests/integration/data/uncertainties_ref_IN.DAT index c64577bf4e..86766e25b1 100644 --- a/tests/integration/data/uncertainties_ref_IN.DAT +++ b/tests/integration/data/uncertainties_ref_IN.DAT @@ -260,9 +260,9 @@ fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) fvsbrnni = 0.4434 * Fraction of the plasma current produced by gamma = 0.3 * Ejima coefficient for resistive startup v-s formula hfact = 1.1 * H factor on energy confinement times (iteration variable 10) -ibss = 4 * Switch for bootstrap current scaling; +i_bootstrap_current = 4 * Switch for bootstrap current scaling; iculbl = 1 * Switch for beta limit scaling (constraint equation 24); -icurr = 4 * Switch for plasma current scaling to use; +i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; ifispact = 0 * Switch for neutronics calculations; diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT index a26d7b01e3..37b77fa5d1 100644 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ b/tests/regression/input_files/large_tokamak.IN.DAT @@ -378,7 +378,7 @@ i_bootstrap_current = 4 iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index 394369b786..eca62fd272 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -360,7 +360,7 @@ i_bootstrap_current = 4 iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/regression/input_files/large_tokamak_once_through.IN.DAT b/tests/regression/input_files/large_tokamak_once_through.IN.DAT index 76da0521cc..8a74f55e63 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -326,7 +326,7 @@ gamma = 0.3 * Ejima coefficient for resistive startup V-s formula hfact = 1.185971818905028 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); i_bootstrap_current = 4 * switch for bootstrap current scaling iculbl = 1 * switch for beta limit scaling (`constraint equation 24`) -icurr = 4 * switch for plasma current scaling to use +i_plasma_current = 4 * switch for plasma current scaling to use idensl = 7 * switch for density limit to enforce (`constraint equation 5`) ifalphap = 1 * switch for fast alpha pressure calculation iinvqd = 1 * switch for inverse quadrature in L-mode scaling laws 5 and 9; diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 3f1776b287..5f617b1f4b 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -2959,7 +2959,7 @@ i_bootstrap_current = 4 * DESCRIPTION: Non-inductive volt-sec burn fraction, fraction of the plasma current produced by non-inductive means * JUSTIFICATION: Not scaling plasma current induction. default = 1.0 -icurr = 9 +i_plasma_current = 9 * DESCRIPTION: Switch for Plasma Current Scaling to Use (9: Fit from FIESTA (ST)) * JUSTIFICATION: Fit derived from FIESTA for FNSF-like Plasmas * REFERENCE: Muldrew et al. (2020), Fus. Eng. & Des., 154, 111530 @@ -2977,7 +2977,7 @@ ips = 1 iprofile = 0 * DESCRIPTION: Switch for Current Profile Consistency (0: Use Input Values for alphaj rli dnbeta) * =0 use input values for alphaj, rli, dnbeta (but see gtscale option) -* =1 make these consistent with input q, q_0 values (recommend `icurr=4` with this option) +* =1 make these consistent with input q, q_0 values (recommend `i_plasma_current=4` with this option) * JUSTIFICATION: These consistency equations don't hold for STs * REFERENCE: diff --git a/tests/unit/data/large_tokamak_IN.DAT b/tests/unit/data/large_tokamak_IN.DAT index 02c25de0d4..62abe986c3 100644 --- a/tests/unit/data/large_tokamak_IN.DAT +++ b/tests/unit/data/large_tokamak_IN.DAT @@ -372,13 +372,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 1b733a972f..184867eb68 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -328,7 +328,7 @@ Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP - Plasma_current_scaling_law_used_________________________________________ (icurr)_______________________ 4 + Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6521E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 2.0295E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2402E+00 @@ -1563,13 +1563,13 @@ fkzohm = 1.02 gamma = 0.3 * Switch for bootstrap current scaling -ibss = 4 +i_bootstrap_current = 4 * Switch for beta limit scaling iculbl = 1 * Switch for plasma current scaling -icurr = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 From 45a77481a765a4b5e67760bc06962c0e7f573fcb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 22 Aug 2024 14:55:54 +0100 Subject: [PATCH 030/108] refactor: Update variable names for diamagnetic current calculation in physics.py --- process/physics.py | 11 +++++++---- process/utilities/errorlist.json | 2 +- tests/regression/input_files/large_tokamak.IN.DAT | 2 +- tests/regression/input_files/large_tokamak_nof.IN.DAT | 2 +- .../input_files/large_tokamak_once_through.IN.DAT | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/process/physics.py b/process/physics.py index ce319138a8..5aeb35b30e 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1129,7 +1129,7 @@ def physics(self): current_drive_variables.bootipf = current_drive_variables.bscf_sauter elif physics_variables.i_bootstrap_current == 5: # Sakai states that the ACCOME dataset used has the toridal diamagnetic current included in the bootstrap current - # So the diamagnetic current calculation should be turned off when using, (idia = 0). + # So the diamagnetic current calculation should be turned off when using, (i_diamagnetic_current = 0). current_drive_variables.bootipf = current_drive_variables.bscf_sakai else: error_handling.idiags[0] = physics_variables.i_bootstrap_current @@ -4564,7 +4564,8 @@ def bootstrap_fraction_wilson( This function calculates the bootstrap current fraction using the numerically fitted algorithm written by Howard Wilson. - Reference: AEA FUS 172: Physics Assessment for the European Reactor Study, H. R. Wilson, Nuclear Fusion 32 (1992) 257 + Reference: AEA FUS 172: Physics Assessment for the European Reactor Study, 1989 + H. R. Wilson, Nuclear Fusion 32 (1992) 257 """ term1 = np.log(0.5) term2 = np.log(q0 / qpsi) @@ -4592,12 +4593,14 @@ def bootstrap_fraction_wilson( z = 1.0 # Inverse aspect ratio: r2 = maximum plasma radius, r1 = minimum - + # This is the definition used in the paper r2 = rmajor + rminor r1 = rmajor - rminor eps1 = (r2 - r1) / (r2 + r1) # Coefficients fitted using least squares techniques + + # Square root of current profile index term saj = np.sqrt(aj) a = np.array( @@ -4891,7 +4894,7 @@ def bootstrap_fraction_sakai( https://doi.org/10.1016/j.fusengdes.2019.111322. """ # Sakai states that the ACCOME dataset used has the toridal diamagnetic current included in the bootstrap current - # So the diamganetic current should not be calculated with this. idia = 0 + # So the diamganetic current should not be calculated with this. i_diamagnetic_current = 0 return ( 10 ** (0.951 * eps - 0.948) * betap ** (1.226 * eps + 1.584) diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index b6a496734d..6640ff01c7 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -1428,7 +1428,7 @@ { "no": 284, "level": 3, - "message": "CHECK: idia = 0 should be used with the Sakai plasma current scaling." + "message": "CHECK: i_diamagnetic_current = 0 should be used with the Sakai plasma current scaling." } ] } diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT index 37b77fa5d1..927dbf9be0 100644 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ b/tests/regression/input_files/large_tokamak.IN.DAT @@ -378,7 +378,7 @@ i_bootstrap_current = 4 iculbl = 1 * Switch for plasma current scaling -i_plasma_current = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index eca62fd272..686a758ea0 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -360,7 +360,7 @@ i_bootstrap_current = 4 iculbl = 1 * Switch for plasma current scaling -i_plasma_current = 4 +i_plasma_current = 4 * Switch for density limit to enforce idensl = 7 diff --git a/tests/regression/input_files/large_tokamak_once_through.IN.DAT b/tests/regression/input_files/large_tokamak_once_through.IN.DAT index 8a74f55e63..02068bac1e 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -326,7 +326,7 @@ gamma = 0.3 * Ejima coefficient for resistive startup V-s formula hfact = 1.185971818905028 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); i_bootstrap_current = 4 * switch for bootstrap current scaling iculbl = 1 * switch for beta limit scaling (`constraint equation 24`) -i_plasma_current = 4 * switch for plasma current scaling to use +i_plasma_current = 4 * switch for plasma current scaling to use idensl = 7 * switch for density limit to enforce (`constraint equation 5`) ifalphap = 1 * switch for fast alpha pressure calculation iinvqd = 1 * switch for inverse quadrature in L-mode scaling laws 5 and 9; From cff1a29468688e48cce908a925b372a4c57f982a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 22 Aug 2024 15:04:49 +0100 Subject: [PATCH 031/108] :label: refactor: Update variable names of ips to i_pfirsch_scluter_current and add to obsolete variables list. Test files updated also --- .../pfirsch_schl\303\274ter_current_drive.md" | 4 ++-- process/io/obsolete_vars.py | 1 + process/physics.py | 6 +++--- process/utilities/errorlist.json | 2 +- source/fortran/input.f90 | 6 +++--- source/fortran/physics_variables.f90 | 4 ++-- tests/integration/ref_dicts.json | 10 +++++----- tests/regression/input_files/st_regression.IN.DAT | 2 +- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git "a/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" "b/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" index 06d8ac494f..761b61c85f 100644 --- "a/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" +++ "b/documentation/proc-pages/physics-models/plasma_current/pfirsch_schl\303\274ter_current_drive.md" @@ -11,13 +11,13 @@ and to use the method of fixing the bootstrap current fraction. ### No Pfirsch-Schlüter current -To have it so that the Pfirsch-Schlüter current is not calculated you can set `ips = 0` +To have it so that the Pfirsch-Schlüter current is not calculated you can set `i_pfirsch_schluter_current = 0` ------------------ ### SCENE Fit: -This model can be used by setting: `ips = 2` +This model can be used by setting: `i_pfirsch_schluter_current = 2` This model is based off of 108 equlibria from SCENE. Overall the equilibria cover: diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index b5d5ecdefe..437bf84b26 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -116,6 +116,7 @@ "icurr": "i_plasma_current", "idia": "i_diamagnetic_current", "ibss": "i_bootstrap_current", + "ips": "i_pfirsch_schluter_current", } OBS_VARS_HELP = { diff --git a/process/physics.py b/process/physics.py index 5aeb35b30e..3e482263bf 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1034,7 +1034,7 @@ def physics(self): # Pfirsch-Schlüter scaling for diamagnetic current current_drive_variables.pscf_scene = ps_fraction_scene(physics_variables.beta) - if physics_variables.ips == 1: + if physics_variables.i_pfirsch_schluter_current == 1: current_drive_variables.psipf = current_drive_variables.pscf_scene # ***************************** # @@ -4301,11 +4301,11 @@ def outplas(self): self.outfile, " (SCENE diamagnetic current fraction scaling used)" ) - if physics_variables.ips == 0: + if physics_variables.i_pfirsch_schluter_current == 0: po.ocmmnt( self.outfile, " Pfirsch-Schluter current fraction not calculated" ) - elif physics_variables.ips == 1: + elif physics_variables.i_pfirsch_schluter_current == 1: po.ocmmnt( self.outfile, " (SCENE Pfirsch-Schluter current fraction scaling used)", diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index 6640ff01c7..18ede0b24a 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -1228,7 +1228,7 @@ { "no": 244, "level": 2, - "message": "PHYSICS: Diamagnetic fraction is more than 1%, but not calculated. Consider using i_diamagnetic_current=2 and ips=1." + "message": "PHYSICS: Diamagnetic fraction is more than 1%, but not calculated. Consider using i_diamagnetic_current=2 and i_pfirsch_schluter_current=1." }, { "no": 245, diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 64b742a2be..b8026de034 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -312,7 +312,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) teped, fhe3, iwalld, gamma, falpha, fgwped, tbeta, i_bootstrap_current, & iradloss, te, alphan, rmajor, kappa, iinvqd, fkzohm, beamfus0, & tauratio, idensl, bt, iscrp, ipnlaws, betalim, betalim_lower, & - i_diamagnetic_current, ips, m_s_limit, burnup_in + i_diamagnetic_current, i_pfirsch_schluter_current, m_s_limit, burnup_in use pf_power_variables, only: iscenr, maxpoloidalpower use pulse_variables, only: lpulse, dtstor, itcycl, istore, bctmp @@ -652,8 +652,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('iprofile') call parse_int_variable('iprofile', iprofile, 0, 6, & 'Switch for current profile consistency') - case ('ips') - call parse_int_variable('ips', ips, 0, 1, & + case ('i_pfirsch_schluter_current') + call parse_int_variable('i_pfirsch_schluter_current', i_pfirsch_schluter_current, 0, 1, & 'Switch for Pfirsch-Schlüter scaling') case ('iradloss') call parse_int_variable('iradloss', iradloss, 0, 2, & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index d7c39d05f3..93cb43f9e2 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -319,7 +319,7 @@ module physics_variables !! - =0 use original parabolic profiles !! - =1 use pedestal profile - integer :: ips + integer :: i_pfirsch_schluter_current !! switch for Pfirsch-Schlüter current scaling (issue #413): !! !! - =0 Do not calculate @@ -959,7 +959,7 @@ subroutine init_physics_variables ignite = 0 iinvqd = 1 ipedestal = 1 - ips = 0 + i_pfirsch_schluter_current = 0 neped = 4.0D19 nesep = 3.0D19 alpha_crit = 0.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index cb5d7460fe..a3cb783fa8 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -2647,7 +2647,7 @@ "iprimdiv": 0.0, "iprimshld": 1.0, "iprofile": 1.0, - "ips": 0.0, + "i_pfirsch_schluter_current": 0.0, "iptnt": "(ipeqns*(3*ipeqns+13))/2", "iptr": 0.0, "ipvlam": "ipeqns+2*ipnvars+1", @@ -9876,7 +9876,7 @@ "iprimdiv": "", "iprimshld": "Switch for shield thermal power destiny:\n
      \n
    • =0 does not contribute to energy generation cycle
    • \n
    • =1 contributes to energy generation cycle
    • \n
    ", "iprofile": "switch for current profile consistency:\n
      \n
    • =0 use input values for alphaj, rli, dnbeta (but see gtscale option)
    • \n
    • =1 make these consistent with input q, q_0 values (recommend `i_plasma_current=4` with this option)
    • \n
    ", - "ips": "switch for Pfirsch-Schl\u00fcter current scaling (issue #413):\n
      \n
    • =0 Do not calculate
    • \n
    • =1 Use SCENE scaling
    • \n
    ", + "i_pfirsch_schluter_current": "switch for Pfirsch-Schl\u00fcter current scaling (issue #413):\n
      \n
    • =0 Do not calculate
    • \n
    • =1 Use SCENE scaling
    • \n
    ", "iptnt": "", "iptr": "", "ipvlam": "", @@ -13452,7 +13452,7 @@ "lb": 0, "ub": 1 }, - "ips": { + "i_pfirsch_schluter_current": { "lb": 0, "ub": 1 }, @@ -19113,7 +19113,7 @@ "ignite", "iinvqd", "ipedestal", - "ips", + "i_pfirsch_schluter_current", "neped", "nesep", "alpha_crit", @@ -20463,7 +20463,7 @@ "iprecomp": "int_variable", "iprimshld": "int_variable", "iprofile": "int_variable", - "ips": "int_variable", + "i_pfirsch_schluter_current": "int_variable", "iradloss": "int_variable", "ireactor": "int_variable", "irefprop": "int_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 5f617b1f4b..c130aec0db 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -2968,7 +2968,7 @@ i_diamagnetic_current = 2 * DESCRIPTION: Switch for Diamagnetic Current Scaling (2: SCENE Fit) * JUSTIFICATION: -ips = 1 +i_pfirsch_schluter_current = 1 * DESCRIPTION: Switch for Pfirsch-Schlüter Current Scaling (1: SCENE Fit) * JUSTIFICATION: From 28b8a1891b17ac012241f9b74a04e8895bef1dea Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 6 Sep 2024 16:24:55 +0100 Subject: [PATCH 032/108] Fix type in Sakai scaling and lack of inverse aspect ratio term in inductance dependancy --- process/physics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/process/physics.py b/process/physics.py index 3e482263bf..ef8544c4e4 100644 --- a/process/physics.py +++ b/process/physics.py @@ -4880,7 +4880,7 @@ def bootstrap_fraction_sakai( float: The calculated bootstrap fraction. Notes: - The profile assumed for the alphan anf alpat indexes is only a prabolic profile without a pedestal (L-mode). + The profile assumed for the alphan and alpat indexes is only a parabolic profile without a pedestal (L-mode). The Root Mean Squared Error for the fitting database of this formula was 0.025 Concentrating on the positive shear plasmas using the ACCOME code equilibria with the fully non-inductively driven conditions with neutral beam (NB) injection only are calculated. @@ -4898,7 +4898,7 @@ def bootstrap_fraction_sakai( return ( 10 ** (0.951 * eps - 0.948) * betap ** (1.226 * eps + 1.584) - * rli ** (-0.184 - 0.282) + * rli ** (-0.184 * eps - 0.282) * (q95 / q0) ** (-0.042 * eps - 0.02) * alphan ** (0.13 * eps + 0.05) * alphat ** (0.502 * eps - 0.273) From 96a9b222cb8bb043970121a7b4d225142db6afbd Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 6 Sep 2024 17:27:42 +0100 Subject: [PATCH 033/108] Add type hints and improved docstring to bootstrap_fraction_nevins() --- process/physics.py | 80 +++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 33 deletions(-) diff --git a/process/physics.py b/process/physics.py index ef8544c4e4..c4916e605b 100644 --- a/process/physics.py +++ b/process/physics.py @@ -4644,36 +4644,50 @@ def bootstrap_fraction_wilson( @staticmethod def bootstrap_fraction_nevins( - alphan, - alphat, - betat, - bt, - dene, - plascur, - q95, - q0, - rmajor, - rminor, - ten, - zeff, - ): - """Bootstrap current fraction from Nevins et al scaling - author: P J Knight, CCFE, Culham Science Centre - alphan : input real : density profile index - alphat : input real : temperature profile index - betat : input real : total plasma beta (with respect to the toroidal - field) - bt : input real : toroidal field on axis (T) - dene : input real : electron density (/m3) - plascur: input real : plasma current (A) - q0 : input real : central safety factor - q95 : input real : safety factor at 95% surface - rmajor : input real : plasma major radius (m) - rminor : input real : plasma minor radius (m) - ten : input real : density weighted average plasma temperature (keV) - zeff : input real : plasma effective charge - This function calculates the bootstrap current fraction, - using the Nevins et al method, 4/11/90. + alphan: float, + alphat: float, + betat: float, + bt: float, + dene: float, + plascur: float, + q95: float, + q0: float, + rmajor: float, + rminor: float, + ten: float, + zeff: float, + ) -> float: + """ + Calculate the bootstrap current fraction from Nevins et al scaling. + + Args: + alphan (float): Density profile index. + alphat (float): Temperature profile index. + betat (float): Total plasma beta (with respect to the toroidal field). + bt (float): Toroidal field on axis (T). + dene (float): Electron density (/m3). + plascur (float): Plasma current (A). + q0 (float): Central safety factor. + q95 (float): Safety factor at 95% surface. + rmajor (float): Plasma major radius (m). + rminor (float): Plasma minor radius (m). + ten (float): Density weighted average plasma temperature (keV). + zeff (float): Plasma effective charge. + + Returns: + float: The bootstrap current fraction. + + This function calculates the bootstrap current fraction using the Nevins et al method. + + Reference: See appendix of: + Keii Gi, Makoto Nakamura, Kenji Tobita, Yasushi Ono, + Bootstrap current fraction scaling for a tokamak reactor design study, + Fusion Engineering and Design, Volume 89, Issue 11, 2014, Pages 2709-2715, + ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2014.07.009. + + Nevins, W. M. "Summary report: ITER specialists’ meeting on heating and current drive." + ITER-TN-PH-8-4, June 1988. 1988. + """ # Calculate peak electron beta @@ -4685,7 +4699,7 @@ def bootstrap_fraction_nevins( / (bt**2 / (2.0 * constants.rmu0)) ) - # Call integration routine + # Call integration routine using definite integral routine from scipy ainteg, _ = integrate.quad( lambda y: bsinteg( @@ -4704,8 +4718,8 @@ def bootstrap_fraction_nevins( constants.echarge, constants.rmu0, ), - 0, - 0.999, + 0, # Lower bound + 1.0, # Upper bound epsabs=0.001, epsrel=0.001, ) From 04c35a4e75c564e1f26974937ea40a20f0fc74f9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 6 Sep 2024 17:31:46 +0100 Subject: [PATCH 034/108] Refactor bsinteg() function in physics.py - Add type hints to function parameters - Improve docstring with detailed parameter descriptions - Update function signature to include return type annotation - Add reference to the Nevins et al bootstrap current scaling --- process/physics.py | 68 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/process/physics.py b/process/physics.py index c4916e605b..3d0573521d 100644 --- a/process/physics.py +++ b/process/physics.py @@ -461,26 +461,54 @@ def conhas( def bsinteg( - y, - dene, - ten, - bt, - rminor, - rmajor, - zeff, - alphat, - alphan, - q0, - q95, - betat, - echarge, - rmu0, -): - """Integrand function for Nevins et al bootstrap current scaling - author: P J Knight, CCFE, Culham Science Centre - y : input real : abscissa of integration, = normalised minor radius - This function calculates the integrand function for the - Nevins et al bootstrap current scaling, 4/11/90. + y: float, + dene: float, + ten: float, + bt: float, + rminor: float, + rmajor: float, + zeff: float, + alphat: float, + alphan: float, + q0: float, + q95: float, + betat: float, + echarge: float, + rmu0: float, +) -> float: + """ + Integrand function for Nevins et al bootstrap current scaling. + + Parameters: + - y: float, abscissa of integration, normalized minor radius + - dene: float, electron density (/m^3) + - ten: float, electron temperature (keV) + - bt: float, toroidal field on axis (T) + - rminor: float, plasma minor radius (m) + - rmajor: float, plasma major radius (m) + - zeff: float, mass weighted plasma effective charge + - alphat: float, temperature profile index + - alphan: float, density profile index + - q0: float, normalized safety factor at the magnetic axis + - q95: float, normalized safety factor at 95% of the plasma radius + - betat: float, total plasma beta + - echarge: float, elementary charge (C) + - rmu0: float, vacuum permeability (H/m) + + Returns: + - float, the integrand value + + This function calculates the integrand function for the Nevins et al bootstrap current scaling. + + Reference: See appendix of: + Keii Gi, Makoto Nakamura, Kenji Tobita, Yasushi Ono, + Bootstrap current fraction scaling for a tokamak reactor design study, + Fusion Engineering and Design, Volume 89, Issue 11, 2014, Pages 2709-2715, + ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2014.07.009. + + Nevins, W. M. "Summary report: ITER specialists’ meeting on heating and current drive." + ITER-TN-PH-8-4, June 1988. 1988. + """ # Constants for fit to q-profile c1 = 1.0 From 2835856828814f865fc5adcdb1390c3d7b475884 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 6 Sep 2024 17:32:58 +0100 Subject: [PATCH 035/108] Refactor bsinteg() function to nevins_integral() in physics.py --- process/physics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/process/physics.py b/process/physics.py index 3d0573521d..b8966b2462 100644 --- a/process/physics.py +++ b/process/physics.py @@ -460,7 +460,7 @@ def conhas( ) -def bsinteg( +def nevins_integral( y: float, dene: float, ten: float, @@ -4730,7 +4730,7 @@ def bootstrap_fraction_nevins( # Call integration routine using definite integral routine from scipy ainteg, _ = integrate.quad( - lambda y: bsinteg( + lambda y: nevins_integral( y, dene, ten, From 7ec77bd58242649b891db907c98e875125f401e6 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 9 Sep 2024 15:47:42 +0100 Subject: [PATCH 036/108] Fix the nevins_integral() and bootstrap_fraction_nevins() to align to the model and be more pythonic. - Originally `ten` was used as the plasma temp variable when it should be `te` - Use of constants.f90 is now enforced so removed variables - Function is more pythonic - Comments now fully descrive the different types of beta - Integral is now done full to 1.0 with default scipy accuracy --- process/physics.py | 57 +++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/process/physics.py b/process/physics.py index b8966b2462..b12580d5dd 100644 --- a/process/physics.py +++ b/process/physics.py @@ -463,7 +463,7 @@ def conhas( def nevins_integral( y: float, dene: float, - ten: float, + te: float, bt: float, rminor: float, rmajor: float, @@ -473,27 +473,23 @@ def nevins_integral( q0: float, q95: float, betat: float, - echarge: float, - rmu0: float, ) -> float: """ Integrand function for Nevins et al bootstrap current scaling. Parameters: - y: float, abscissa of integration, normalized minor radius - - dene: float, electron density (/m^3) - - ten: float, electron temperature (keV) + - dene: float, volume averaged electron density (/m^3) + - te: float, volume averaged electron temperature (keV) - bt: float, toroidal field on axis (T) - rminor: float, plasma minor radius (m) - rmajor: float, plasma major radius (m) - - zeff: float, mass weighted plasma effective charge + - zeff: float, plasma effective charge - alphat: float, temperature profile index - alphan: float, density profile index - q0: float, normalized safety factor at the magnetic axis - q95: float, normalized safety factor at 95% of the plasma radius - - betat: float, total plasma beta - - echarge: float, elementary charge (C) - - rmu0: float, vacuum permeability (H/m) + - betat: float, Toroidal plasma beta Returns: - float, the integrand value @@ -510,35 +506,31 @@ def nevins_integral( ITER-TN-PH-8-4, June 1988. 1988. """ - # Constants for fit to q-profile - c1 = 1.0 - c2 = 1.0 - c3 = 1.0 # Compute average electron beta - betae = dene * ten * 1.0e3 * echarge / (bt**2 / (2.0 * rmu0)) + betae = dene * te * 1.0e3 * constants.echarge / (bt**2 / (2.0 * constants.rmu0)) nabla = rminor * np.sqrt(y) / rmajor x = (1.46 * np.sqrt(nabla) + 2.4 * nabla) / (1.0 - nabla) ** 1.5 z = zeff d = ( 1.414 * z - + z * z - + x * (0.754 + 2.657 * z + 2.0 * z * z) - + x * x * (0.348 + 1.243 * z + z * z) + + z**2 + + x * (0.754 + 2.657 * z + (2.0 * z**2)) + + (x**2 * (0.348 + 1.243 * z + z**2)) ) - al2 = -x * (0.884 + 2.074 * z) / d + a1 = (alphan + alphat) * (1.0 - y) ** (alphan + alphat - 1.0) a2 = alphat * (1.0 - y) ** (alphan + alphat - 1.0) + al1 = (x/d) * (0.754 + 2.21 * z + z**2 + x * (0.348 + 1.243 * z + z**2)) + al2 = -x * ((0.884 + 2.074 * z) / d) alphai = -1.172 / (1.0 + 0.462 * x) - a1 = (alphan + alphat) * (1.0 - y) ** (alphan + alphat - 1.0) - al1 = x * (0.754 + 2.21 * z + z * z + x * (0.348 + 1.243 * z + z * z)) / d # q-profile - q = q0 + (q95 - q0) * (c1 * y + c2 * y * y + c3 * y**3) / (c1 + c2 + c3) + q = q0 + (q95 - q0) * ((y + y**2 + y**3) / (3.0)) pratio = (betat - betae) / betae - return (q / q95) * (al1 * (a1 + pratio * (a1 + alphai * a2)) + al2 * a2) + return (q / q95) * (al1 * (a1 + (pratio * (a1 + alphai * a2))) + al2 * a2) def diamagnetic_fraction_hender(beta: float) -> float: @@ -1083,7 +1075,7 @@ def physics(self): physics_variables.vol, ) ) - + # Calculate the toroidal beta for the Nevins scaling betat = ( physics_variables.beta * physics_variables.btot**2 @@ -1103,7 +1095,7 @@ def physics(self): physics_variables.q0, physics_variables.rmajor, physics_variables.rminor, - physics_variables.ten, + physics_variables.te, physics_variables.zeff, ) ) @@ -4682,7 +4674,7 @@ def bootstrap_fraction_nevins( q0: float, rmajor: float, rminor: float, - ten: float, + te: float, zeff: float, ) -> float: """ @@ -4691,7 +4683,7 @@ def bootstrap_fraction_nevins( Args: alphan (float): Density profile index. alphat (float): Temperature profile index. - betat (float): Total plasma beta (with respect to the toroidal field). + betat (float): Toroidal plasma beta. bt (float): Toroidal field on axis (T). dene (float): Electron density (/m3). plascur (float): Plasma current (A). @@ -4699,7 +4691,7 @@ def bootstrap_fraction_nevins( q95 (float): Safety factor at 95% surface. rmajor (float): Plasma major radius (m). rminor (float): Plasma minor radius (m). - ten (float): Density weighted average plasma temperature (keV). + te (float): Volume averaged plasma temperature (keV). zeff (float): Plasma effective charge. Returns: @@ -4717,7 +4709,10 @@ def bootstrap_fraction_nevins( ITER-TN-PH-8-4, June 1988. 1988. """ - # Calculate peak electron beta + # Calculate peak electron beta at plasma centre, this is not the form used in the paper + # The paper assumes parabolic profiles for calculating core values with the profile indexes. + # We instead use the directly calculated electron density and temperature values at the core. + # So that it is compatible with all profiles betae0 = ( physics_variables.ne0 @@ -4733,7 +4728,7 @@ def bootstrap_fraction_nevins( lambda y: nevins_integral( y, dene, - ten, + te, bt, rminor, rmajor, @@ -4743,13 +4738,9 @@ def bootstrap_fraction_nevins( q0, q95, betat, - constants.echarge, - constants.rmu0, ), 0, # Lower bound 1.0, # Upper bound - epsabs=0.001, - epsrel=0.001, ) # Calculate bootstrap current and fraction From c763d8989136f02104008fa500e68d1920740c1e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 11 Sep 2024 09:45:09 +0100 Subject: [PATCH 037/108] Add type hints and updated docstring along with a few comments to bootstrap_fraction_sauter() --- process/physics.py | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/process/physics.py b/process/physics.py index 7fe59985d5..58c31d7500 100644 --- a/process/physics.py +++ b/process/physics.py @@ -4749,32 +4749,53 @@ def bootstrap_fraction_nevins( return 1.0e6 * aibs / plascur @staticmethod - def bootstrap_fraction_sauter(plasma_profile): - """Bootstrap current fraction from Sauter et al scaling - author: P J Knight, CCFE, Culham Science Centre - None - This function calculates the bootstrap current fraction - using the Sauter, Angioni and Lin-Liu scaling. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - O. Sauter, C. Angioni and Y. R. Lin-Liu, - Physics of Plasmas 6 (1999) 2834 - O. Sauter, C. Angioni and Y. R. Lin-Liu, (ERRATA) - Physics of Plasmas 9 (2002) 5140 + def bootstrap_fraction_sauter(plasma_profile: PlasmaProfile) -> float: + """Calculate the bootstrap current fraction from the Sauter et al scaling. + + Args: + plasma_profile (PlasmaProfile): The plasma profile object. + + Returns: + float: The bootstrap current fraction. + + This function calculates the bootstrap current fraction using the Sauter, Angioni, and Lin-Liu scaling. + + Reference: + + O. Sauter, C. Angioni, Y. R. Lin-Liu; + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. + Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 + + O. Sauter, C. Angioni, Y. R. Lin-Liu; Erratum: + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime + [Phys. Plasmas 6, 2834 (1999)]. Phys. Plasmas 1 December 2002; 9 (12): 5140. https://doi.org/10.1063/1.1517052 + + Note: + The code was supplied by Emiliano Fable, IPP Garching (private communication). """ + + # Number of radial points along the profile NR = plasma_profile.profile_size + # Radial points from 0 to 1 seperated by 1/profile_size roa = plasma_profile.neprofile.profile_x + + # Local circularised minor radius rho = np.sqrt(physics_variables.xarea / np.pi) * roa + # Square root of local aspect ratio sqeps = np.sqrt(roa * (physics_variables.rminor / physics_variables.rmajor)) + # Calculate electron and ion density profiles ne = plasma_profile.neprofile.profile_y * 1e-19 ni = (physics_variables.dnitot / physics_variables.dene) * ne + # Calculate electron and ion temperature profiles tempe = plasma_profile.teprofile.profile_y tempi = (physics_variables.ti / physics_variables.te) * tempe + # Flat Zeff profile assumed + # Return tempi like array object filled with zeff zef = np.full_like(tempi, physics_variables.zeff) # mu = 1/safety factor From 16e35f123cd48b30ed62f2aff0d342498d8ce8ff Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 11 Sep 2024 11:28:13 +0100 Subject: [PATCH 038/108] Refactor tpf() into trapped_particle_fraction() function and update its docstring The trapped_particle_fraction() function has been refactored to improve readability and maintainability. The function now takes a list of radial elements, plasma triangularity, and square root of local aspect ratio as input parameters. Additionally, the function's docstring has been updated to provide more detailed information about its purpose, parameters, and references. --- process/physics.py | 92 +++++++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/process/physics.py b/process/physics.py index 58c31d7500..add9cb310a 100644 --- a/process/physics.py +++ b/process/physics.py @@ -616,7 +616,7 @@ def dcsa(j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps): DCSA $\\equiv \\mathcal{L}_{31}$, Eq.14a, Sauter et al, 1999 """ zz = zef[j - 1] - zft = tpf(j, triang, sqeps) + zft = trapped_particle_fraction(j, triang, sqeps) _nues = nues(j, rmajor, zef, mu, sqeps, tempe, ne) zdf = (1.0 + (1.0 - 0.1 * zft) * np.sqrt(_nues)) + (0.5 * (1.0 - zft) * _nues) / zz zft /= zdf # $f^{31}_{teff}(\nu_{e*})$, Eq.14b @@ -651,7 +651,7 @@ def hcsa(j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps): Physics of Plasmas 9 (2002) 5140 """ zz = zef[j - 1] - zft = tpf(j, triang, sqeps) + zft = trapped_particle_fraction(j, triang, sqeps) _nues = nues(j, rmajor, zef, mu, sqeps, tempe, ne) _nues_sqrt = np.sqrt(_nues) zdf = (1.0 + 0.26 * (1.0 - zft) * _nues_sqrt) + ( @@ -729,7 +729,7 @@ def xcsa( Physics of Plasmas 9 (2002) 5140 """ zz = zef[j - 1] - zft = tpf(j, triang, sqeps) + zft = trapped_particle_fraction(j, triang, sqeps) _nues = nues(j, rmajor, zef, mu, sqeps, tempe, ne) zdf = (1.0 + (1.0 - 0.1 * zft) * np.sqrt(_nues)) + 0.5 * ( 1.0 - 0.5 * zft @@ -842,44 +842,62 @@ def beta_poloidal_local_total(j, nr, rmajor, bt, ne, ni, tempe, tempi, mu, rho): @nb.jit(nopython=True, cache=True) -def tpf(j, triang, sqeps, fit=1): - """Trapped particle fraction - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - fit : input integer : (1)=ASTRA method, 2=Equation from Sauter2002, 3=Equation from Sauter2013 - This function calculates the trapped particle fraction at - a given radius. -

    A number of different fits are provided, but the one - to be used is hardwired prior to run-time. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - O. Sauter et al, Plasma Phys. Contr. Fusion 44 (2002) 1999 - O. Sauter, 2013: - http://infoscience.epfl.ch/record/187521/files/lrp_012013.pdf +def trapped_particle_fraction(radial_elements: list, triang: float, sqeps: list, fit: int = 0) -> list: + """ + Calculates the trapped particle fraction to be used in the Sauter bootstrap current scaling. + + Parameters: + - j: list, radial element index in range 1 to nr + - triang: float, plasma triangularity + - sqeps: list, square root of local aspect ratio + - fit: int, fit method (1=ASTRA method, 2=Equation from Sauter2002, 3=Equation from Sauter2013) + + Returns: + - list, trapped particle fraction + + This function calculates the trapped particle fraction at a given radius. + + References: + Used in this paper: + - O. Sauter, C. Angioni, Y. R. Lin-Liu; + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. + Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 + + - O. Sauter, R. J. Buttery, R. Felton, T. C. Hender, D. F. Howell, and contributors to the E.-J. Workprogramme, + “Marginal  -limit for neoclassical tearing modes in JET H-mode discharges,” + Plasma Physics and Controlled Fusion, vol. 44, no. 9, pp. 1999–2019, Aug. 2002, + doi: https://doi.org/10.1088/0741-3335/44/9/315. + + - O. Sauter, Geometric formulas for system codes including the effect of negative triangularity, + Fusion Engineering and Design, Volume 112, 2016, Pages 633-645, ISSN 0920-3796, + https://doi.org/10.1016/j.fusengdes.2016.04.033. + """ - s = sqeps[j - 1] - eps = s * s + # Prevent first element from being zero + sqeps_reduced = sqeps[radial_elements - 1] + eps = sqeps_reduced**2 - if fit == 1: + if fit == 0: # ASTRA method, from Emiliano Fable, private communication # (Excluding h term which dominates for inverse aspect ratios < 0.5, # and tends to take the trapped particle fraction to 1) zz = 1.0 - eps - return 1.0 - zz * np.sqrt(zz) / (1.0 + 1.46 * s) - elif fit == 2: - # Equation 4 of Sauter 2002 - # Similar to, but not quite identical to g above + return 1.0 - zz * np.sqrt(zz) / (1.0 + 1.46 * sqeps_reduced) + + elif fit == 1: + # Equation 4 of Sauter 2002; https://doi.org/10.1088/0741-3335/44/9/315. + # Similar to, but not quite identical to above - return 1.0 - (1.0 - eps) ** 2 / (1.0 + 1.46 * s) / np.sqrt(1.0 - eps * eps) - elif fit == 3: + return 1.0 - (((1.0 - eps) ** 2) / ((1.0 + 1.46 * sqeps_reduced) * np.sqrt(1.0 - eps**2))) + + elif fit == 2: + # Sauter 2016; https://doi.org/10.1016/j.fusengdes.2016.04.033. # Includes correction for triangularity epseff = 0.67 * (1.0 - 1.4 * triang * np.abs(triang)) * eps - return 1.0 - np.sqrt((1.0 - eps) / (1.0 + eps)) * (1.0 - epseff) / ( - 1.0 + 2.0 * np.sqrt(epseff) - ) + return 1.0 - (((1.0 - epseff) / (1.0 + 2.0 * np.sqrt(epseff)))*(np.sqrt((1.0 - eps) / (1.0 + eps)))) raise RuntimeError(f"fit={fit} is not valid. Must be 1, 2, or 3") @@ -4761,20 +4779,18 @@ def bootstrap_fraction_sauter(plasma_profile: PlasmaProfile) -> float: This function calculates the bootstrap current fraction using the Sauter, Angioni, and Lin-Liu scaling. Reference: - - O. Sauter, C. Angioni, Y. R. Lin-Liu; - Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. - Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 - - O. Sauter, C. Angioni, Y. R. Lin-Liu; Erratum: - Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime - [Phys. Plasmas 6, 2834 (1999)]. Phys. Plasmas 1 December 2002; 9 (12): 5140. https://doi.org/10.1063/1.1517052 + - O. Sauter, C. Angioni, Y. R. Lin-Liu; + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. + Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 + - O. Sauter, C. Angioni, Y. R. Lin-Liu; Erratum: + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime + [Phys. Plasmas 6, 2834 (1999)]. Phys. Plasmas 1 December 2002; 9 (12): 5140. https://doi.org/10.1063/1.1517052 Note: The code was supplied by Emiliano Fable, IPP Garching (private communication). """ - # Number of radial points along the profile + # Number of radial data points along the profile NR = plasma_profile.profile_size # Radial points from 0 to 1 seperated by 1/profile_size From eee6267c06898de52b9d8d4b618886a31afa5425 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 11 Sep 2024 17:17:20 +0100 Subject: [PATCH 039/108] Refactor dcsa() into calculate_l31_coefficient() function and update its docstring --- process/physics.py | 104 ++++++++++++++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 35 deletions(-) diff --git a/process/physics.py b/process/physics.py index add9cb310a..c96461bf8e 100644 --- a/process/physics.py +++ b/process/physics.py @@ -598,39 +598,73 @@ def nuis(j, rmajor, mu, sqeps, tempi, amain, zmain, ni): @nb.jit(nopython=True, cache=True) -def dcsa(j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps): - """Grad(ln(ne)) coefficient in the Sauter bootstrap scaling - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 2 to nr - nr : input integer : maximum value of j - This function calculates the coefficient scaling grad(ln(ne)) - in the Sauter bootstrap current scaling. - Code by Angioni, 29th May 2002. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - O. Sauter, C. Angioni and Y. R. Lin-Liu, - Physics of Plasmas 6 (1999) 2834 - O. Sauter, C. Angioni and Y. R. Lin-Liu, (ERRATA) - Physics of Plasmas 9 (2002) 5140 +def calculate_l31_coefficient( + radial_elements: np.ndarray, + number_of_elements: int, + rmajor: float, + bt: float, + triang: float, + ne: np.ndarray, + ni: np.ndarray, + tempe: np.ndarray, + tempi: np.ndarray, + magnetic_moment: np.ndarray, + rho: np.ndarray, + zeff: np.ndarray, + sqeps: np.ndarray, +) -> float: + """ + L31 coefficient before Grad(ln(ne)) in the Sauter bootstrap scaling. + + Parameters: + - radial_elements: int, radial element index in range 2 to nr + - number_of_elements: int, maximum value of radial_elements + - rmajor: float, plasma major radius (m) + - bt: float, toroidal field on axis (T) + - triang: float, plasma triangularity + - ne: np.ndarray, electron density profile (/m^3) + - ni: np.ndarray, ion density profile (/m^3) + - tempe: np.ndarray, electron temperature profile (keV) + - tempi: np.ndarray, ion temperature profile (keV) + - magnetic_moment: np.ndarray, magnetic moment profile + - rho: np.ndarray, normalized minor radius profile + - zeff: np.ndarray, effective charge profile + - sqeps: np.ndarray, square root of inverse aspect ratio profile + + Returns: + - float, the coefficient scaling grad(ln(ne)) in the Sauter bootstrap current scaling. - DCSA $\\equiv \\mathcal{L}_{31}$, Eq.14a, Sauter et al, 1999 + This function calculates the coefficient scaling grad(ln(ne)) in the Sauter bootstrap current scaling. + + Reference: + - O. Sauter, C. Angioni, Y. R. Lin-Liu; + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. + Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 + - O. Sauter, C. Angioni, Y. R. Lin-Liu; Erratum: + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime + [Phys. Plasmas 6, 2834 (1999)]. Phys. Plasmas 1 December 2002; 9 (12): 5140. https://doi.org/10.1063/1.1517052 """ - zz = zef[j - 1] - zft = trapped_particle_fraction(j, triang, sqeps) - _nues = nues(j, rmajor, zef, mu, sqeps, tempe, ne) - zdf = (1.0 + (1.0 - 0.1 * zft) * np.sqrt(_nues)) + (0.5 * (1.0 - zft) * _nues) / zz - zft /= zdf # $f^{31}_{teff}(\nu_{e*})$, Eq.14b - zft2 = zft**2 - zft3 = zft2 * zft - dcsa = ( - ((1.0 + 1.4 / (zz + 1.0)) * zft) - - (1.9 / (zz + 1.0) * zft2) - + ((0.3 * zft3 + 0.2 * zft3 * zft) / (zz + 1.0)) + # Prevents first element being 0 + charge_profile = zeff[radial_elements - 1] + + # Calculate trapped particle fraction + f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) + + # Calculated electron collisionality; nu_e* + electron_collisionality = nues(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + + # $f^{31}_{teff}(\nu_{e*})$, Eq.14b + f31_teff = f_trapped / ((1.0 + (1.0 - 0.1 * f_trapped) * np.sqrt(electron_collisionality)) + (0.5 * (1.0 - f_trapped) * electron_collisionality) / charge_profile) + + l31_coefficient = ( + ((1.0 + 1.4 / (charge_profile + 1.0)) * f31_teff) + - (1.9 / (charge_profile + 1.0) * f31_teff**2) + + ((0.3 * f31_teff**3 + 0.2 * f31_teff**4) / (charge_profile + 1.0)) ) # Corrections suggested by Fable, 15/05/2015 - return dcsa * beta_poloidal_local_total( - j, nr, rmajor, bt, ne, ni, tempe, tempi, mu, rho + return l31_coefficient * beta_poloidal_local_total( + radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho ) @@ -687,7 +721,7 @@ def hcsa(j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps): # Corrections suggested by Fable, 15/05/2015 return beta_poloidal_local(j, nr, rmajor, bt, ne, tempe, mu, rho) * ( hcee + hcei - ) + dcsa( + ) + calculate_l31_coefficient( j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps ) * beta_poloidal_local( j, nr, rmajor, bt, ne, tempe, mu, rho @@ -758,7 +792,7 @@ def xcsa( return ( beta_poloidal_local_total(j, nr, rmajor, bt, ne, ni, tempe, tempi, mu, rho) - beta_poloidal_local(j, nr, rmajor, bt, ne, tempe, mu, rho) - ) * (xcsa * alp) + dcsa( + ) * (xcsa * alp) + calculate_l31_coefficient( j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps ) * ( 1.0 @@ -842,7 +876,7 @@ def beta_poloidal_local_total(j, nr, rmajor, bt, ne, ni, tempe, tempi, mu, rho): @nb.jit(nopython=True, cache=True) -def trapped_particle_fraction(radial_elements: list, triang: float, sqeps: list, fit: int = 0) -> list: +def trapped_particle_fraction(radial_elements: np.ndarray, triang: float, sqeps: np.ndarray, fit: int = 0) -> np.ndarray: """ Calculates the trapped particle fraction to be used in the Sauter bootstrap current scaling. @@ -850,7 +884,7 @@ def trapped_particle_fraction(radial_elements: list, triang: float, sqeps: list, - j: list, radial element index in range 1 to nr - triang: float, plasma triangularity - sqeps: list, square root of local aspect ratio - - fit: int, fit method (1=ASTRA method, 2=Equation from Sauter2002, 3=Equation from Sauter2013) + - fit: int, fit method (1 = ASTRA method, 2 = Equation from Sauter 2002, 3 = Equation from Sauter 2016) Returns: - list, trapped particle fraction @@ -4767,7 +4801,7 @@ def bootstrap_fraction_nevins( return 1.0e6 * aibs / plascur @staticmethod - def bootstrap_fraction_sauter(plasma_profile: PlasmaProfile) -> float: + def bootstrap_fraction_sauter(plasma_profile: float) -> float: """Calculate the bootstrap current fraction from the Sauter et al scaling. Args: @@ -4832,7 +4866,7 @@ def bootstrap_fraction_sauter(plasma_profile: PlasmaProfile) -> float: tempi[NR - 1] = 1e-4 * tempi[NR - 2] # Calculate total bootstrap current (MA) by summing along profiles - # Looping from 2 because dcsa etc should return 0 @ j == 1 + # Looping from 2 because calculate_l31_coefficient etc should return 0 @ j == 1 nr_rng = np.arange(2, NR) nr_rng_1 = nr_rng - 1 drho = rho[nr_rng] - rho[nr_rng_1] @@ -4843,7 +4877,7 @@ def bootstrap_fraction_sauter(plasma_profile: PlasmaProfile) -> float: jboot = ( 0.5 * ( - dcsa( + calculate_l31_coefficient( nr_rng, NR, physics_variables.rmajor, From 6defc39f896538ae33d041608fa4f3e1d8a0eee3 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 12 Sep 2024 10:00:03 +0100 Subject: [PATCH 040/108] Refactor hcsa() into calculate_l31_32_coefficient() and add type hints updated docstrings. Along with better variable names and comments layout --- process/physics.py | 127 ++++++++++++++++++++++++++++----------------- 1 file changed, 80 insertions(+), 47 deletions(-) diff --git a/process/physics.py b/process/physics.py index c96461bf8e..9d733f8698 100644 --- a/process/physics.py +++ b/process/physics.py @@ -617,7 +617,7 @@ def calculate_l31_coefficient( L31 coefficient before Grad(ln(ne)) in the Sauter bootstrap scaling. Parameters: - - radial_elements: int, radial element index in range 2 to nr + - radial_elements: np.ndarray, radial element indexes in range 2 to nr - number_of_elements: int, maximum value of radial_elements - rmajor: float, plasma major radius (m) - bt: float, toroidal field on axis (T) @@ -669,64 +669,97 @@ def calculate_l31_coefficient( @nb.jit(nopython=True, cache=True) -def hcsa(j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps): - """Grad(ln(Te)) coefficient in the Sauter bootstrap scaling - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 2 to nr - nr : input integer : maximum value of j - This function calculates the coefficient scaling grad(ln(Te)) - in the Sauter bootstrap current scaling. - Code by Angioni, 29th May 2002. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - O. Sauter, C. Angioni and Y. R. Lin-Liu, - Physics of Plasmas 6 (1999) 2834 - O. Sauter, C. Angioni and Y. R. Lin-Liu, (ERRATA) - Physics of Plasmas 9 (2002) 5140 +def calculate_l31_32_coefficient( + radial_elements: np.ndarray, + number_of_elements: int, + rmajor: float, + bt: float, + triang: float, + ne: np.ndarray, + ni: np.ndarray, + tempe: np.ndarray, + tempi: np.ndarray, + magnetic_moment: np.ndarray, + rho: np.ndarray, + zeff: np.ndarray, + sqeps: np.ndarray, +) -> float: """ - zz = zef[j - 1] - zft = trapped_particle_fraction(j, triang, sqeps) - _nues = nues(j, rmajor, zef, mu, sqeps, tempe, ne) - _nues_sqrt = np.sqrt(_nues) - zdf = (1.0 + 0.26 * (1.0 - zft) * _nues_sqrt) + ( - 0.18 * (1.0 - 0.37 * zft) * _nues / np.sqrt(zz) - ) - zfte = zft / zdf # $f^{32\_ee}_{teff}(\nu_{e*})$, Eq.15d - zfte2 = zfte * zfte - zfte3 = zfte * zfte2 - zfte4 = zfte2 * zfte2 + L31 & L32 coefficient before Grad(ln(Te)) in the Sauter bootstrap scaling. - zdf = (1.0 + (1.0 + 0.6 * zft) * _nues_sqrt) + ( - 0.85 * (1.0 - 0.37 * zft) * _nues * (1.0 + zz) - ) - zfti = zft / zdf # $f^{32\_ei}_{teff}(\nu_{e*})$, Eq.15e - zfti2 = zfti * zfti - zfti3 = zfti * zfti2 - zfti4 = zfti2 * zfti2 + Parameters: + - radial_elements: np.ndarray, radial element indexes in range 2 to nr + - number_of_elements: int, maximum value of radial_elements + - rmajor: float, plasma major radius (m) + - bt: float, toroidal field on axis (T) + - triang: float, plasma triangularity + - ne: np.ndarray, electron density profile (/m^3) + - ni: np.ndarray, ion density profile (/m^3) + - tempe: np.ndarray, electron temperature profile (keV) + - tempi: np.ndarray, ion temperature profile (keV) + - magnetic_moment: np.ndarray, magnetic moment profile + - rho: np.ndarray, normalized minor radius profile + - zeff: np.ndarray, effective charge profile + - sqeps: np.ndarray, square root of inverse aspect ratio profile + + Returns: + - float, the L31 & L32 coefficient scaling grad(ln(Te)) in the Sauter bootstrap current scaling. + + This function calculates the coefficient scaling grad(ln(Te)) in the Sauter bootstrap current scaling. + + Reference: + - O. Sauter, C. Angioni, Y. R. Lin-Liu; + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. + Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 + - O. Sauter, C. Angioni, Y. R. Lin-Liu; Erratum: + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime + [Phys. Plasmas 6, 2834 (1999)]. Phys. Plasmas 1 December 2002; 9 (12): 5140. https://doi.org/10.1063/1.1517052 + """ + + # Prevents first element being 0 + charge_profile = zeff[radial_elements - 1] + + # Calculate trapped particle fraction + f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) + + # Calculated electron collisionality; nu_e* + electron_collisionality = nues(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + + # $f^{32\_ee}_{teff}(\nu_{e*})$, Eq.15d + f32ee_teff = f_trapped / ((1.0 + 0.26 * (1.0 - f_trapped) * np.sqrt(electron_collisionality) + ( + 0.18 * (1.0 - 0.37 * f_trapped) * electron_collisionality / np.sqrt(charge_profile) + ))) + + # $f^{32\_ei}_{teff}(\nu_{e*})$, Eq.15e + f32ei_teff = f_trapped / ((1.0 + (1.0 + 0.6 * f_trapped) * np.sqrt(electron_collisionality)) + ( + 0.85 * (1.0 - 0.37 * f_trapped) * electron_collisionality * (1.0 + charge_profile) + )) # $F_{32\_ee}(X)$, Eq.15b - hcee = ( - ((0.05 + 0.62 * zz) / zz / (1.0 + 0.44 * zz) * (zfte - zfte4)) - + ((zfte2 - zfte4 - 1.2 * (zfte3 - zfte4)) / (1.0 + 0.22 * zz)) - + (1.2 / (1.0 + 0.5 * zz) * zfte4) + big_f32ee_teff = ( + ((0.05 + 0.62 * charge_profile) / charge_profile / (1.0 + 0.44 * charge_profile) * (f32ee_teff - f32ee_teff**4)) + + ((f32ee_teff**2 - f32ee_teff**4 - 1.2 * (f32ee_teff**3 - f32ee_teff**4)) / (1.0 + 0.22 * charge_profile)) + + (1.2 / (1.0 + 0.5 * charge_profile) * f32ee_teff**4) ) # $F_{32\_ei}(Y)$, Eq.15c - hcei = ( - (-(0.56 + 1.93 * zz) / zz / (1.0 + 0.44 * zz) * (zfti - zfti4)) - + (4.95 / (1.0 + 2.48 * zz) * (zfti2 - zfti4 - 0.55 * (zfti3 - zfti4))) - - (1.2 / (1.0 + 0.5 * zz) * zfti4) + big_f32ei_teff = ( + (-(0.56 + 1.93 * charge_profile) / charge_profile / (1.0 + 0.44 * charge_profile) * (f32ei_teff - f32ei_teff**4)) + + (4.95 / (1.0 + 2.48 * charge_profile) * (f32ei_teff**2 - f32ei_teff**4 - 0.55 * (f32ei_teff**3 - f32ei_teff**4))) + - (1.2 / (1.0 + 0.5 * charge_profile) * f32ei_teff**4) ) + # big_f32ee_teff + big_f32ei_teff = L32 coefficient + # Corrections suggested by Fable, 15/05/2015 - return beta_poloidal_local(j, nr, rmajor, bt, ne, tempe, mu, rho) * ( - hcee + hcei + return beta_poloidal_local(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) * ( + big_f32ee_teff + big_f32ei_teff ) + calculate_l31_coefficient( - j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps + radial_elements, number_of_elements, rmajor, bt, triang, ne, ni, tempe, tempi, magnetic_moment, rho, zeff, sqeps ) * beta_poloidal_local( - j, nr, rmajor, bt, ne, tempe, mu, rho + radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho ) / beta_poloidal_local_total( - j, nr, rmajor, bt, ne, ni, tempe, tempi, mu, rho + radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho ) @@ -4893,7 +4926,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: sqeps, ) * dlogne_drho - + hcsa( + + calculate_l31_32_coefficient( nr_rng, NR, physics_variables.rmajor, From 22ed67dab6467fec2c8e2235df5fe5d01c220351 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 12 Sep 2024 10:47:20 +0100 Subject: [PATCH 041/108] Refactor xcsa() into calculate_l34_alpha_31_coefficient() and add type hints updated docstrings. Along with better variable names and comments layout --- process/physics.py | 133 ++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 55 deletions(-) diff --git a/process/physics.py b/process/physics.py index 9d733f8698..e5259a6cc1 100644 --- a/process/physics.py +++ b/process/physics.py @@ -764,73 +764,96 @@ def calculate_l31_32_coefficient( @nb.jit(nopython=True, cache=True) -def xcsa( - j, - nr, - rmajor, - bt, - triang, - mu, - sqeps, - tempi, - tempe, - amain, - zmain, - ni, - ne, - rho, - zef, -): - """Grad(ln(Ti)) coefficient in the Sauter bootstrap scaling - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 2 to nr - nr : input integer : maximum value of j - This function calculates the coefficient scaling grad(ln(Ti)) - in the Sauter bootstrap current scaling. - Code by Angioni, 29th May 2002. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - O. Sauter, C. Angioni and Y. R. Lin-Liu, - Physics of Plasmas 6 (1999) 2834 - O. Sauter, C. Angioni and Y. R. Lin-Liu, (ERRATA) - Physics of Plasmas 9 (2002) 5140 +def calculate_l34_alpha_31_coefficient( + radial_elements: np.ndarray, + number_of_elements: int, + rmajor: float, + bt: float, + triang: float, + magnetic_moment: np.ndarray, + sqeps: np.ndarray, + tempi: np.ndarray, + tempe: np.ndarray, + amain: float, + zmain: float, + ni: np.ndarray, + ne: np.ndarray, + rho: np.ndarray, + zeff: np.ndarray, +) -> float: """ - zz = zef[j - 1] - zft = trapped_particle_fraction(j, triang, sqeps) - _nues = nues(j, rmajor, zef, mu, sqeps, tempe, ne) - zdf = (1.0 + (1.0 - 0.1 * zft) * np.sqrt(_nues)) + 0.5 * ( - 1.0 - 0.5 * zft - ) * _nues / zz - zfte = zft / zdf # $f^{34}_{teff}(\nu_{e*})$, Eq.16b + L34, alpha and L31 coefficient before Grad(ln(Ti)) in the Sauter bootstrap scaling. + + Parameters: + - radial_elements: np.ndarray, radial element indexes in range 2 to nr + - number_of_elements: int, maximum value of radial_elements + - rmajor: float, plasma major radius (m) + - bt: float, toroidal field on axis (T) + - triang: float, plasma triangularity + - magnetic_moment: np.ndarray, magnetic moment profile + - sqeps: np.ndarray, square root of inverse aspect ratio profile + - tempi: np.ndarray, ion temperature profile (keV) + - tempe: np.ndarray, electron temperature profile (keV) + - amain: float, atomic mass of the main ion + - zmain: float, charge of the main ion + - ni: np.ndarray, ion density profile (/m^3) + - ne: np.ndarray, electron density profile (/m^3) + - rho: np.ndarray, normalized minor radius profile + - zeff: np.ndarray, effective charge profile + + Returns: + - float, the the L34, alpha and L31 coefficient scaling grad(ln(Ti)) in the Sauter bootstrap current scaling. + + This function calculates the coefficient scaling grad(ln(Ti)) in the Sauter bootstrap current scaling. + + Reference: + - O. Sauter, C. Angioni, Y. R. Lin-Liu; + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. + Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 + - O. Sauter, C. Angioni, Y. R. Lin-Liu; Erratum: + Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime + [Phys. Plasmas 6, 2834 (1999)]. Phys. Plasmas 1 December 2002; 9 (12): 5140. https://doi.org/10.1063/1.1517052 + """ + # Prevents first element being 0 + charge_profile = zeff[radial_elements - 1] + + # Calculate trapped particle fraction + f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) + + # Calculated electron collisionality; nu_e* + electron_collisionality = nues(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + + # $f^{34}_{teff}(\nu_{e*})$, Eq.16b + f34_teff = f_trapped / ((1.0 + (1.0 - 0.1 * f_trapped) * np.sqrt(electron_collisionality)) + 0.5 * ( + 1.0 - 0.5 * f_trapped + ) * electron_collisionality / charge_profile) # Eq.16a - xcsa = ((1.0 + 1.4 / (zz + 1.0)) * zfte - 1.9 / (zz + 1.0) * zfte * zfte) + ( - 0.3 * zfte * zfte + 0.2 * zfte * zfte * zfte - ) * zfte / (zz + 1.0) + l34_coefficient = ((1.0 + (1.4 / (charge_profile + 1.0))) * f34_teff) - ((1.9 / (charge_profile + 1.0)) * f34_teff**2) + ((0.3 / (charge_profile + 1.0))*f34_teff**3) + ((0.2 / (charge_profile + 1.0))*f34_teff**4) # $\alpha_0$, Eq.17a - a0 = (-1.17 * (1.0 - zft)) / (1.0 - 0.22 * zft - 0.19 * zft * zft) + alpha_0 = (-1.17 * (1.0 - f_trapped)) / (1.0 - (0.22 * f_trapped) - 0.19 * f_trapped**2) - _nuis = nuis(j, rmajor, mu, sqeps, tempi, amain, zmain, ni) - _nuis_sqrt = np.sqrt(_nuis) - a1 = _nuis**2 * zft**6 + # Calculate the ion collisionality + ion_collisionality = nuis(radial_elements, rmajor, magnetic_moment, sqeps, tempi, amain, zmain, ni) # $\alpha(\nu_{i*})$, Eq.17b - alp = ( - (a0 + 0.25 * (1.0 - zft * zft) * _nuis_sqrt) / (1.0 + 0.5 * _nuis_sqrt) - + 0.315 * a1 - ) / (1.0 + 0.15 * a1) + alpha = ( + ((alpha_0 + (0.25 * (1.0 - f_trapped**2)) * np.sqrt(ion_collisionality)) / (1.0 + (0.5 * np.sqrt(ion_collisionality))) + + (0.315 * ion_collisionality**2 * f_trapped**6) + )) / (1.0 + (0.15 * ion_collisionality**2 * f_trapped**6)) # Corrections suggested by Fable, 15/05/2015 + # Below calculates the L34 * alpha + L31 coefficient return ( - beta_poloidal_local_total(j, nr, rmajor, bt, ne, ni, tempe, tempi, mu, rho) - - beta_poloidal_local(j, nr, rmajor, bt, ne, tempe, mu, rho) - ) * (xcsa * alp) + calculate_l31_coefficient( - j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps + beta_poloidal_local_total(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) + - beta_poloidal_local(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) + ) * (l34_coefficient * alpha) + calculate_l31_coefficient( + radial_elements, number_of_elements, rmajor, bt, triang, ne, ni, tempe, tempi, magnetic_moment, rho, zeff, sqeps ) * ( 1.0 - - beta_poloidal_local(j, nr, rmajor, bt, ne, tempe, mu, rho) - / beta_poloidal_local_total(j, nr, rmajor, bt, ne, ni, tempe, tempi, mu, rho) + - beta_poloidal_local(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) + / beta_poloidal_local_total(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) ) @@ -4942,7 +4965,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: sqeps, ) * dlogte_drho - + xcsa( + + calculate_l34_alpha_31_coefficient( nr_rng, NR, physics_variables.rmajor, From 6c5ab724e153ded5571805f813e5a6b9f522f8ef Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 12 Sep 2024 11:11:30 +0100 Subject: [PATCH 042/108] Re-arrange physics.py to group functions based on use and add block comment dividers --- process/physics.py | 426 +++++++++++++++++++++++---------------------- 1 file changed, 219 insertions(+), 207 deletions(-) diff --git a/process/physics.py b/process/physics.py index e5259a6cc1..91b76b9939 100644 --- a/process/physics.py +++ b/process/physics.py @@ -29,59 +29,9 @@ process_output as po, ) - -@nb.jit(nopython=True, cache=True) -def coulg(j, tempe, ne): - """Coulomb logarithm - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the Coulomb logarithm, valid - for e-e collisions (T_e > 0.01 keV), and for - e-i collisions (T_e > 0.01*Zeff^2) (Alexander, 9/5/1994). -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - C. A. Ordonez and M. I. Molina, Phys. Plasmas 1 (1994) 2515 - Rev. Mod. Phys., V.48, Part 1 (1976) 275 - """ - return 15.9 - 0.5 * np.log(ne[j - 1]) + np.log(tempe[j - 1]) - - -@nb.jit(nopython=True, cache=True) -def nuee(j, tempe, ne): - """Frequency of electron-electron collisions - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the frequency of electron-electron - collisions (Hz): NUEE = 4*SQRT(pi)/3*Ne*e**4*lambd/ - SQRT(Me)/Te**1.5 -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - Yushmanov, 25th April 1987 (?), - updated by Pereverzev, 9th November 1994 (?) - """ - return ( - 670.0 * coulg(j, tempe, ne) * ne[j - 1] / (tempe[j - 1] * np.sqrt(tempe[j - 1])) - ) - - -@nb.jit(nopython=True, cache=True) -def nui(j, zmain, ni, tempi, amain): - """Full frequency of ion collisions - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the full frequency of ion - collisions (Hz). -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - None - """ - # Coulomb logarithm = 15 is used - return ( - zmain[j - 1] ** 4 - * ni[j - 1] - * 322.0 - / (tempi[j - 1] * np.sqrt(tempi[j - 1] * amain[j - 1])) - ) +# ----------------------------------------------------- +# Plasma Current & Poloidal Field Calculations +# ----------------------------------------------------- @nb.jit(nopython=True, cache=True) @@ -248,138 +198,6 @@ def calculate_plasma_current_peng( ) -@nb.jit(nopython=True, cache=True) -def rether(alphan, alphat, dene, dlamie, te, ti, zeffai): - """Routine to find the equilibration power between the - ions and electrons - author: P J Knight, CCFE, Culham Science Centre - alphan : input real : density profile index - alphat : input real : temperature profile index - dene : input real : electron density (/m3) - dlamie : input real : ion-electron coulomb logarithm - te : input real : electron temperature (keV) - ti : input real : ion temperature (keV) - zeffai : input real : mass weighted plasma effective charge - piepv : output real : ion/electron equilibration power (MW/m3) - This routine calculates the equilibration power between the - ions and electrons. - Unknown origin - """ - profie = (1.0 + alphan) ** 2 / ( - (2.0 * alphan - 0.5 * alphat + 1.0) * np.sqrt(1.0 + alphat) - ) - conie = 2.42165e-41 * dlamie * dene**2 * zeffai * profie - - return conie * (ti - te) / (te**1.5) - - -@nb.jit(nopython=True, cache=True) -def vscalc( - csawth, - eps, - facoh, - gamma, - kappa, - rmajor, - rplas, - plascur, - t_fusion_ramp, - tburn, - rli, - rmu0, -): - """Volt-second requirements - author: P J Knight, CCFE, Culham Science Centre - csawth : input real : coefficient for sawteeth effects - eps : input real : inverse aspect ratio - facoh : input real : fraction of plasma current produced inductively - gamma : input real : Ejima coeff for resistive start-up V-s component - kappa : input real : plasma elongation - plascur: input real : plasma current (A) - rli : input real : plasma normalised inductivity - rmajor : input real : plasma major radius (m) - rplas : input real : plasma resistance (ohm) - t_fusion_ramp : input real : heating time (s) - tburn : input real : burn time (s) - phiint : output real : internal plasma volt-seconds (Wb) - rlp : output real : plasma inductance (H) - vsbrn : output real : volt-seconds needed during flat-top (heat+burn) (Wb) - vsind : output real : internal and external plasma inductance V-s (Wb) - vsres : output real : resistive losses in start-up volt-seconds (Wb) - vsstt : output real : total volt-seconds needed (Wb) - This subroutine calculates the volt-second requirements and some - other related items. - """ - # Internal inductance - - rlpint = rmu0 * rmajor * rli / 2.0 - phiint = rlpint * plascur - - # Start-up resistive component - # Uses ITER formula without the 10 V-s add-on - - vsres = gamma * rmu0 * plascur * rmajor - - # Hirshman, Neilson: Physics of Fluids, 29 (1986) p790 - # fit for external inductance - - aeps = (1.0 + 1.81 * np.sqrt(eps) + 2.05 * eps) * np.log(8.0 / eps) - ( - 2.0 + 9.25 * np.sqrt(eps) - 1.21 * eps - ) - beps = ( - 0.73 * np.sqrt(eps) * (1.0 + 2.0 * eps**4 - 6.0 * eps**5 + 3.7 * eps**6) - ) - rlpext = rmajor * rmu0 * aeps * (1.0 - eps) / (1.0 - eps + beps * kappa) - - rlp = rlpext + rlpint - - # Inductive V-s component - - vsind = rlp * plascur - vsstt = vsres + vsind - - # Loop voltage during flat-top - # Include enhancement factor in flattop V-s requirement - # to account for MHD sawtooth effects. - - vburn = plascur * rplas * facoh * csawth - - # N.B. tburn on first iteration will not be correct - # if the pulsed reactor option is used, but the value - # will be correct on subsequent calls. - - vsbrn = vburn * (t_fusion_ramp + tburn) - vsstt = vsstt + vsbrn - - return phiint, rlp, vsbrn, vsind, vsres, vsstt - - -@nb.jit(nopython=True, cache=True) -def culblm(bt, dnbeta, plascur, rminor): - """Beta scaling limit - author: P J Knight, CCFE, Culham Science Centre - bt : input real : toroidal B-field on plasma axis (T) - dnbeta : input real : Troyon-like g coefficient - plascur : input real : plasma current (A) - rminor : input real : plasma minor axis (m) - betalim : output real : beta limit as defined below - This subroutine calculates the beta limit, using - the algorithm documented in AEA FUS 172. - The limit applies to beta defined with respect to the total B-field. - Switch iculbl determines which components of beta to include. - - If iculbl = 0, then the limit is applied to the total beta - If iculbl = 1, then the limit is applied to the thermal beta only - If iculbl = 2, then the limit is applied to the thermal + neutral beam beta components - If iculbl = 3, then the limit is applied to the toroidal beta - - The default value for the g coefficient is dnbeta = 3.5 - AEA FUS 172: Physics Assessment for the European Reactor Study - """ - - return 0.01 * dnbeta * (plascur / 1.0e6) / (rminor * bt) - - @nb.jit(nopython=True, cache=True) def conhas( alphaj: float, @@ -532,6 +350,142 @@ def nevins_integral( return (q / q95) * (al1 * (a1 + (pratio * (a1 + alphai * a2))) + al2 * a2) +@nb.jit(nopython=True, cache=True) +def rether(alphan, alphat, dene, dlamie, te, ti, zeffai): + """Routine to find the equilibration power between the + ions and electrons + author: P J Knight, CCFE, Culham Science Centre + alphan : input real : density profile index + alphat : input real : temperature profile index + dene : input real : electron density (/m3) + dlamie : input real : ion-electron coulomb logarithm + te : input real : electron temperature (keV) + ti : input real : ion temperature (keV) + zeffai : input real : mass weighted plasma effective charge + piepv : output real : ion/electron equilibration power (MW/m3) + This routine calculates the equilibration power between the + ions and electrons. + Unknown origin + """ + profie = (1.0 + alphan) ** 2 / ( + (2.0 * alphan - 0.5 * alphat + 1.0) * np.sqrt(1.0 + alphat) + ) + conie = 2.42165e-41 * dlamie * dene**2 * zeffai * profie + + return conie * (ti - te) / (te**1.5) + + +@nb.jit(nopython=True, cache=True) +def vscalc( + csawth, + eps, + facoh, + gamma, + kappa, + rmajor, + rplas, + plascur, + t_fusion_ramp, + tburn, + rli, + rmu0, +): + """Volt-second requirements + author: P J Knight, CCFE, Culham Science Centre + csawth : input real : coefficient for sawteeth effects + eps : input real : inverse aspect ratio + facoh : input real : fraction of plasma current produced inductively + gamma : input real : Ejima coeff for resistive start-up V-s component + kappa : input real : plasma elongation + plascur: input real : plasma current (A) + rli : input real : plasma normalised inductivity + rmajor : input real : plasma major radius (m) + rplas : input real : plasma resistance (ohm) + t_fusion_ramp : input real : heating time (s) + tburn : input real : burn time (s) + phiint : output real : internal plasma volt-seconds (Wb) + rlp : output real : plasma inductance (H) + vsbrn : output real : volt-seconds needed during flat-top (heat+burn) (Wb) + vsind : output real : internal and external plasma inductance V-s (Wb) + vsres : output real : resistive losses in start-up volt-seconds (Wb) + vsstt : output real : total volt-seconds needed (Wb) + This subroutine calculates the volt-second requirements and some + other related items. + """ + # Internal inductance + + rlpint = rmu0 * rmajor * rli / 2.0 + phiint = rlpint * plascur + + # Start-up resistive component + # Uses ITER formula without the 10 V-s add-on + + vsres = gamma * rmu0 * plascur * rmajor + + # Hirshman, Neilson: Physics of Fluids, 29 (1986) p790 + # fit for external inductance + + aeps = (1.0 + 1.81 * np.sqrt(eps) + 2.05 * eps) * np.log(8.0 / eps) - ( + 2.0 + 9.25 * np.sqrt(eps) - 1.21 * eps + ) + beps = ( + 0.73 * np.sqrt(eps) * (1.0 + 2.0 * eps**4 - 6.0 * eps**5 + 3.7 * eps**6) + ) + rlpext = rmajor * rmu0 * aeps * (1.0 - eps) / (1.0 - eps + beps * kappa) + + rlp = rlpext + rlpint + + # Inductive V-s component + + vsind = rlp * plascur + vsstt = vsres + vsind + + # Loop voltage during flat-top + # Include enhancement factor in flattop V-s requirement + # to account for MHD sawtooth effects. + + vburn = plascur * rplas * facoh * csawth + + # N.B. tburn on first iteration will not be correct + # if the pulsed reactor option is used, but the value + # will be correct on subsequent calls. + + vsbrn = vburn * (t_fusion_ramp + tburn) + vsstt = vsstt + vsbrn + + return phiint, rlp, vsbrn, vsind, vsres, vsstt + + +@nb.jit(nopython=True, cache=True) +def culblm(bt, dnbeta, plascur, rminor): + """Beta scaling limit + author: P J Knight, CCFE, Culham Science Centre + bt : input real : toroidal B-field on plasma axis (T) + dnbeta : input real : Troyon-like g coefficient + plascur : input real : plasma current (A) + rminor : input real : plasma minor axis (m) + betalim : output real : beta limit as defined below + This subroutine calculates the beta limit, using + the algorithm documented in AEA FUS 172. + The limit applies to beta defined with respect to the total B-field. + Switch iculbl determines which components of beta to include. + + If iculbl = 0, then the limit is applied to the total beta + If iculbl = 1, then the limit is applied to the thermal beta only + If iculbl = 2, then the limit is applied to the thermal + neutral beam beta components + If iculbl = 3, then the limit is applied to the toroidal beta + + The default value for the g coefficient is dnbeta = 3.5 + AEA FUS 172: Physics Assessment for the European Reactor Study + """ + + return 0.01 * dnbeta * (plascur / 1.0e6) / (rminor * bt) + +# ----------------------------------------------------- +# Diamagnetic and Pfirsch-Schlüter Current Calculations +# ----------------------------------------------------- + + def diamagnetic_fraction_hender(beta: float) -> float: """ Calculate the diamagnetic fraction based on the Hender fit. @@ -572,6 +526,86 @@ def ps_fraction_scene(beta: float) -> float: """ return -9e-2 * beta +# -------------------------------------------------- +# Sauter Bootstrap Current Scaling Functions +# -------------------------------------------------- + + +@nb.jit(nopython=True, cache=True) +def coulg(j, tempe, ne): + """Coulomb logarithm + author: P J Knight, CCFE, Culham Science Centre + j : input integer : radial element index in range 1 to nr + This function calculates the Coulomb logarithm, valid + for e-e collisions (T_e > 0.01 keV), and for + e-i collisions (T_e > 0.01*Zeff^2) (Alexander, 9/5/1994). +

    The code was supplied by Emiliano Fable, IPP Garching + (private communication). + C. A. Ordonez and M. I. Molina, Phys. Plasmas 1 (1994) 2515 + Rev. Mod. Phys., V.48, Part 1 (1976) 275 + """ + return 15.9 - 0.5 * np.log(ne[j - 1]) + np.log(tempe[j - 1]) + + +@nb.jit(nopython=True, cache=True) +def nuee(j, tempe, ne): + """Frequency of electron-electron collisions + author: P J Knight, CCFE, Culham Science Centre + j : input integer : radial element index in range 1 to nr + This function calculates the frequency of electron-electron + collisions (Hz): NUEE = 4*SQRT(pi)/3*Ne*e**4*lambd/ + SQRT(Me)/Te**1.5 +

    The code was supplied by Emiliano Fable, IPP Garching + (private communication). + Yushmanov, 25th April 1987 (?), + updated by Pereverzev, 9th November 1994 (?) + """ + return ( + 670.0 * coulg(j, tempe, ne) * ne[j - 1] / (tempe[j - 1] * np.sqrt(tempe[j - 1])) + ) + + +@nb.jit(nopython=True, cache=True) +def nues(j, rmajor, zef, mu, sqeps, tempe, ne): + """Relative frequency of electron collisions + author: P J Knight, CCFE, Culham Science Centre + j : input integer : radial element index in range 1 to nr + This function calculates the relative frequency of electron + collisions: NU* = Nuei*q*Rt/eps**1.5/Vte + The electron-ion collision frequency NUEI=NUEE*1.4*ZEF is + used. +

    The code was supplied by Emiliano Fable, IPP Garching + (private communication). + Yushmanov, 30th April 1987 (?) + """ + return ( + nuee(j, tempe, ne) + * 1.4 + * zef[j - 1] + * rmajor + / np.abs(mu[j - 1] * (sqeps[j - 1] ** 3) * np.sqrt(tempe[j - 1]) * 1.875e7) + ) + + +@nb.jit(nopython=True, cache=True) +def nui(j, zmain, ni, tempi, amain): + """Full frequency of ion collisions + author: P J Knight, CCFE, Culham Science Centre + j : input integer : radial element index in range 1 to nr + This function calculates the full frequency of ion + collisions (Hz). +

    The code was supplied by Emiliano Fable, IPP Garching + (private communication). + None + """ + # Coulomb logarithm = 15 is used + return ( + zmain[j - 1] ** 4 + * ni[j - 1] + * 322.0 + / (tempi[j - 1] * np.sqrt(tempi[j - 1] * amain[j - 1])) + ) + @nb.jit(nopython=True, cache=True) def nuis(j, rmajor, mu, sqeps, tempi, amain, zmain, ni): @@ -857,28 +891,6 @@ def calculate_l34_alpha_31_coefficient( ) -@nb.jit(nopython=True, cache=True) -def nues(j, rmajor, zef, mu, sqeps, tempe, ne): - """Relative frequency of electron collisions - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the relative frequency of electron - collisions: NU* = Nuei*q*Rt/eps**1.5/Vte - The electron-ion collision frequency NUEI=NUEE*1.4*ZEF is - used. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - Yushmanov, 30th April 1987 (?) - """ - return ( - nuee(j, tempe, ne) - * 1.4 - * zef[j - 1] - * rmajor - / np.abs(mu[j - 1] * (sqeps[j - 1] ** 3) * np.sqrt(tempe[j - 1]) * 1.875e7) - ) - - @nb.jit(nopython=True, cache=True) def beta_poloidal_local(j, nr, rmajor, bt, ne, tempe, mu, rho): """Local beta poloidal calculation From 7f1acc4bd240a5b4e9ae0081bdd39e488af2850f Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 12 Sep 2024 14:16:59 +0100 Subject: [PATCH 043/108] Refactor coulg() into coulomb_logarithm_sauter() function and update its docstring --- process/physics.py | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/process/physics.py b/process/physics.py index 91b76b9939..b1963b685d 100644 --- a/process/physics.py +++ b/process/physics.py @@ -532,19 +532,29 @@ def ps_fraction_scene(beta: float) -> float: @nb.jit(nopython=True, cache=True) -def coulg(j, tempe, ne): - """Coulomb logarithm - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the Coulomb logarithm, valid - for e-e collisions (T_e > 0.01 keV), and for - e-i collisions (T_e > 0.01*Zeff^2) (Alexander, 9/5/1994). -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - C. A. Ordonez and M. I. Molina, Phys. Plasmas 1 (1994) 2515 - Rev. Mod. Phys., V.48, Part 1 (1976) 275 +def coulomb_logarithm_sauter(radial_elements: int, tempe: np.ndarray, ne: np.ndarray) -> np.ndarray: + """ + Calculate the Coulomb logarithm used in the arrays for the Sauter bootstrap current scaling. + + Parameters: + - radial_elements: np.ndarray, the radial element indexes in the range 1 to nr + - tempe: np.ndarray, the electron temperature array + - ne: np.ndarray, the electron density array + + Returns: + - np.ndarray, the Coulomb logarithm at each array point + + This function calculates the Coulomb logarithm, which is valid for e-e collisions (T_e > 0.01 keV) + and for e-i collisions (T_e > 0.01*Zeff^2) (Alexander, 9/5/1994). + + Reference: + - C. A. Ordonez, M. I. Molina; + Evaluation of the Coulomb logarithm using cutoff and screened Coulomb interaction potentials. + Phys. Plasmas 1 August 1994; 1 (8): 2515–2518. https://doi.org/10.1063/1.870578 + - Y. R. Shen, “Recent advances in nonlinear optics,” Reviews of Modern Physics, vol. 48, no. 1, + pp. 1–32, Jan. 1976, doi: https://doi.org/10.1103/revmodphys.48.1. """ - return 15.9 - 0.5 * np.log(ne[j - 1]) + np.log(tempe[j - 1]) + return 15.9 - 0.5 * np.log(ne[radial_elements - 1]) + np.log(tempe[radial_elements - 1]) @nb.jit(nopython=True, cache=True) @@ -561,7 +571,7 @@ def nuee(j, tempe, ne): updated by Pereverzev, 9th November 1994 (?) """ return ( - 670.0 * coulg(j, tempe, ne) * ne[j - 1] / (tempe[j - 1] * np.sqrt(tempe[j - 1])) + 670.0 * coulomb_logarithm_sauter(j, tempe, ne) * ne[j - 1] / (tempe[j - 1] * np.sqrt(tempe[j - 1])) ) From c08d0aae4c6d1a7b1ab621d65b9542a0b6d341e8 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 12 Sep 2024 14:50:50 +0100 Subject: [PATCH 044/108] Refactor nuee() into electron_collisions_sauter() function and update its docstring --- process/physics.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/process/physics.py b/process/physics.py index b1963b685d..38d68a53f8 100644 --- a/process/physics.py +++ b/process/physics.py @@ -558,21 +558,24 @@ def coulomb_logarithm_sauter(radial_elements: int, tempe: np.ndarray, ne: np.nda @nb.jit(nopython=True, cache=True) -def nuee(j, tempe, ne): - """Frequency of electron-electron collisions - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the frequency of electron-electron - collisions (Hz): NUEE = 4*SQRT(pi)/3*Ne*e**4*lambd/ - SQRT(Me)/Te**1.5 -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - Yushmanov, 25th April 1987 (?), - updated by Pereverzev, 9th November 1994 (?) +def electron_collisions_sauter(radial_elements: np.ndarray, tempe: np.ndarray, ne: np.ndarray) -> np.ndarray: """ - return ( - 670.0 * coulomb_logarithm_sauter(j, tempe, ne) * ne[j - 1] / (tempe[j - 1] * np.sqrt(tempe[j - 1])) - ) + Calculate the frequency of electron-electron collisions. + + Parameters: + - radial_elements: np.ndarray, the radial element index in the range 1 to nr + - tempe: np.ndarray, the electron temperature array + - ne: np.ndarray, the electron density array + + Returns: + - float, the frequency of electron-electron collisions (Hz) + + This function calculates the frequency of electron-electron collisions + + Reference: + - Yushmanov, 25th April 1987 (?), updated by Pereverzev, 9th November 1994 (?) + """ + return 670.0 * coulomb_logarithm_sauter(radial_elements, tempe, ne) * ne[radial_elements - 1] / (tempe[radial_elements - 1] * np.sqrt(tempe[radial_elements - 1])) @nb.jit(nopython=True, cache=True) @@ -589,7 +592,7 @@ def nues(j, rmajor, zef, mu, sqeps, tempe, ne): Yushmanov, 30th April 1987 (?) """ return ( - nuee(j, tempe, ne) + electron_collisions_sauter(j, tempe, ne) * 1.4 * zef[j - 1] * rmajor @@ -4932,6 +4935,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: physics_variables.q0 + (physics_variables.q - physics_variables.q0) * roa**2 ) + print(mu) amain = np.full_like(mu, physics_variables.afuel) zmain = np.full_like(mu, 1.0 + physics_variables.fhe3) From d6ce90a1ef4d2368b92dd85d5e5d7a6107bd9ca4 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 12 Sep 2024 15:03:13 +0100 Subject: [PATCH 045/108] Refactor nuess() into electron_collisionality_sauter() and add expanded docstring and type hints --- process/physics.py | 51 ++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/process/physics.py b/process/physics.py index 38d68a53f8..39c157ae38 100644 --- a/process/physics.py +++ b/process/physics.py @@ -560,7 +560,7 @@ def coulomb_logarithm_sauter(radial_elements: int, tempe: np.ndarray, ne: np.nda @nb.jit(nopython=True, cache=True) def electron_collisions_sauter(radial_elements: np.ndarray, tempe: np.ndarray, ne: np.ndarray) -> np.ndarray: """ - Calculate the frequency of electron-electron collisions. + Calculate the frequency of electron-electron collisions used in the arrays for the Sauter bootstrap current scaling. Parameters: - radial_elements: np.ndarray, the radial element index in the range 1 to nr @@ -579,24 +579,39 @@ def electron_collisions_sauter(radial_elements: np.ndarray, tempe: np.ndarray, n @nb.jit(nopython=True, cache=True) -def nues(j, rmajor, zef, mu, sqeps, tempe, ne): - """Relative frequency of electron collisions - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the relative frequency of electron - collisions: NU* = Nuei*q*Rt/eps**1.5/Vte - The electron-ion collision frequency NUEI=NUEE*1.4*ZEF is - used. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - Yushmanov, 30th April 1987 (?) +def electron_collisionality_sauter( + radial_elements: np.ndarray, + rmajor: float, + zeff: np.ndarray, + magnetic_moment: np.ndarray, + sqeps: np.ndarray, + tempe: np.ndarray, + ne: np.ndarray, +) -> np.ndarray: + """ + Calculate the electron collisionality used in the arrays for the Sauter bootstrap current scaling. + + Parameters: + - radial_elements: np.ndarray, the radial element index in the range 1 to nr + - rmajor: float, the plasma major radius (m) + - zeff: np.ndarray, the effective charge array + - mu: np.ndarray, the magnetic moment array + - sqeps: np.ndarray, the square root of the inverse aspect ratio array + - tempe: np.ndarray, the electron temperature array + - ne: np.ndarray, the electron density array + + Returns: + - float, the relative frequency of electron collisions + + Reference: + - Yushmanov, 30th April 1987 (?) """ return ( - electron_collisions_sauter(j, tempe, ne) + electron_collisions_sauter(radial_elements, tempe, ne) * 1.4 - * zef[j - 1] + * zeff[radial_elements - 1] * rmajor - / np.abs(mu[j - 1] * (sqeps[j - 1] ** 3) * np.sqrt(tempe[j - 1]) * 1.875e7) + / np.abs(magnetic_moment[radial_elements - 1] * (sqeps[radial_elements - 1] ** 3) * np.sqrt(tempe[radial_elements - 1]) * 1.875e7) ) @@ -698,7 +713,7 @@ def calculate_l31_coefficient( f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) # Calculated electron collisionality; nu_e* - electron_collisionality = nues(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + electron_collisionality = electron_collisionality_sauter(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) # $f^{31}_{teff}(\nu_{e*})$, Eq.14b f31_teff = f_trapped / ((1.0 + (1.0 - 0.1 * f_trapped) * np.sqrt(electron_collisionality)) + (0.5 * (1.0 - f_trapped) * electron_collisionality) / charge_profile) @@ -770,7 +785,7 @@ def calculate_l31_32_coefficient( f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) # Calculated electron collisionality; nu_e* - electron_collisionality = nues(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + electron_collisionality = electron_collisionality_sauter(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) # $f^{32\_ee}_{teff}(\nu_{e*})$, Eq.15d f32ee_teff = f_trapped / ((1.0 + 0.26 * (1.0 - f_trapped) * np.sqrt(electron_collisionality) + ( @@ -868,7 +883,7 @@ def calculate_l34_alpha_31_coefficient( f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) # Calculated electron collisionality; nu_e* - electron_collisionality = nues(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + electron_collisionality = electron_collisionality_sauter(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) # $f^{34}_{teff}(\nu_{e*})$, Eq.16b f34_teff = f_trapped / ((1.0 + (1.0 - 0.1 * f_trapped) * np.sqrt(electron_collisionality)) + 0.5 * ( From 11f7454656fb1a60abea798b8e1a70b793e152b1 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 12 Sep 2024 15:16:50 +0100 Subject: [PATCH 046/108] Refactor nui() into ion_collisions_sauter() function and update its docstring --- process/physics.py | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/process/physics.py b/process/physics.py index 39c157ae38..1fd2cbc45a 100644 --- a/process/physics.py +++ b/process/physics.py @@ -601,7 +601,7 @@ def electron_collisionality_sauter( - ne: np.ndarray, the electron density array Returns: - - float, the relative frequency of electron collisions + - np.ndarray, the relative frequency of electron collisions Reference: - Yushmanov, 30th April 1987 (?) @@ -616,22 +616,30 @@ def electron_collisionality_sauter( @nb.jit(nopython=True, cache=True) -def nui(j, zmain, ni, tempi, amain): - """Full frequency of ion collisions - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the full frequency of ion - collisions (Hz). -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - None +def ion_collisions_sauter(radial_elements: np.ndarray, zeff: np.ndarray, ni: np.ndarray, tempi: np.ndarray, amain: np.ndarray) -> np.ndarray: + """ + Calculate the full frequency of ion collisions used in the arrays for the Sauter bootstrap current scaling. + + Parameters: + - radial_elements: np.ndarray, the radial element indexes in the range 1 to nr + - zeff: np.ndarray, the effective charge array + - ni: np.ndarray, the ion density array + - tempi: np.ndarray, the ion temperature array + - amain: np.ndarray, the atomic mass of the main ion species array + + Returns: + - np.ndarray, the full frequency of ion collisions (Hz) + + This function calculates the full frequency of ion collisions using the Coulomb logarithm of 15. + + Reference: + - None """ - # Coulomb logarithm = 15 is used return ( - zmain[j - 1] ** 4 - * ni[j - 1] + zeff[radial_elements - 1] ** 4 + * ni[radial_elements - 1] * 322.0 - / (tempi[j - 1] * np.sqrt(tempi[j - 1] * amain[j - 1])) + / (tempi[radial_elements - 1] * np.sqrt(tempi[radial_elements - 1] * amain[radial_elements - 1])) ) @@ -649,7 +657,7 @@ def nuis(j, rmajor, mu, sqeps, tempi, amain, zmain, ni): """ return ( 3.2e-6 - * nui(j, zmain, ni, tempi, amain) + * ion_collisions_sauter(j, zmain, ni, tempi, amain) * rmajor / ( np.abs(mu[j - 1] + 1.0e-4) @@ -4950,7 +4958,6 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: physics_variables.q0 + (physics_variables.q - physics_variables.q0) * roa**2 ) - print(mu) amain = np.full_like(mu, physics_variables.afuel) zmain = np.full_like(mu, 1.0 + physics_variables.fhe3) From fec2f50b8de7ce42478d2abbe483e18eff7936a3 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 11:43:13 +0100 Subject: [PATCH 047/108] Refactor nuis() into ion_collisionality_sauter() function and update its docstring --- process/physics.py | 48 +++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/process/physics.py b/process/physics.py index 1fd2cbc45a..60b0b97d29 100644 --- a/process/physics.py +++ b/process/physics.py @@ -644,25 +644,43 @@ def ion_collisions_sauter(radial_elements: np.ndarray, zeff: np.ndarray, ni: np. @nb.jit(nopython=True, cache=True) -def nuis(j, rmajor, mu, sqeps, tempi, amain, zmain, ni): - """Relative frequency of ion collisions - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - This function calculates the relative frequency of ion - collisions: NU* = Nui*q*Rt/eps**1.5/Vti - The full ion collision frequency NUI is used. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). - Yushmanov, 30th April 1987 (?) +def ion_collisionality_sauter( + radial_elements: np.ndarray, + rmajor: float, + magnetic_moment: np.ndarray, + sqeps: np.ndarray, + tempi: np.ndarray, + amain: np.ndarray, + zeff: np.ndarray, + ni: np.ndarray, +) -> float: + """ + Calculate the ion collisionality to be used in the Sauter bootstrap current scaling. + + Parameters: + - radial_elements: np.ndarray, the radial element indexes in the range 1 to nr + - rmajor: float, the plasma major radius (m) + - magnetic_moment: np.ndarray, the magnetic moment profile + - sqeps: np.ndarray, the square root of the inverse aspect ratio profile + - tempi: np.ndarray, the ion temperature profile (keV) + - amain: np.ndarray, the atomic mass of the main ion species profile + - zeff: np.ndarray, the effective charge of the main ion species + - ni: np.ndarray, the ion density profile (/m^3) + + Returns: + - float, the ion collisionality + + Reference: + - None """ return ( 3.2e-6 - * ion_collisions_sauter(j, zmain, ni, tempi, amain) + * ion_collisions_sauter(radial_elements, zeff, ni, tempi, amain) * rmajor / ( - np.abs(mu[j - 1] + 1.0e-4) - * sqeps[j - 1] ** 3 - * np.sqrt(tempi[j - 1] / amain[j - 1]) + np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4) + * sqeps[radial_elements - 1] ** 3 + * np.sqrt(tempi[radial_elements - 1] / amain[radial_elements - 1]) ) ) @@ -905,7 +923,7 @@ def calculate_l34_alpha_31_coefficient( alpha_0 = (-1.17 * (1.0 - f_trapped)) / (1.0 - (0.22 * f_trapped) - 0.19 * f_trapped**2) # Calculate the ion collisionality - ion_collisionality = nuis(radial_elements, rmajor, magnetic_moment, sqeps, tempi, amain, zmain, ni) + ion_collisionality = ion_collisionality_sauter(radial_elements, rmajor, magnetic_moment, sqeps, tempi, amain, zmain, ni) # $\alpha(\nu_{i*})$, Eq.17b alpha = ( From 38a0b307086932a387736e66848e24c674dcea5e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 11:54:09 +0100 Subject: [PATCH 048/108] Refactor beta_poloidal_local to beta_poloidal_sauter for Sauter bootstrap current scaling and update docstring and add type hints --- process/physics.py | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/process/physics.py b/process/physics.py index 60b0b97d29..cfaeb4aa7f 100644 --- a/process/physics.py +++ b/process/physics.py @@ -840,11 +840,11 @@ def calculate_l31_32_coefficient( # big_f32ee_teff + big_f32ei_teff = L32 coefficient # Corrections suggested by Fable, 15/05/2015 - return beta_poloidal_local(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) * ( + return beta_poloidal_sauter(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) * ( big_f32ee_teff + big_f32ei_teff ) + calculate_l31_coefficient( radial_elements, number_of_elements, rmajor, bt, triang, ne, ni, tempe, tempi, magnetic_moment, rho, zeff, sqeps - ) * beta_poloidal_local( + ) * beta_poloidal_sauter( radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho ) / beta_poloidal_local_total( radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho @@ -935,35 +935,44 @@ def calculate_l34_alpha_31_coefficient( # Below calculates the L34 * alpha + L31 coefficient return ( beta_poloidal_local_total(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) - - beta_poloidal_local(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) + - beta_poloidal_sauter(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) ) * (l34_coefficient * alpha) + calculate_l31_coefficient( radial_elements, number_of_elements, rmajor, bt, triang, ne, ni, tempe, tempi, magnetic_moment, rho, zeff, sqeps ) * ( 1.0 - - beta_poloidal_local(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) + - beta_poloidal_sauter(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) / beta_poloidal_local_total(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) ) @nb.jit(nopython=True, cache=True) -def beta_poloidal_local(j, nr, rmajor, bt, ne, tempe, mu, rho): - """Local beta poloidal calculation - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - nr : input integer : maximum value of j - This function calculates the local beta poloidal. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). -

    beta poloidal = 4*pi*ne*Te/Bpo**2 - Pereverzev, 25th April 1989 (?) +def beta_poloidal_sauter(radial_elements: np.ndarray, nr: int, rmajor: float, bt: float, ne: np.ndarray, tempe: np.ndarray, magnetic_moment: np.ndarray, rho: np.ndarray) -> np.ndarray: + """ + Calculate the local beta poloidal using only electron profiles for the Sauter bootstrap current scaling. + + Parameters: + - radial_elements: np.ndarray, radial element indexes in range 1 to nr + - nr: int, maximum value of radial_elements + - rmajor: float, plasma major radius (m) + - bt: float, toroidal field on axis (T) + - ne: np.ndarray, electron density profile (/m^3) + - tempe: np.ndarray, electron temperature profile (keV) + - magnetic_moment: np.ndarray, magnetic moment profile + - rho: np.ndarray, normalized minor radius profile + + Returns: + - np.ndarray, the local beta poloidal + + Reference: + - None """ return ( np.where( - j != nr, - 1.6e-4 * np.pi * (ne[j] + ne[j - 1]) * (tempe[j] + tempe[j - 1]), - 6.4e-4 * np.pi * ne[j - 1] * tempe[j - 1], + radial_elements != nr, + 1.6e-4 * np.pi * (ne[radial_elements] + ne[radial_elements - 1]) * (tempe[radial_elements] + tempe[radial_elements - 1]), + 6.4e-4 * np.pi * ne[radial_elements - 1] * tempe[radial_elements - 1], ) - * (rmajor / (bt * rho[j - 1] * np.abs(mu[j - 1] + 1.0e-4))) ** 2 + * (rmajor / (bt * rho[radial_elements - 1] * np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4))) ** 2 ) From 65612bb77e252ad0d3f4e776de5846320c96c644 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 12:00:04 +0100 Subject: [PATCH 049/108] Refactor beta_poloidal_local_total() to beta_poloidal_total_sauter() and update docstring and add type hints --- process/physics.py | 50 +++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/process/physics.py b/process/physics.py index cfaeb4aa7f..a3ff42d746 100644 --- a/process/physics.py +++ b/process/physics.py @@ -751,7 +751,7 @@ def calculate_l31_coefficient( ) # Corrections suggested by Fable, 15/05/2015 - return l31_coefficient * beta_poloidal_local_total( + return l31_coefficient * beta_poloidal_total_sauter( radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho ) @@ -846,7 +846,7 @@ def calculate_l31_32_coefficient( radial_elements, number_of_elements, rmajor, bt, triang, ne, ni, tempe, tempi, magnetic_moment, rho, zeff, sqeps ) * beta_poloidal_sauter( radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho - ) / beta_poloidal_local_total( + ) / beta_poloidal_total_sauter( radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho ) @@ -934,14 +934,14 @@ def calculate_l34_alpha_31_coefficient( # Corrections suggested by Fable, 15/05/2015 # Below calculates the L34 * alpha + L31 coefficient return ( - beta_poloidal_local_total(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) + beta_poloidal_total_sauter(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) - beta_poloidal_sauter(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) ) * (l34_coefficient * alpha) + calculate_l31_coefficient( radial_elements, number_of_elements, rmajor, bt, triang, ne, ni, tempe, tempi, magnetic_moment, rho, zeff, sqeps ) * ( 1.0 - beta_poloidal_sauter(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) - / beta_poloidal_local_total(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) + / beta_poloidal_total_sauter(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) ) @@ -977,32 +977,40 @@ def beta_poloidal_sauter(radial_elements: np.ndarray, nr: int, rmajor: float, bt @nb.jit(nopython=True, cache=True) -def beta_poloidal_local_total(j, nr, rmajor, bt, ne, ni, tempe, tempi, mu, rho): - """Local beta poloidal calculation, including ion pressure - author: P J Knight, CCFE, Culham Science Centre - j : input integer : radial element index in range 1 to nr - nr : input integer : maximum value of j - This function calculates the local total beta poloidal. -

    The code was supplied by Emiliano Fable, IPP Garching - (private communication). -

    beta poloidal = 4*pi*(ne*Te+ni*Ti)/Bpo**2 - where ni is the sum of all ion densities (thermal) - Pereverzev, 25th April 1989 (?) - E Fable, private communication, 15th May 2014 +def beta_poloidal_total_sauter(radial_elements: np.ndarray, nr: int, rmajor: float, bt: float, ne: np.ndarray, ni: np.ndarray, tempe: np.ndarray, tempi: np.ndarray, magnetic_moment: np.ndarray, rho: np.ndarray) -> np.ndarray: """ + Calculate the local beta poloidal including ion pressure for the Sauter bootstrap current scaling. + Parameters: + - radial_elements: np.ndarray, radial element indexes in range 1 to nr + - nr: int, maximum value of j + - rmajor: float, plasma major radius (m) + - bt: float, toroidal field on axis (T) + - ne: np.ndarray, electron density profile (/m^3) + - ni: np.ndarray, ion density profile (/m^3) + - tempe: np.ndarray, electron temperature profile (keV) + - tempi: np.ndarray, ion temperature profile (keV) + - magnetic_moment: np.ndarray, magnetic moment profile + - rho: np.ndarray, normalized minor radius profile + + Returns: + - np.ndarray, the local total beta poloidal + + Reference: + - None + """ return ( np.where( - j != nr, + radial_elements != nr, 1.6e-4 * np.pi * ( - ((ne[j] + ne[j - 1]) * (tempe[j] + tempe[j - 1])) - + ((ni[j] + ni[j - 1]) * (tempi[j] + tempi[j - 1])) + ((ne[radial_elements] + ne[radial_elements - 1]) * (tempe[radial_elements] + tempe[radial_elements - 1])) + + ((ni[radial_elements] + ni[radial_elements - 1]) * (tempi[radial_elements] + tempi[radial_elements - 1])) ), - 6.4e-4 * np.pi * (ne[j - 1] * tempe[j - 1] + ni[j - 1] * tempi[j - 1]), + 6.4e-4 * np.pi * (ne[radial_elements - 1] * tempe[radial_elements - 1] + ni[radial_elements - 1] * tempi[radial_elements - 1]), ) - * (rmajor / (bt * rho[j - 1] * np.abs(mu[j - 1] + 1.0e-4))) ** 2 + * (rmajor / (bt * rho[radial_elements - 1] * np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4))) ** 2 ) From 265997e8dec30a3249dc5d61eace065606f35618 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 12:00:49 +0100 Subject: [PATCH 050/108] Format black --- process/physics.py | 337 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 284 insertions(+), 53 deletions(-) diff --git a/process/physics.py b/process/physics.py index a3ff42d746..765d43523e 100644 --- a/process/physics.py +++ b/process/physics.py @@ -338,7 +338,7 @@ def nevins_integral( ) a1 = (alphan + alphat) * (1.0 - y) ** (alphan + alphat - 1.0) a2 = alphat * (1.0 - y) ** (alphan + alphat - 1.0) - al1 = (x/d) * (0.754 + 2.21 * z + z**2 + x * (0.348 + 1.243 * z + z**2)) + al1 = (x / d) * (0.754 + 2.21 * z + z**2 + x * (0.348 + 1.243 * z + z**2)) al2 = -x * ((0.884 + 2.074 * z) / d) alphai = -1.172 / (1.0 + 0.462 * x) @@ -481,6 +481,7 @@ def culblm(bt, dnbeta, plascur, rminor): return 0.01 * dnbeta * (plascur / 1.0e6) / (rminor * bt) + # ----------------------------------------------------- # Diamagnetic and Pfirsch-Schlüter Current Calculations # ----------------------------------------------------- @@ -526,13 +527,16 @@ def ps_fraction_scene(beta: float) -> float: """ return -9e-2 * beta + # -------------------------------------------------- # Sauter Bootstrap Current Scaling Functions # -------------------------------------------------- @nb.jit(nopython=True, cache=True) -def coulomb_logarithm_sauter(radial_elements: int, tempe: np.ndarray, ne: np.ndarray) -> np.ndarray: +def coulomb_logarithm_sauter( + radial_elements: int, tempe: np.ndarray, ne: np.ndarray +) -> np.ndarray: """ Calculate the Coulomb logarithm used in the arrays for the Sauter bootstrap current scaling. @@ -554,11 +558,17 @@ def coulomb_logarithm_sauter(radial_elements: int, tempe: np.ndarray, ne: np.nda - Y. R. Shen, “Recent advances in nonlinear optics,” Reviews of Modern Physics, vol. 48, no. 1, pp. 1–32, Jan. 1976, doi: https://doi.org/10.1103/revmodphys.48.1. """ - return 15.9 - 0.5 * np.log(ne[radial_elements - 1]) + np.log(tempe[radial_elements - 1]) + return ( + 15.9 + - 0.5 * np.log(ne[radial_elements - 1]) + + np.log(tempe[radial_elements - 1]) + ) @nb.jit(nopython=True, cache=True) -def electron_collisions_sauter(radial_elements: np.ndarray, tempe: np.ndarray, ne: np.ndarray) -> np.ndarray: +def electron_collisions_sauter( + radial_elements: np.ndarray, tempe: np.ndarray, ne: np.ndarray +) -> np.ndarray: """ Calculate the frequency of electron-electron collisions used in the arrays for the Sauter bootstrap current scaling. @@ -575,7 +585,12 @@ def electron_collisions_sauter(radial_elements: np.ndarray, tempe: np.ndarray, n Reference: - Yushmanov, 25th April 1987 (?), updated by Pereverzev, 9th November 1994 (?) """ - return 670.0 * coulomb_logarithm_sauter(radial_elements, tempe, ne) * ne[radial_elements - 1] / (tempe[radial_elements - 1] * np.sqrt(tempe[radial_elements - 1])) + return ( + 670.0 + * coulomb_logarithm_sauter(radial_elements, tempe, ne) + * ne[radial_elements - 1] + / (tempe[radial_elements - 1] * np.sqrt(tempe[radial_elements - 1])) + ) @nb.jit(nopython=True, cache=True) @@ -611,12 +626,23 @@ def electron_collisionality_sauter( * 1.4 * zeff[radial_elements - 1] * rmajor - / np.abs(magnetic_moment[radial_elements - 1] * (sqeps[radial_elements - 1] ** 3) * np.sqrt(tempe[radial_elements - 1]) * 1.875e7) + / np.abs( + magnetic_moment[radial_elements - 1] + * (sqeps[radial_elements - 1] ** 3) + * np.sqrt(tempe[radial_elements - 1]) + * 1.875e7 + ) ) @nb.jit(nopython=True, cache=True) -def ion_collisions_sauter(radial_elements: np.ndarray, zeff: np.ndarray, ni: np.ndarray, tempi: np.ndarray, amain: np.ndarray) -> np.ndarray: +def ion_collisions_sauter( + radial_elements: np.ndarray, + zeff: np.ndarray, + ni: np.ndarray, + tempi: np.ndarray, + amain: np.ndarray, +) -> np.ndarray: """ Calculate the full frequency of ion collisions used in the arrays for the Sauter bootstrap current scaling. @@ -639,7 +665,10 @@ def ion_collisions_sauter(radial_elements: np.ndarray, zeff: np.ndarray, ni: np. zeff[radial_elements - 1] ** 4 * ni[radial_elements - 1] * 322.0 - / (tempi[radial_elements - 1] * np.sqrt(tempi[radial_elements - 1] * amain[radial_elements - 1])) + / ( + tempi[radial_elements - 1] + * np.sqrt(tempi[radial_elements - 1] * amain[radial_elements - 1]) + ) ) @@ -739,10 +768,15 @@ def calculate_l31_coefficient( f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) # Calculated electron collisionality; nu_e* - electron_collisionality = electron_collisionality_sauter(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + electron_collisionality = electron_collisionality_sauter( + radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne + ) # $f^{31}_{teff}(\nu_{e*})$, Eq.14b - f31_teff = f_trapped / ((1.0 + (1.0 - 0.1 * f_trapped) * np.sqrt(electron_collisionality)) + (0.5 * (1.0 - f_trapped) * electron_collisionality) / charge_profile) + f31_teff = f_trapped / ( + (1.0 + (1.0 - 0.1 * f_trapped) * np.sqrt(electron_collisionality)) + + (0.5 * (1.0 - f_trapped) * electron_collisionality) / charge_profile + ) l31_coefficient = ( ((1.0 + 1.4 / (charge_profile + 1.0)) * f31_teff) @@ -752,7 +786,16 @@ def calculate_l31_coefficient( # Corrections suggested by Fable, 15/05/2015 return l31_coefficient * beta_poloidal_total_sauter( - radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho + radial_elements, + number_of_elements, + rmajor, + bt, + ne, + ni, + tempe, + tempi, + magnetic_moment, + rho, ) @@ -811,43 +854,106 @@ def calculate_l31_32_coefficient( f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) # Calculated electron collisionality; nu_e* - electron_collisionality = electron_collisionality_sauter(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + electron_collisionality = electron_collisionality_sauter( + radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne + ) # $f^{32\_ee}_{teff}(\nu_{e*})$, Eq.15d - f32ee_teff = f_trapped / ((1.0 + 0.26 * (1.0 - f_trapped) * np.sqrt(electron_collisionality) + ( - 0.18 * (1.0 - 0.37 * f_trapped) * electron_collisionality / np.sqrt(charge_profile) - ))) + f32ee_teff = f_trapped / ( + ( + 1.0 + + 0.26 * (1.0 - f_trapped) * np.sqrt(electron_collisionality) + + ( + 0.18 + * (1.0 - 0.37 * f_trapped) + * electron_collisionality + / np.sqrt(charge_profile) + ) + ) + ) # $f^{32\_ei}_{teff}(\nu_{e*})$, Eq.15e - f32ei_teff = f_trapped / ((1.0 + (1.0 + 0.6 * f_trapped) * np.sqrt(electron_collisionality)) + ( - 0.85 * (1.0 - 0.37 * f_trapped) * electron_collisionality * (1.0 + charge_profile) - )) + f32ei_teff = f_trapped / ( + (1.0 + (1.0 + 0.6 * f_trapped) * np.sqrt(electron_collisionality)) + + ( + 0.85 + * (1.0 - 0.37 * f_trapped) + * electron_collisionality + * (1.0 + charge_profile) + ) + ) # $F_{32\_ee}(X)$, Eq.15b big_f32ee_teff = ( - ((0.05 + 0.62 * charge_profile) / charge_profile / (1.0 + 0.44 * charge_profile) * (f32ee_teff - f32ee_teff**4)) - + ((f32ee_teff**2 - f32ee_teff**4 - 1.2 * (f32ee_teff**3 - f32ee_teff**4)) / (1.0 + 0.22 * charge_profile)) + ( + (0.05 + 0.62 * charge_profile) + / charge_profile + / (1.0 + 0.44 * charge_profile) + * (f32ee_teff - f32ee_teff**4) + ) + + ( + ( + f32ee_teff**2 + - f32ee_teff**4 + - 1.2 * (f32ee_teff**3 - f32ee_teff**4) + ) + / (1.0 + 0.22 * charge_profile) + ) + (1.2 / (1.0 + 0.5 * charge_profile) * f32ee_teff**4) ) # $F_{32\_ei}(Y)$, Eq.15c big_f32ei_teff = ( - (-(0.56 + 1.93 * charge_profile) / charge_profile / (1.0 + 0.44 * charge_profile) * (f32ei_teff - f32ei_teff**4)) - + (4.95 / (1.0 + 2.48 * charge_profile) * (f32ei_teff**2 - f32ei_teff**4 - 0.55 * (f32ei_teff**3 - f32ei_teff**4))) + ( + -(0.56 + 1.93 * charge_profile) + / charge_profile + / (1.0 + 0.44 * charge_profile) + * (f32ei_teff - f32ei_teff**4) + ) + + ( + 4.95 + / (1.0 + 2.48 * charge_profile) + * ( + f32ei_teff**2 + - f32ei_teff**4 + - 0.55 * (f32ei_teff**3 - f32ei_teff**4) + ) + ) - (1.2 / (1.0 + 0.5 * charge_profile) * f32ei_teff**4) ) # big_f32ee_teff + big_f32ei_teff = L32 coefficient # Corrections suggested by Fable, 15/05/2015 - return beta_poloidal_sauter(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) * ( - big_f32ee_teff + big_f32ei_teff - ) + calculate_l31_coefficient( - radial_elements, number_of_elements, rmajor, bt, triang, ne, ni, tempe, tempi, magnetic_moment, rho, zeff, sqeps + return beta_poloidal_sauter( + radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho + ) * (big_f32ee_teff + big_f32ei_teff) + calculate_l31_coefficient( + radial_elements, + number_of_elements, + rmajor, + bt, + triang, + ne, + ni, + tempe, + tempi, + magnetic_moment, + rho, + zeff, + sqeps, ) * beta_poloidal_sauter( radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho ) / beta_poloidal_total_sauter( - radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho + radial_elements, + number_of_elements, + rmajor, + bt, + ne, + ni, + tempe, + tempi, + magnetic_moment, + rho, ) @@ -909,44 +1015,120 @@ def calculate_l34_alpha_31_coefficient( f_trapped = trapped_particle_fraction(radial_elements, triang, sqeps) # Calculated electron collisionality; nu_e* - electron_collisionality = electron_collisionality_sauter(radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne) + electron_collisionality = electron_collisionality_sauter( + radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne + ) # $f^{34}_{teff}(\nu_{e*})$, Eq.16b - f34_teff = f_trapped / ((1.0 + (1.0 - 0.1 * f_trapped) * np.sqrt(electron_collisionality)) + 0.5 * ( - 1.0 - 0.5 * f_trapped - ) * electron_collisionality / charge_profile) + f34_teff = f_trapped / ( + (1.0 + (1.0 - 0.1 * f_trapped) * np.sqrt(electron_collisionality)) + + 0.5 * (1.0 - 0.5 * f_trapped) * electron_collisionality / charge_profile + ) # Eq.16a - l34_coefficient = ((1.0 + (1.4 / (charge_profile + 1.0))) * f34_teff) - ((1.9 / (charge_profile + 1.0)) * f34_teff**2) + ((0.3 / (charge_profile + 1.0))*f34_teff**3) + ((0.2 / (charge_profile + 1.0))*f34_teff**4) + l34_coefficient = ( + ((1.0 + (1.4 / (charge_profile + 1.0))) * f34_teff) + - ((1.9 / (charge_profile + 1.0)) * f34_teff**2) + + ((0.3 / (charge_profile + 1.0)) * f34_teff**3) + + ((0.2 / (charge_profile + 1.0)) * f34_teff**4) + ) # $\alpha_0$, Eq.17a - alpha_0 = (-1.17 * (1.0 - f_trapped)) / (1.0 - (0.22 * f_trapped) - 0.19 * f_trapped**2) + alpha_0 = (-1.17 * (1.0 - f_trapped)) / ( + 1.0 - (0.22 * f_trapped) - 0.19 * f_trapped**2 + ) # Calculate the ion collisionality - ion_collisionality = ion_collisionality_sauter(radial_elements, rmajor, magnetic_moment, sqeps, tempi, amain, zmain, ni) + ion_collisionality = ion_collisionality_sauter( + radial_elements, rmajor, magnetic_moment, sqeps, tempi, amain, zmain, ni + ) # $\alpha(\nu_{i*})$, Eq.17b alpha = ( - ((alpha_0 + (0.25 * (1.0 - f_trapped**2)) * np.sqrt(ion_collisionality)) / (1.0 + (0.5 * np.sqrt(ion_collisionality))) - + (0.315 * ion_collisionality**2 * f_trapped**6) - )) / (1.0 + (0.15 * ion_collisionality**2 * f_trapped**6)) + ( + (alpha_0 + (0.25 * (1.0 - f_trapped**2)) * np.sqrt(ion_collisionality)) + / (1.0 + (0.5 * np.sqrt(ion_collisionality))) + + (0.315 * ion_collisionality**2 * f_trapped**6) + ) + ) / (1.0 + (0.15 * ion_collisionality**2 * f_trapped**6)) # Corrections suggested by Fable, 15/05/2015 # Below calculates the L34 * alpha + L31 coefficient return ( - beta_poloidal_total_sauter(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) - - beta_poloidal_sauter(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) + beta_poloidal_total_sauter( + radial_elements, + number_of_elements, + rmajor, + bt, + ne, + ni, + tempe, + tempi, + magnetic_moment, + rho, + ) + - beta_poloidal_sauter( + radial_elements, + number_of_elements, + rmajor, + bt, + ne, + tempe, + magnetic_moment, + rho, + ) ) * (l34_coefficient * alpha) + calculate_l31_coefficient( - radial_elements, number_of_elements, rmajor, bt, triang, ne, ni, tempe, tempi, magnetic_moment, rho, zeff, sqeps + radial_elements, + number_of_elements, + rmajor, + bt, + triang, + ne, + ni, + tempe, + tempi, + magnetic_moment, + rho, + zeff, + sqeps, ) * ( 1.0 - - beta_poloidal_sauter(radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho) - / beta_poloidal_total_sauter(radial_elements, number_of_elements, rmajor, bt, ne, ni, tempe, tempi, magnetic_moment, rho) + - beta_poloidal_sauter( + radial_elements, + number_of_elements, + rmajor, + bt, + ne, + tempe, + magnetic_moment, + rho, + ) + / beta_poloidal_total_sauter( + radial_elements, + number_of_elements, + rmajor, + bt, + ne, + ni, + tempe, + tempi, + magnetic_moment, + rho, + ) ) @nb.jit(nopython=True, cache=True) -def beta_poloidal_sauter(radial_elements: np.ndarray, nr: int, rmajor: float, bt: float, ne: np.ndarray, tempe: np.ndarray, magnetic_moment: np.ndarray, rho: np.ndarray) -> np.ndarray: +def beta_poloidal_sauter( + radial_elements: np.ndarray, + nr: int, + rmajor: float, + bt: float, + ne: np.ndarray, + tempe: np.ndarray, + magnetic_moment: np.ndarray, + rho: np.ndarray, +) -> np.ndarray: """ Calculate the local beta poloidal using only electron profiles for the Sauter bootstrap current scaling. @@ -969,15 +1151,37 @@ def beta_poloidal_sauter(radial_elements: np.ndarray, nr: int, rmajor: float, bt return ( np.where( radial_elements != nr, - 1.6e-4 * np.pi * (ne[radial_elements] + ne[radial_elements - 1]) * (tempe[radial_elements] + tempe[radial_elements - 1]), + 1.6e-4 + * np.pi + * (ne[radial_elements] + ne[radial_elements - 1]) + * (tempe[radial_elements] + tempe[radial_elements - 1]), 6.4e-4 * np.pi * ne[radial_elements - 1] * tempe[radial_elements - 1], ) - * (rmajor / (bt * rho[radial_elements - 1] * np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4))) ** 2 + * ( + rmajor + / ( + bt + * rho[radial_elements - 1] + * np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4) + ) + ) + ** 2 ) @nb.jit(nopython=True, cache=True) -def beta_poloidal_total_sauter(radial_elements: np.ndarray, nr: int, rmajor: float, bt: float, ne: np.ndarray, ni: np.ndarray, tempe: np.ndarray, tempi: np.ndarray, magnetic_moment: np.ndarray, rho: np.ndarray) -> np.ndarray: +def beta_poloidal_total_sauter( + radial_elements: np.ndarray, + nr: int, + rmajor: float, + bt: float, + ne: np.ndarray, + ni: np.ndarray, + tempe: np.ndarray, + tempi: np.ndarray, + magnetic_moment: np.ndarray, + rho: np.ndarray, +) -> np.ndarray: """ Calculate the local beta poloidal including ion pressure for the Sauter bootstrap current scaling. @@ -1005,17 +1209,38 @@ def beta_poloidal_total_sauter(radial_elements: np.ndarray, nr: int, rmajor: flo 1.6e-4 * np.pi * ( - ((ne[radial_elements] + ne[radial_elements - 1]) * (tempe[radial_elements] + tempe[radial_elements - 1])) - + ((ni[radial_elements] + ni[radial_elements - 1]) * (tempi[radial_elements] + tempi[radial_elements - 1])) + ( + (ne[radial_elements] + ne[radial_elements - 1]) + * (tempe[radial_elements] + tempe[radial_elements - 1]) + ) + + ( + (ni[radial_elements] + ni[radial_elements - 1]) + * (tempi[radial_elements] + tempi[radial_elements - 1]) + ) + ), + 6.4e-4 + * np.pi + * ( + ne[radial_elements - 1] * tempe[radial_elements - 1] + + ni[radial_elements - 1] * tempi[radial_elements - 1] ), - 6.4e-4 * np.pi * (ne[radial_elements - 1] * tempe[radial_elements - 1] + ni[radial_elements - 1] * tempi[radial_elements - 1]), ) - * (rmajor / (bt * rho[radial_elements - 1] * np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4))) ** 2 + * ( + rmajor + / ( + bt + * rho[radial_elements - 1] + * np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4) + ) + ) + ** 2 ) @nb.jit(nopython=True, cache=True) -def trapped_particle_fraction(radial_elements: np.ndarray, triang: float, sqeps: np.ndarray, fit: int = 0) -> np.ndarray: +def trapped_particle_fraction( + radial_elements: np.ndarray, triang: float, sqeps: np.ndarray, fit: int = 0 +) -> np.ndarray: """ Calculates the trapped particle fraction to be used in the Sauter bootstrap current scaling. @@ -1062,7 +1287,10 @@ def trapped_particle_fraction(radial_elements: np.ndarray, triang: float, sqeps: # Equation 4 of Sauter 2002; https://doi.org/10.1088/0741-3335/44/9/315. # Similar to, but not quite identical to above - return 1.0 - (((1.0 - eps) ** 2) / ((1.0 + 1.46 * sqeps_reduced) * np.sqrt(1.0 - eps**2))) + return 1.0 - ( + ((1.0 - eps) ** 2) + / ((1.0 + 1.46 * sqeps_reduced) * np.sqrt(1.0 - eps**2)) + ) elif fit == 2: # Sauter 2016; https://doi.org/10.1016/j.fusengdes.2016.04.033. @@ -1070,7 +1298,10 @@ def trapped_particle_fraction(radial_elements: np.ndarray, triang: float, sqeps: epseff = 0.67 * (1.0 - 1.4 * triang * np.abs(triang)) * eps - return 1.0 - (((1.0 - epseff) / (1.0 + 2.0 * np.sqrt(epseff)))*(np.sqrt((1.0 - eps) / (1.0 + eps)))) + return 1.0 - ( + ((1.0 - epseff) / (1.0 + 2.0 * np.sqrt(epseff))) + * (np.sqrt((1.0 - eps) / (1.0 + eps))) + ) raise RuntimeError(f"fit={fit} is not valid. Must be 1, 2, or 3") From 6aa83f5479f5d593241f6f9d6f63e8a6c3d2f190 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 13:37:47 +0100 Subject: [PATCH 051/108] Refactor magnetic_moment to inverse_q for safety factor profile and update related functions --- process/physics.py | 81 +++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/process/physics.py b/process/physics.py index 765d43523e..63beb47c69 100644 --- a/process/physics.py +++ b/process/physics.py @@ -598,7 +598,7 @@ def electron_collisionality_sauter( radial_elements: np.ndarray, rmajor: float, zeff: np.ndarray, - magnetic_moment: np.ndarray, + inverse_q: np.ndarray, sqeps: np.ndarray, tempe: np.ndarray, ne: np.ndarray, @@ -610,7 +610,7 @@ def electron_collisionality_sauter( - radial_elements: np.ndarray, the radial element index in the range 1 to nr - rmajor: float, the plasma major radius (m) - zeff: np.ndarray, the effective charge array - - mu: np.ndarray, the magnetic moment array + - inverse_q: np.ndarray, inverse safety factor profile - sqeps: np.ndarray, the square root of the inverse aspect ratio array - tempe: np.ndarray, the electron temperature array - ne: np.ndarray, the electron density array @@ -627,7 +627,7 @@ def electron_collisionality_sauter( * zeff[radial_elements - 1] * rmajor / np.abs( - magnetic_moment[radial_elements - 1] + inverse_q[radial_elements - 1] * (sqeps[radial_elements - 1] ** 3) * np.sqrt(tempe[radial_elements - 1]) * 1.875e7 @@ -676,7 +676,7 @@ def ion_collisions_sauter( def ion_collisionality_sauter( radial_elements: np.ndarray, rmajor: float, - magnetic_moment: np.ndarray, + inverse_q: np.ndarray, sqeps: np.ndarray, tempi: np.ndarray, amain: np.ndarray, @@ -689,7 +689,7 @@ def ion_collisionality_sauter( Parameters: - radial_elements: np.ndarray, the radial element indexes in the range 1 to nr - rmajor: float, the plasma major radius (m) - - magnetic_moment: np.ndarray, the magnetic moment profile + - inverse_q: np.ndarray, inverse safety factor profile - sqeps: np.ndarray, the square root of the inverse aspect ratio profile - tempi: np.ndarray, the ion temperature profile (keV) - amain: np.ndarray, the atomic mass of the main ion species profile @@ -707,7 +707,7 @@ def ion_collisionality_sauter( * ion_collisions_sauter(radial_elements, zeff, ni, tempi, amain) * rmajor / ( - np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4) + np.abs(inverse_q[radial_elements - 1] + 1.0e-4) * sqeps[radial_elements - 1] ** 3 * np.sqrt(tempi[radial_elements - 1] / amain[radial_elements - 1]) ) @@ -725,7 +725,7 @@ def calculate_l31_coefficient( ni: np.ndarray, tempe: np.ndarray, tempi: np.ndarray, - magnetic_moment: np.ndarray, + inverse_q: np.ndarray, rho: np.ndarray, zeff: np.ndarray, sqeps: np.ndarray, @@ -743,7 +743,7 @@ def calculate_l31_coefficient( - ni: np.ndarray, ion density profile (/m^3) - tempe: np.ndarray, electron temperature profile (keV) - tempi: np.ndarray, ion temperature profile (keV) - - magnetic_moment: np.ndarray, magnetic moment profile + - inverse_q: np.ndarray, inverse safety factor profile - rho: np.ndarray, normalized minor radius profile - zeff: np.ndarray, effective charge profile - sqeps: np.ndarray, square root of inverse aspect ratio profile @@ -769,7 +769,7 @@ def calculate_l31_coefficient( # Calculated electron collisionality; nu_e* electron_collisionality = electron_collisionality_sauter( - radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne + radial_elements, rmajor, zeff, inverse_q, sqeps, tempe, ne ) # $f^{31}_{teff}(\nu_{e*})$, Eq.14b @@ -794,7 +794,7 @@ def calculate_l31_coefficient( ni, tempe, tempi, - magnetic_moment, + inverse_q, rho, ) @@ -810,7 +810,7 @@ def calculate_l31_32_coefficient( ni: np.ndarray, tempe: np.ndarray, tempi: np.ndarray, - magnetic_moment: np.ndarray, + inverse_q: np.ndarray, rho: np.ndarray, zeff: np.ndarray, sqeps: np.ndarray, @@ -828,7 +828,7 @@ def calculate_l31_32_coefficient( - ni: np.ndarray, ion density profile (/m^3) - tempe: np.ndarray, electron temperature profile (keV) - tempi: np.ndarray, ion temperature profile (keV) - - magnetic_moment: np.ndarray, magnetic moment profile + - inverse_q: np.ndarray, inverse safety factor profile - rho: np.ndarray, normalized minor radius profile - zeff: np.ndarray, effective charge profile - sqeps: np.ndarray, square root of inverse aspect ratio profile @@ -855,7 +855,7 @@ def calculate_l31_32_coefficient( # Calculated electron collisionality; nu_e* electron_collisionality = electron_collisionality_sauter( - radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne + radial_elements, rmajor, zeff, inverse_q, sqeps, tempe, ne ) # $f^{32\_ee}_{teff}(\nu_{e*})$, Eq.15d @@ -926,7 +926,7 @@ def calculate_l31_32_coefficient( # Corrections suggested by Fable, 15/05/2015 return beta_poloidal_sauter( - radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho + radial_elements, number_of_elements, rmajor, bt, ne, tempe, inverse_q, rho ) * (big_f32ee_teff + big_f32ei_teff) + calculate_l31_coefficient( radial_elements, number_of_elements, @@ -937,12 +937,12 @@ def calculate_l31_32_coefficient( ni, tempe, tempi, - magnetic_moment, + inverse_q, rho, zeff, sqeps, ) * beta_poloidal_sauter( - radial_elements, number_of_elements, rmajor, bt, ne, tempe, magnetic_moment, rho + radial_elements, number_of_elements, rmajor, bt, ne, tempe, inverse_q, rho ) / beta_poloidal_total_sauter( radial_elements, number_of_elements, @@ -952,7 +952,7 @@ def calculate_l31_32_coefficient( ni, tempe, tempi, - magnetic_moment, + inverse_q, rho, ) @@ -964,7 +964,7 @@ def calculate_l34_alpha_31_coefficient( rmajor: float, bt: float, triang: float, - magnetic_moment: np.ndarray, + inverse_q: np.ndarray, sqeps: np.ndarray, tempi: np.ndarray, tempe: np.ndarray, @@ -984,7 +984,7 @@ def calculate_l34_alpha_31_coefficient( - rmajor: float, plasma major radius (m) - bt: float, toroidal field on axis (T) - triang: float, plasma triangularity - - magnetic_moment: np.ndarray, magnetic moment profile + - inverse_q: np.ndarray, inverse safety factor profile - sqeps: np.ndarray, square root of inverse aspect ratio profile - tempi: np.ndarray, ion temperature profile (keV) - tempe: np.ndarray, electron temperature profile (keV) @@ -1016,7 +1016,7 @@ def calculate_l34_alpha_31_coefficient( # Calculated electron collisionality; nu_e* electron_collisionality = electron_collisionality_sauter( - radial_elements, rmajor, zeff, magnetic_moment, sqeps, tempe, ne + radial_elements, rmajor, zeff, inverse_q, sqeps, tempe, ne ) # $f^{34}_{teff}(\nu_{e*})$, Eq.16b @@ -1040,7 +1040,7 @@ def calculate_l34_alpha_31_coefficient( # Calculate the ion collisionality ion_collisionality = ion_collisionality_sauter( - radial_elements, rmajor, magnetic_moment, sqeps, tempi, amain, zmain, ni + radial_elements, rmajor, inverse_q, sqeps, tempi, amain, zmain, ni ) # $\alpha(\nu_{i*})$, Eq.17b @@ -1064,7 +1064,7 @@ def calculate_l34_alpha_31_coefficient( ni, tempe, tempi, - magnetic_moment, + inverse_q, rho, ) - beta_poloidal_sauter( @@ -1074,7 +1074,7 @@ def calculate_l34_alpha_31_coefficient( bt, ne, tempe, - magnetic_moment, + inverse_q, rho, ) ) * (l34_coefficient * alpha) + calculate_l31_coefficient( @@ -1087,7 +1087,7 @@ def calculate_l34_alpha_31_coefficient( ni, tempe, tempi, - magnetic_moment, + inverse_q, rho, zeff, sqeps, @@ -1100,7 +1100,7 @@ def calculate_l34_alpha_31_coefficient( bt, ne, tempe, - magnetic_moment, + inverse_q, rho, ) / beta_poloidal_total_sauter( @@ -1112,7 +1112,7 @@ def calculate_l34_alpha_31_coefficient( ni, tempe, tempi, - magnetic_moment, + inverse_q, rho, ) ) @@ -1126,7 +1126,7 @@ def beta_poloidal_sauter( bt: float, ne: np.ndarray, tempe: np.ndarray, - magnetic_moment: np.ndarray, + inverse_q: np.ndarray, rho: np.ndarray, ) -> np.ndarray: """ @@ -1139,7 +1139,7 @@ def beta_poloidal_sauter( - bt: float, toroidal field on axis (T) - ne: np.ndarray, electron density profile (/m^3) - tempe: np.ndarray, electron temperature profile (keV) - - magnetic_moment: np.ndarray, magnetic moment profile + - inverse_q: np.ndarray, inverse safety factor profile - rho: np.ndarray, normalized minor radius profile Returns: @@ -1162,7 +1162,7 @@ def beta_poloidal_sauter( / ( bt * rho[radial_elements - 1] - * np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4) + * np.abs(inverse_q[radial_elements - 1] + 1.0e-4) ) ) ** 2 @@ -1179,7 +1179,7 @@ def beta_poloidal_total_sauter( ni: np.ndarray, tempe: np.ndarray, tempi: np.ndarray, - magnetic_moment: np.ndarray, + inverse_q: np.ndarray, rho: np.ndarray, ) -> np.ndarray: """ @@ -1194,7 +1194,7 @@ def beta_poloidal_total_sauter( - ni: np.ndarray, ion density profile (/m^3) - tempe: np.ndarray, electron temperature profile (keV) - tempi: np.ndarray, ion temperature profile (keV) - - magnetic_moment: np.ndarray, magnetic moment profile + - inverse_q: np.ndarray, inverse safety factor profile - rho: np.ndarray, normalized minor radius profile Returns: @@ -1230,7 +1230,7 @@ def beta_poloidal_total_sauter( / ( bt * rho[radial_elements - 1] - * np.abs(magnetic_moment[radial_elements - 1] + 1.0e-4) + * np.abs(inverse_q[radial_elements - 1] + 1.0e-4) ) ) ** 2 @@ -5218,14 +5218,15 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: # Return tempi like array object filled with zeff zef = np.full_like(tempi, physics_variables.zeff) - # mu = 1/safety factor + # inverse_q = 1/safety factor # Parabolic q profile assumed - mu = 1 / ( + inverse_q = 1 / ( physics_variables.q0 + (physics_variables.q - physics_variables.q0) * roa**2 ) - amain = np.full_like(mu, physics_variables.afuel) - zmain = np.full_like(mu, 1.0 + physics_variables.fhe3) + + amain = np.full_like(inverse_q, physics_variables.afuel) + zmain = np.full_like(inverse_q, 1.0 + physics_variables.fhe3) if ne[NR - 1] == 0.0: ne[NR - 1] = 1e-4 * ne[NR - 2] @@ -5257,7 +5258,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: ni, tempe, tempi, - mu, + inverse_q, rho, zef, sqeps, @@ -5273,7 +5274,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: ni, tempe, tempi, - mu, + inverse_q, rho, zef, sqeps, @@ -5285,7 +5286,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: physics_variables.rmajor, physics_variables.bt, physics_variables.triang, - mu, + inverse_q, sqeps, tempi, tempe, @@ -5303,7 +5304,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: -physics_variables.bt / (0.2 * np.pi * physics_variables.rmajor) * rho[nr_rng_1] - * mu[nr_rng_1] + * inverse_q[nr_rng_1] ) ) # A/m2 From 8dc555fcbc12f6a9061cf573c237155d7ac17eed Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 14:01:38 +0100 Subject: [PATCH 052/108] Update bootstrap_fraction_sauter() in-line comments --- process/physics.py | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/process/physics.py b/process/physics.py index 63beb47c69..bc229ceb22 100644 --- a/process/physics.py +++ b/process/physics.py @@ -5216,7 +5216,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: # Flat Zeff profile assumed # Return tempi like array object filled with zeff - zef = np.full_like(tempi, physics_variables.zeff) + zeff = np.full_like(tempi, physics_variables.zeff) # inverse_q = 1/safety factor # Parabolic q profile assumed @@ -5224,32 +5224,42 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: physics_variables.q0 + (physics_variables.q - physics_variables.q0) * roa**2 ) - + # Create new array of average mass of fuel portion of ions amain = np.full_like(inverse_q, physics_variables.afuel) + + # Create new array of average main ion charge zmain = np.full_like(inverse_q, 1.0 + physics_variables.fhe3) + # Prevent division by zero if ne[NR - 1] == 0.0: ne[NR - 1] = 1e-4 * ne[NR - 2] ni[NR - 1] = 1e-4 * ni[NR - 2] + # Prevent division by zero if tempe[NR - 1] == 0.0: tempe[NR - 1] = 1e-4 * tempe[NR - 2] tempi[NR - 1] = 1e-4 * tempi[NR - 2] # Calculate total bootstrap current (MA) by summing along profiles # Looping from 2 because calculate_l31_coefficient etc should return 0 @ j == 1 - nr_rng = np.arange(2, NR) - nr_rng_1 = nr_rng - 1 - drho = rho[nr_rng] - rho[nr_rng_1] - da = 2 * np.pi * rho[nr_rng_1] * drho # area of annulus - dlogte_drho = (np.log(tempe[nr_rng]) - np.log(tempe[nr_rng_1])) / drho - dlogti_drho = (np.log(tempi[nr_rng]) - np.log(tempi[nr_rng_1])) / drho - dlogne_drho = (np.log(ne[nr_rng]) - np.log(ne[nr_rng_1])) / drho + radial_elements = np.arange(2, NR) + + # Change in localised minor radius to be used as delta term in derivative + drho = rho[radial_elements] - rho[radial_elements-1] + + # Area of annulus, assuming circular plasma cross-section + da = 2 * np.pi * rho[radial_elements-1] * drho # area of annulus + + # Create the partial derivatives + dlogte_drho = (np.log(tempe[radial_elements]) - np.log(tempe[radial_elements-1])) / drho + dlogti_drho = (np.log(tempi[radial_elements]) - np.log(tempi[radial_elements-1])) / drho + dlogne_drho = (np.log(ne[radial_elements]) - np.log(ne[radial_elements-1])) / drho + jboot = ( 0.5 * ( calculate_l31_coefficient( - nr_rng, + radial_elements, NR, physics_variables.rmajor, physics_variables.bt, @@ -5260,12 +5270,12 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: tempi, inverse_q, rho, - zef, + zeff, sqeps, ) * dlogne_drho + calculate_l31_32_coefficient( - nr_rng, + radial_elements, NR, physics_variables.rmajor, physics_variables.bt, @@ -5276,12 +5286,12 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: tempi, inverse_q, rho, - zef, + zeff, sqeps, ) * dlogte_drho + calculate_l34_alpha_31_coefficient( - nr_rng, + radial_elements, NR, physics_variables.rmajor, physics_variables.bt, @@ -5295,7 +5305,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: ni, ne, rho, - zef, + zeff, ) * dlogti_drho ) @@ -5303,8 +5313,8 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: * ( -physics_variables.bt / (0.2 * np.pi * physics_variables.rmajor) - * rho[nr_rng_1] - * inverse_q[nr_rng_1] + * rho[radial_elements-1] + * inverse_q[radial_elements-1] ) ) # A/m2 From ab757e6bdab5799e5e6455427c2e41637caeb8c9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 14:08:14 +0100 Subject: [PATCH 053/108] Rename bootipf into bootstrap_current_fraction and add to obsolete variables list --- process/current_drive.py | 6 ++--- process/io/mfile_comparison.py | 6 ++--- process/io/obsolete_vars.py | 1 + process/io/plot_proc.py | 10 ++++----- process/io/variable_metadata.py | 2 +- process/physics.py | 26 +++++++++++----------- source/fortran/current_drive_variables.f90 | 4 ++-- source/fortran/scan.f90 | 4 ++-- tests/unit/test_current_drive.py | 8 +++---- tests/unit/test_physics.py | 4 ++-- tracking/tracking_data.py | 2 +- 11 files changed, 37 insertions(+), 36 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 64e5393463..7633cfc04d 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -909,8 +909,8 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Bootstrap fraction", - "(bootipf)", - current_drive_variables.bootipf, + "(bootstrap_current_fraction)", + current_drive_variables.bootstrap_current_fraction, "OP ", ) po.ovarrf( @@ -970,7 +970,7 @@ def cudriv(self, output: bool): ) if ( - abs(current_drive_variables.bootipf - current_drive_variables.bscfmax) + abs(current_drive_variables.bootstrap_current_fraction - current_drive_variables.bscfmax) < 1.0e-8 ): po.ocmmnt(self.outfile, "Warning : bootstrap current fraction is at") diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index 4e02b4b4fb..b730c23e4f 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -84,7 +84,7 @@ "pnucshld", "pdivt", "pheat", - "bootipf", + "bootstrap_current_fraction", "faccd", "facoh", "gamnb", @@ -173,7 +173,7 @@ "pnetelmw", "pinjmw", "pheat", - "bootipf", + "bootstrap_current_fraction", "faccd", "facoh", "gamnb", @@ -229,7 +229,7 @@ "ralpne", "pinnerzoneradmw", "pradmw", - "bootipf", + "bootstrap_current_fraction", "pdivmax/rmajor", "fimp(14", "etath", diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index 437bf84b26..780ba44fcc 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -117,6 +117,7 @@ "idia": "i_diamagnetic_current", "ibss": "i_bootstrap_current", "ips": "i_pfirsch_schluter_current", + "bootipf": "bootstrap_current_fraction", } OBS_VARS_HELP = { diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 5036ac608a..dd2df4bce1 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2735,7 +2735,7 @@ def plot_current_drive_info(axis, mfile_data, scan): data = [ (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), - ("bootipf", "Bootstrap fraction", ""), + ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), ("facoh", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), @@ -2765,7 +2765,7 @@ def plot_current_drive_info(axis, mfile_data, scan): data = [ (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), - ("bootipf", "Bootstrap fraction", ""), + ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), ("facoh", "Inductive fraction", ""), ("gamnb", "NB gamma", "$10^{20}$ A W$^{-1}$ m$^{-2}$"), @@ -2791,7 +2791,7 @@ def plot_current_drive_info(axis, mfile_data, scan): data = [ (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), - ("bootipf", "Bootstrap fraction", ""), + ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), ("facoh", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), @@ -2820,7 +2820,7 @@ def plot_current_drive_info(axis, mfile_data, scan): data = [ (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), - ("bootipf", "Bootstrap fraction", ""), + ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), ("facoh", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), @@ -2849,7 +2849,7 @@ def plot_current_drive_info(axis, mfile_data, scan): data = [ (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), - ("bootipf", "Bootstrap fraction", ""), + ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), ("facoh", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), diff --git a/process/io/variable_metadata.py b/process/io/variable_metadata.py index 744fba437f..3e376e443b 100644 --- a/process/io/variable_metadata.py +++ b/process/io/variable_metadata.py @@ -236,7 +236,7 @@ class VariableMetadata: "facoh": VariableMetadata( latex=r"$f_{\mathrm{CD,ind}}$", description="Inductive CD factor", units="" ), - "bootipf": VariableMetadata( + "bootstrap_current_fraction": VariableMetadata( latex=r"$f_{\mathrm{BS}}$", description="Bootstrap current fraction", units="" ), "pdivt": VariableMetadata( diff --git a/process/physics.py b/process/physics.py index bc229ceb22..fd8065a64d 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1558,34 +1558,34 @@ def physics(self): ) if current_drive_variables.bscfmax < 0.0e0: - current_drive_variables.bootipf = abs(current_drive_variables.bscfmax) - current_drive_variables.plasipf = current_drive_variables.bootipf + current_drive_variables.bootstrap_current_fraction = abs(current_drive_variables.bscfmax) + current_drive_variables.plasipf = current_drive_variables.bootstrap_current_fraction else: if physics_variables.i_bootstrap_current == 1: - current_drive_variables.bootipf = current_drive_variables.bscf_iter89 + current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_iter89 elif physics_variables.i_bootstrap_current == 2: - current_drive_variables.bootipf = current_drive_variables.bscf_nevins + current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_nevins elif physics_variables.i_bootstrap_current == 3: - current_drive_variables.bootipf = current_drive_variables.bscf_wilson + current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_wilson elif physics_variables.i_bootstrap_current == 4: - current_drive_variables.bootipf = current_drive_variables.bscf_sauter + current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_sauter elif physics_variables.i_bootstrap_current == 5: # Sakai states that the ACCOME dataset used has the toridal diamagnetic current included in the bootstrap current # So the diamagnetic current calculation should be turned off when using, (i_diamagnetic_current = 0). - current_drive_variables.bootipf = current_drive_variables.bscf_sakai + current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_sakai else: error_handling.idiags[0] = physics_variables.i_bootstrap_current error_handling.report_error(75) physics_module.err242 = 0 - if current_drive_variables.bootipf > current_drive_variables.bscfmax: - current_drive_variables.bootipf = min( - current_drive_variables.bootipf, current_drive_variables.bscfmax + if current_drive_variables.bootstrap_current_fraction > current_drive_variables.bscfmax: + current_drive_variables.bootstrap_current_fraction = min( + current_drive_variables.bootstrap_current_fraction, current_drive_variables.bscfmax ) physics_module.err242 = 1 current_drive_variables.plasipf = ( - current_drive_variables.bootipf + current_drive_variables.bootstrap_current_fraction + current_drive_variables.diaipf + current_drive_variables.psipf ) @@ -4756,8 +4756,8 @@ def outplas(self): po.ovarrf( self.outfile, "Bootstrap fraction (enforced)", - "(bootipf.)", - current_drive_variables.bootipf, + "(bootstrap_current_fraction.)", + current_drive_variables.bootstrap_current_fraction, "OP ", ) po.ovarrf( diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 6d18a01286..83eea7d660 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -23,7 +23,7 @@ module current_drive_variables real(dp) :: bigq !! Fusion gain; P_fusion / (P_injection + P_ohmic) - real(dp) :: bootipf + real(dp) :: bootstrap_current_fraction !! bootstrap current fraction (enforced; see i_bootstrap_current) real(dp) :: bscfmax @@ -237,7 +237,7 @@ subroutine init_current_drive_variables beamwd = 0.58D0 bigq = 0.0D0 - bootipf = 0.0D0 + bootstrap_current_fraction = 0.0D0 bscfmax = 0.9D0 bscf_iter89 = 0.0D0 bscf_nevins = 0.0D0 diff --git a/source/fortran/scan.f90 b/source/fortran/scan.f90 index 18dd82712f..d33c08648e 100644 --- a/source/fortran/scan.f90 +++ b/source/fortran/scan.f90 @@ -182,7 +182,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) use constraint_variables, only: taulimit use cost_variables, only: cdirt, coe, coeoam, coefuelt, c222, ireactor, & capcost, coecap, c221 - use current_drive_variables, only: pheat, pinjmw, bootipf, enbeam, bigq + use current_drive_variables, only: pheat, pinjmw, bootstrap_current_fraction, enbeam, bigq use divertor_variables, only: hldiv use error_handling, only: errors_on use heat_transport_variables, only: pgrossmw, pinjwp, pnetelmw @@ -243,7 +243,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) outvar(29,iscan) = pheat outvar(30,iscan) = pinjmw - pheat outvar(31,iscan) = bigq - outvar(32,iscan) = bootipf + outvar(32,iscan) = bootstrap_current_fraction outvar(33,iscan) = enbeam/1.0D3 outvar(34,iscan) = hldiv outvar(35,iscan) = tfcmw diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 2783f00cf1..18d6234d5c 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -92,7 +92,7 @@ class CudrivParam(NamedTuple): bigq: Any = None - bootipf: Any = None + bootstrap_current_fraction: Any = None bscfmax: Any = None @@ -238,7 +238,7 @@ class CudrivParam(NamedTuple): pinjemw=0, pinjimw=0, bigq=0, - bootipf=0.27635918746616817, + bootstrap_current_fraction=0.27635918746616817, bscfmax=0.95000000000000007, taubeam=0, pinjalw=200, @@ -328,7 +328,7 @@ class CudrivParam(NamedTuple): pinjemw=120.49600019005746, pinjimw=0, bigq=0, - bootipf=0.27635918746616817, + bootstrap_current_fraction=0.27635918746616817, bscfmax=0.95000000000000007, taubeam=0, pinjalw=200, @@ -469,7 +469,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(current_drive_variables, "bigq", cudrivparam.bigq) - monkeypatch.setattr(current_drive_variables, "bootipf", cudrivparam.bootipf) + monkeypatch.setattr(current_drive_variables, "bootstrap_current_fraction", cudrivparam.bootstrap_current_fraction) monkeypatch.setattr(current_drive_variables, "bscfmax", cudrivparam.bscfmax) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 04215a967b..3cb1a563bd 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -109,7 +109,7 @@ def test_bootstrap_fraction_iter89(bootstrapfractioniter89param, physics): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - bootipf = physics.bootstrap_fraction_iter89( + bootstrap_current_fraction = physics.bootstrap_fraction_iter89( aspect=bootstrapfractioniter89param.aspect, beta=bootstrapfractioniter89param.beta, bt=bootstrapfractioniter89param.bt, @@ -120,7 +120,7 @@ def test_bootstrap_fraction_iter89(bootstrapfractioniter89param, physics): vol=bootstrapfractioniter89param.vol, ) - assert bootipf == pytest.approx(bootstrapfractioniter89param.expected_bootipf) + assert bootstrap_current_fraction == pytest.approx(bootstrapfractioniter89param.expected_bootipf) class BootstrapFractionNevinsParam(NamedTuple): diff --git a/tracking/tracking_data.py b/tracking/tracking_data.py index 65b0ed5235..e3ef195454 100644 --- a/tracking/tracking_data.py +++ b/tracking/tracking_data.py @@ -85,7 +85,7 @@ class ProcessTracker: tracking_variables = { "pheat", - "bootipf", + "bootstrap_current_fraction", "pinjmw", "shldith", "fwith", From 3abdc8ef0c2a7f221ccd94d03fe5857b7d50f33a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 14:31:14 +0100 Subject: [PATCH 054/108] Rename plasipf to plasma_current_internal_fraction --- process/current_drive.py | 6 +++--- process/physics.py | 12 ++++++------ source/fortran/current_drive_variables.f90 | 6 +++--- tests/unit/test_current_drive.py | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 7633cfc04d..45df8c383b 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -945,14 +945,14 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Total", - "(plasipf+faccd+facoh)", - current_drive_variables.plasipf + "(plasma_current_internal_fraction+faccd+facoh)", + current_drive_variables.plasma_current_internal_fraction + physics_variables.faccd + physics_variables.facoh, ) if ( abs( - current_drive_variables.plasipf + current_drive_variables.plasma_current_internal_fraction + physics_variables.faccd + physics_variables.facoh - 1.0e0 diff --git a/process/physics.py b/process/physics.py index fd8065a64d..0950a28b9e 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1559,7 +1559,7 @@ def physics(self): if current_drive_variables.bscfmax < 0.0e0: current_drive_variables.bootstrap_current_fraction = abs(current_drive_variables.bscfmax) - current_drive_variables.plasipf = current_drive_variables.bootstrap_current_fraction + current_drive_variables.plasma_current_internal_fraction = current_drive_variables.bootstrap_current_fraction else: if physics_variables.i_bootstrap_current == 1: current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_iter89 @@ -1584,7 +1584,7 @@ def physics(self): ) physics_module.err242 = 1 - current_drive_variables.plasipf = ( + current_drive_variables.plasma_current_internal_fraction = ( current_drive_variables.bootstrap_current_fraction + current_drive_variables.diaipf + current_drive_variables.psipf @@ -1596,9 +1596,9 @@ def physics(self): # produced by non-inductive means (which also includes # the current drive proportion) physics_module.err243 = 0 - if current_drive_variables.plasipf > physics_variables.fvsbrnni: - current_drive_variables.plasipf = min( - current_drive_variables.plasipf, physics_variables.fvsbrnni + if current_drive_variables.plasma_current_internal_fraction > physics_variables.fvsbrnni: + current_drive_variables.plasma_current_internal_fraction = min( + current_drive_variables.plasma_current_internal_fraction, physics_variables.fvsbrnni ) physics_module.err243 = 1 @@ -1606,7 +1606,7 @@ def physics(self): physics_variables.facoh = max(1.0e-10, (1.0e0 - physics_variables.fvsbrnni)) # Fraction of plasma current produced by auxiliary current drive physics_variables.faccd = ( - physics_variables.fvsbrnni - current_drive_variables.plasipf + physics_variables.fvsbrnni - current_drive_variables.plasma_current_internal_fraction ) # Auxiliary current drive power calculations diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 83eea7d660..f2625bd573 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -196,8 +196,8 @@ module current_drive_variables real(dp) :: pinjfixmw !! secondary total fixed auxiliary injected power (MW) - real(dp) :: plasipf - !! plasma driven current fraction (Bootstrap + Diamagnetic + PS) + real(dp) :: plasma_current_internal_fraction + !! plasma current fraction driven internally (Bootstrap + Diamagnetic + PS) real(dp) :: plhybd !! lower hybrid injection power (MW) @@ -282,7 +282,7 @@ subroutine init_current_drive_variables pinjimw = 0.0D0 pinjmw = 0.0D0 pinjfixmw = 0.0D0 - plasipf = 0.0D0 + plasma_current_internal_fraction = 0.0D0 plhybd = 0.0D0 pnbeam = 0.0D0 porbitlossmw = 0.0D0 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 18d6234d5c..0e0b4ac7e5 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -112,7 +112,7 @@ class CudrivParam(NamedTuple): psipf: Any = None - plasipf: Any = None + plasma_current_internal_fraction: Any = None harnum: Any = None @@ -248,7 +248,7 @@ class CudrivParam(NamedTuple): rtanmax=0, diaipf=0, psipf=0, - plasipf=0.27635918746616817, + plasma_current_internal_fraction=0.27635918746616817, harnum=1, xi_ebw=0.80000000000000004, dene=7.5e19, @@ -338,7 +338,7 @@ class CudrivParam(NamedTuple): rtanmax=13.179564451855533, diaipf=0, psipf=0, - plasipf=0.27635918746616817, + plasma_current_internal_fraction=0.27635918746616817, harnum=1, xi_ebw=0.80000000000000004, dene=7.5e19, @@ -489,7 +489,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(current_drive_variables, "psipf", cudrivparam.psipf) - monkeypatch.setattr(current_drive_variables, "plasipf", cudrivparam.plasipf) + monkeypatch.setattr(current_drive_variables, "plasma_current_internal_fraction", cudrivparam.plasma_current_internal_fraction) monkeypatch.setattr(current_drive_variables, "harnum", cudrivparam.harnum) From 4c1d78eff48e13ce0c57f6b1c4b95b24e991300e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 15:09:58 +0100 Subject: [PATCH 055/108] Add inductive plasma current to navigation menu --- .../physics-models/plasma_current/inductive_plasma_current.md | 0 mkdocs.yml | 1 + 2 files changed, 1 insertion(+) create mode 100644 documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md diff --git a/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mkdocs.yml b/mkdocs.yml index df920ed0a7..82fd2cedb7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -59,6 +59,7 @@ nav: - Bootstrap Current: physics-models/plasma_current/bootstrap_current.md - Diamagnetic Current: physics-models/plasma_current/diamagnetic_current.md - Pfirsch-Schlüter Current: physics-models/plasma_current/pfirsch_schlüter_current_drive.md + - Inductive Current: physics-models/plasma_current/inductive_plasma_current.md - External Current Drive: physics-models/plasma_current/external_current_drive.md - Confinement time: physics-models/plasma_confinement.md - Plasma Core Power Balance: physics-models/plasma_power_balance.md From 3531f41e48f77c009eb6c958b15002c5e404484c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 13 Sep 2024 15:20:48 +0100 Subject: [PATCH 056/108] Refactor bscfmax to bootstrap_current_fraction_max and add bscfmax to obsolete variables list --- .../proc-pages/physics-models/error.txt | 34 +++++++++---------- process/current_drive.py | 6 ++-- process/io/obsolete_vars.py | 1 + process/io/plot_radial_build.py | 2 +- process/io/plot_scans.py | 2 +- process/physics.py | 10 +++--- source/fortran/current_drive_variables.f90 | 8 ++--- source/fortran/input.f90 | 6 ++-- source/fortran/scan.f90 | 8 ++--- tests/unit/test_current_drive.py | 8 ++--- 10 files changed, 43 insertions(+), 42 deletions(-) diff --git a/documentation/proc-pages/physics-models/error.txt b/documentation/proc-pages/physics-models/error.txt index 35d8231d24..f7d77d834e 100644 --- a/documentation/proc-pages/physics-models/error.txt +++ b/documentation/proc-pages/physics-models/error.txt @@ -1060,7 +1060,7 @@ Description\strut 1\strut \end{minipage} & \begin{minipage}[t]{0.03\columnwidth}\raggedright\strut ITER scaling -- To use the ITER scaling method for the bootstrap current -fraction. Set \texttt{bscfmax} to the maximum required bootstrap current +fraction. Set \texttt{bootstrap_current_fraction_max} to the maximum required bootstrap current fraction (\(\leq 1\)). This method is valid at high aspect ratio only.\strut \end{minipage}\tabularnewline @@ -1068,7 +1068,7 @@ only.\strut 2\strut \end{minipage} & \begin{minipage}[t]{0.03\columnwidth}\raggedright\strut General scaling\footnotemark{} -- To use a more general scaling method, -set \texttt{bscfmax} to the maximum required bootstrap current fraction +set \texttt{bootstrap_current_fraction_max} to the maximum required bootstrap current fraction (\(\leq 1\)).\strut \end{minipage} \footnotetext{W.M. Nevins, `Summary Report: ITER Specialists' Meeting on @@ -1078,7 +1078,7 @@ set \texttt{bscfmax} to the maximum required bootstrap current fraction 3\strut \end{minipage} & \begin{minipage}[t]{0.03\columnwidth}\raggedright\strut Numerically fitted scaling\footnotemark{} -- To use a numerically fitted -scaling method, valid for all aspect ratios, set \texttt{bscfmax} to the +scaling method, valid for all aspect ratios, set \texttt{bootstrap_current_fraction_max} to the maximum required bootstrap current fraction (\(\leq 1\)).\strut \end{minipage} \footnotetext{H.R. Wilson, Nuclear Fusion \textbf{32} (1992) 257}\tabularnewline @@ -1086,7 +1086,7 @@ maximum required bootstrap current fraction (\(\leq 1\)).\strut 4\strut \end{minipage} & \begin{minipage}[t]{0.03\columnwidth}\raggedright\strut Sauter, Angioni and Lin-Liu scaling\footnotemark{} \footnotemark{} -- -Set \texttt{bscfmax} to the maximum required bootstrap current fraction +Set \texttt{bootstrap_current_fraction_max} to the maximum required bootstrap current fraction (\(\leq 1\)).\strut \end{minipage} \addtocounter{footnote}{-1} @@ -1099,7 +1099,7 @@ Set \texttt{bscfmax} to the maximum required bootstrap current fraction \end{longtable} !!! Note ``Fixed Bootstrap Current'' Direct input -- To input the -bootstrap current fraction directly, set \texttt{bscfmax} to \((-1)\) +bootstrap current fraction directly, set \texttt{bootstrap_current_fraction_max} to \((-1)\) times the required value (e.g. -0.73 sets the bootstrap faction to 0.73). @@ -2547,7 +2547,7 @@ Overfull \hbox (3.56793pt too wide) in paragraph at lines 1038--1043 \T1/lmr/m/n/10 (-20) tion. Overfull \hbox (22.65782pt too wide) in paragraph at lines 1038--1043 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1038--1043 \T1/lmr/m/n/10 (-20) max- @@ -2619,7 +2619,7 @@ Overfull \hbox (19.63986pt too wide) in paragraph at lines 1046--1050 \T1/lmr/m/n/10 (-20) method, Overfull \hbox (22.65782pt too wide) in paragraph at lines 1046--1050 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1046--1050 \T1/lmr/m/n/10 (-20) max- @@ -2679,7 +2679,7 @@ Overfull \hbox (2.53915pt too wide) in paragraph at lines 1056--1060 \T1/lmr/m/n/10 (-20) tios, Overfull \hbox (22.65782pt too wide) in paragraph at lines 1056--1060 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1056--1060 \T1/lmr/m/n/10 (-20) max- @@ -2727,7 +2727,7 @@ Overfull \hbox (7.44649pt too wide) in paragraph at lines 1064--1068 \T1/lmr/m/n/10 (-20) ing[][][] Overfull \hbox (22.65782pt too wide) in paragraph at lines 1064--1068 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1064--1068 \T1/lmr/m/n/10 (-20) max- @@ -4677,7 +4677,7 @@ Overfull \hbox (3.56793pt too wide) in paragraph at lines 1038--1043 \T1/lmr/m/n/10 (-20) tion. Overfull \hbox (22.65782pt too wide) in paragraph at lines 1038--1043 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1038--1043 \T1/lmr/m/n/10 (-20) max- @@ -4749,7 +4749,7 @@ Overfull \hbox (19.63986pt too wide) in paragraph at lines 1046--1050 \T1/lmr/m/n/10 (-20) method, Overfull \hbox (22.65782pt too wide) in paragraph at lines 1046--1050 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1046--1050 \T1/lmr/m/n/10 (-20) max- @@ -4809,7 +4809,7 @@ Overfull \hbox (2.53915pt too wide) in paragraph at lines 1056--1060 \T1/lmr/m/n/10 (-20) tios, Overfull \hbox (22.65782pt too wide) in paragraph at lines 1056--1060 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1056--1060 \T1/lmr/m/n/10 (-20) max- @@ -4857,7 +4857,7 @@ Overfull \hbox (7.44649pt too wide) in paragraph at lines 1064--1068 \T1/lmr/m/n/10 (-20) ing[][][] Overfull \hbox (22.65782pt too wide) in paragraph at lines 1064--1068 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1064--1068 \T1/lmr/m/n/10 (-20) max- @@ -6789,7 +6789,7 @@ Overfull \hbox (3.56793pt too wide) in paragraph at lines 1038--1043 \T1/lmr/m/n/10 (-20) tion. Overfull \hbox (22.65782pt too wide) in paragraph at lines 1038--1043 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1038--1043 \T1/lmr/m/n/10 (-20) max- @@ -6861,7 +6861,7 @@ Overfull \hbox (19.63986pt too wide) in paragraph at lines 1046--1050 \T1/lmr/m/n/10 (-20) method, Overfull \hbox (22.65782pt too wide) in paragraph at lines 1046--1050 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1046--1050 \T1/lmr/m/n/10 (-20) max- @@ -6921,7 +6921,7 @@ Overfull \hbox (2.53915pt too wide) in paragraph at lines 1056--1060 \T1/lmr/m/n/10 (-20) tios, Overfull \hbox (22.65782pt too wide) in paragraph at lines 1056--1060 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1056--1060 \T1/lmr/m/n/10 (-20) max- @@ -6969,7 +6969,7 @@ Overfull \hbox (7.44649pt too wide) in paragraph at lines 1064--1068 \T1/lmr/m/n/10 (-20) ing[][][] Overfull \hbox (22.65782pt too wide) in paragraph at lines 1064--1068 -\T1/lmtt/m/n/10 bscfmax +\T1/lmtt/m/n/10 bootstrap_current_fraction_max Overfull \hbox (5.74335pt too wide) in paragraph at lines 1064--1068 \T1/lmr/m/n/10 (-20) max- diff --git a/process/current_drive.py b/process/current_drive.py index 45df8c383b..d902d17a4a 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -793,8 +793,8 @@ def cudriv(self, output: bool): po.ovarre( self.outfile, "Maximum Allowed Bootstrap current fraction", - "(bscfmax)", - current_drive_variables.bscfmax, + "(bootstrap_current_fraction_max)", + current_drive_variables.bootstrap_current_fraction_max, ) if current_drive_variables.iefrffix != 0: po.ovarre( @@ -970,7 +970,7 @@ def cudriv(self, output: bool): ) if ( - abs(current_drive_variables.bootstrap_current_fraction - current_drive_variables.bscfmax) + abs(current_drive_variables.bootstrap_current_fraction - current_drive_variables.bootstrap_current_fraction_max) < 1.0e-8 ): po.ocmmnt(self.outfile, "Warning : bootstrap current fraction is at") diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index 780ba44fcc..d50bdb6d3d 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -118,6 +118,7 @@ "ibss": "i_bootstrap_current", "ips": "i_pfirsch_schluter_current", "bootipf": "bootstrap_current_fraction", + "bscfmax": "bootstrap_current_fraction_max", } OBS_VARS_HELP = { diff --git a/process/io/plot_radial_build.py b/process/io/plot_radial_build.py index 69ff228741..1b75e0e628 100644 --- a/process/io/plot_radial_build.py +++ b/process/io/plot_radial_build.py @@ -160,7 +160,7 @@ def main(args=None): "te", "boundu(15)", "dnbeta", - "bscfmax", + "bootstrap_current_fraction_max", "boundu(10)", "fiooic", "fjprot", diff --git a/process/io/plot_scans.py b/process/io/plot_scans.py index 2176755244..9b34a4daeb 100644 --- a/process/io/plot_scans.py +++ b/process/io/plot_scans.py @@ -218,7 +218,7 @@ def main(args=None): nsweep_dict[9] = "te" nsweep_dict[10] = "boundu(15)" nsweep_dict[11] = "dnbeta" - nsweep_dict[12] = "bscfmax" + nsweep_dict[12] = "bootstrap_current_fraction_max" nsweep_dict[13] = "boundu(10)" nsweep_dict[14] = "fiooic" nsweep_dict[15] = "fjprot" diff --git a/process/physics.py b/process/physics.py index 0950a28b9e..1ada8f9202 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1557,8 +1557,8 @@ def physics(self): ) ) - if current_drive_variables.bscfmax < 0.0e0: - current_drive_variables.bootstrap_current_fraction = abs(current_drive_variables.bscfmax) + if current_drive_variables.bootstrap_current_fraction_max < 0.0e0: + current_drive_variables.bootstrap_current_fraction = abs(current_drive_variables.bootstrap_current_fraction_max) current_drive_variables.plasma_current_internal_fraction = current_drive_variables.bootstrap_current_fraction else: if physics_variables.i_bootstrap_current == 1: @@ -1578,9 +1578,9 @@ def physics(self): error_handling.report_error(75) physics_module.err242 = 0 - if current_drive_variables.bootstrap_current_fraction > current_drive_variables.bscfmax: + if current_drive_variables.bootstrap_current_fraction > current_drive_variables.bootstrap_current_fraction_max: current_drive_variables.bootstrap_current_fraction = min( - current_drive_variables.bootstrap_current_fraction, current_drive_variables.bscfmax + current_drive_variables.bootstrap_current_fraction, current_drive_variables.bootstrap_current_fraction_max ) physics_module.err242 = 1 @@ -4698,7 +4698,7 @@ def outplas(self): if physics_module.err243 == 1: error_handling.report_error(243) - if current_drive_variables.bscfmax < 0.0e0: + if current_drive_variables.bootstrap_current_fraction_max < 0.0e0: po.ocmmnt( self.outfile, " (User-specified bootstrap current fraction used)" ) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index f2625bd573..03e6a23962 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -26,9 +26,9 @@ module current_drive_variables real(dp) :: bootstrap_current_fraction !! bootstrap current fraction (enforced; see i_bootstrap_current) - real(dp) :: bscfmax - !! maximum fraction of plasma current from bootstrap; if `bscfmax < 0`, - !! bootstrap fraction = abs(bscfmax) + real(dp) :: bootstrap_current_fraction_max + !! maximum fraction of plasma current from bootstrap; if `bootstrap_current_fraction_max < 0`, + !! bootstrap fraction = abs(bootstrap_current_fraction_max) real(dp) :: bscf_iter89 !! bootstrap current fraction, ITER 1989 model @@ -238,7 +238,7 @@ subroutine init_current_drive_variables beamwd = 0.58D0 bigq = 0.0D0 bootstrap_current_fraction = 0.0D0 - bscfmax = 0.9D0 + bootstrap_current_fraction_max = 0.9D0 bscf_iter89 = 0.0D0 bscf_nevins = 0.0D0 bscf_sauter = 0.0D0 diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index b8026de034..ff1768320d 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -258,7 +258,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) ucpens, cland, ucwindpf, i_cp_lifetime, cplife_input, & startupratio, tmain, u_unplanned_cp, supercond_cost_model use current_drive_variables, only: pinjfixmw, etaech, pinjalw, etanbi, & - ftritbm, gamma_ecrh, pheat, beamwd, enbeam, pheatfix, bscfmax, & + ftritbm, gamma_ecrh, pheat, beamwd, enbeam, pheatfix, bootstrap_current_fraction_max, & forbitloss, nbshield, tbeamin, feffcd, iefrf, iefrffix, irfcd, cboot, & etalh, frbeam, harnum, xi_ebw, wave_mode use divertor_variables, only: fdfs, anginc, divdens, divclfr, c4div, & @@ -1038,8 +1038,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) call parse_real_variable('beamwd', beamwd, 0.001D0, 5.0D0, & 'Beam width (m)') - case ('bscfmax') - call parse_real_variable('bscfmax', bscfmax, -0.999D0, 0.999D0, & + case ('bootstrap_current_fraction_max') + call parse_real_variable('bootstrap_current_fraction_max', bootstrap_current_fraction_max, -0.999D0, 0.999D0, & '(-fixed)/maximum Bootstrap fraction') case ('cboot') call parse_real_variable('cboot', cboot, 0.0D0, 10.0D0, & diff --git a/source/fortran/scan.f90 b/source/fortran/scan.f90 index d33c08648e..ada8b132ab 100644 --- a/source/fortran/scan.f90 +++ b/source/fortran/scan.f90 @@ -48,7 +48,7 @@ module scan_module !!

  • 9 te !!
  • 10 boundu(15: fvs) !!
  • 11 dnbeta - !!
  • 12 bscfmax (use negative values only) + !!
  • 12 bootstrap_current_fraction_max !!
  • 13 boundu(10: hfact) !!
  • 14 fiooic !!
  • 15 fjprot @@ -597,7 +597,7 @@ subroutine scan_select(nwp, swp, iscn, vlab, xlab) use constraint_variables, only: fiooic, walalw, bmxlim, fqval, taulimit, & gammax, tbrnmn, tbrmin, fjprot, pnetelin, powfmax use cost_variables, only: cfactr, iavail, fkind, startupratio - use current_drive_variables, only: bscfmax, etaech + use current_drive_variables, only: bootstrap_current_fraction_max, etaech use divertor_variables, only: hldivlim use error_handling, only: idiags, report_error use fwbs_variables, only: inlet_temp_liq, outlet_temp_liq, blpressure_liq, & @@ -658,8 +658,8 @@ subroutine scan_select(nwp, swp, iscn, vlab, xlab) dnbeta = swp(iscn) vlab = 'dnbeta' ; xlab = 'Beta_coefficient' case (12) - bscfmax = swp(iscn) - vlab = 'bscfmax' ; xlab = 'Bootstrap_fraction' + bootstrap_current_fraction_max = swp(iscn) + vlab = 'bootstrap_current_fraction_max' ; xlab = 'Bootstrap_fraction' case (13) boundu(10) = swp(iscn) vlab = 'boundu(10)' ; xlab = 'H_factor_upper_bound' diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 0e0b4ac7e5..b0383e1b45 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -94,7 +94,7 @@ class CudrivParam(NamedTuple): bootstrap_current_fraction: Any = None - bscfmax: Any = None + bootstrap_current_fraction_max: Any = None taubeam: Any = None @@ -239,7 +239,7 @@ class CudrivParam(NamedTuple): pinjimw=0, bigq=0, bootstrap_current_fraction=0.27635918746616817, - bscfmax=0.95000000000000007, + bootstrap_current_fraction_max=0.95000000000000007, taubeam=0, pinjalw=200, nbshield=0.5, @@ -329,7 +329,7 @@ class CudrivParam(NamedTuple): pinjimw=0, bigq=0, bootstrap_current_fraction=0.27635918746616817, - bscfmax=0.95000000000000007, + bootstrap_current_fraction_max=0.95000000000000007, taubeam=0, pinjalw=200, nbshield=0.5, @@ -471,7 +471,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(current_drive_variables, "bootstrap_current_fraction", cudrivparam.bootstrap_current_fraction) - monkeypatch.setattr(current_drive_variables, "bscfmax", cudrivparam.bscfmax) + monkeypatch.setattr(current_drive_variables, "bootstrap_current_fraction_max", cudrivparam.bootstrap_current_fraction_max) monkeypatch.setattr(current_drive_variables, "taubeam", cudrivparam.taubeam) From ea979e003fa62973a89877bd0f3c785c39e1defb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 16 Sep 2024 20:30:29 +0100 Subject: [PATCH 057/108] Initial commit of bootstrap models. Have added the main key details of all models and some explanations --- .../plasma_current/bootstrap_current.md | 335 +++++++++++++++++- 1 file changed, 318 insertions(+), 17 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index e376172ffd..97510baacf 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -6,24 +6,325 @@ Some more info can be found [here](https://wiki.fusion.ciemat.es/wiki/Bootstrap_ ## Selection The fraction of the plasma current provided by the bootstrap effect -can be either input into the code directly, or calculated using one of four +can be either input into the code directly, or calculated using one of five methods, as summarised here. Note that methods `i_bootstrap_current = 1-3` do not take into account the existence of pedestals, whereas the Sauter et al. scaling (`i_bootstrap_current = 4`) allows general profiles to be used. -| `i_bootstrap_current` | Description | -| :-: | - | -| 1 | ITER scaling -- To use the ITER scaling method for the bootstrap current fraction. Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). This method is valid at high aspect ratio only. -| 2 | General scaling -- To use a more general scaling method, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). -| 3 | Numerically fitted scaling [^1] -- To use a numerically fitted scaling method, valid for all aspect ratios, set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). -| 4 | Sauter, Angioni and Lin-Liu scaling [^2] [^3] -- Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). -| 5 | Sakai, Fujita and Okamoto scaling [^4] -- Set `bscfmax` to the maximum required bootstrap current fraction ($\leq 1$). The model includes the toroidal diamagnetic current in the calculation due to the dataset, so `idia = 0` can only be used with it - -!!! Note "Fixed Bootstrap Current" - Direct input -- To input the bootstrap current fraction directly, set `bscfmax` - to $(-1)$ times the required value (e.g. -0.73 sets the bootstrap faction to 0.73). - -[^1]: H.R. Wilson, Nuclear Fusion **32** (1992) 257 -[^2]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **6** (1999) 2834 -[^3]: O. Sauter, C. Angioni and Y.R. Lin-Liu, Physics of Plasmas **9** (2002) 5140 -[^4]: Ryosuke Sakai, Takaaki Fujita, Atsushi Okamoto, Derivation of bootstrap current fraction scaling formula for 0-D system code analysis, Fusion Engineering and Design, Volume 149, 2019, 111322, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2019.111322. \ No newline at end of file +-------------- + +### ITER IPDG89 Scaling | `bootstrap_fraction_iter89()` + +Original emperical ITER bootstrap scaling from the 1989 Physics Design Guidelines[^0] +Is selected by setting `i_bootstrap_current = 1` + +Emperical fit for the bootstrap current fraction as: + +$$ +\frac{I_{\text{BS}}}{I} = C_{\text{BS}}\left(\epsilon^{0.5}\beta_{\text{pa}}\right)^{1.3} +$$ + +where: + +$$ +C_{\text{BS}} = 1.32 - 0.235\left(\frac{q_{95}}{q_0}\right) + 0.0185\left(\frac{q_{95}}{q_0}\right)^2 +$$ + +$$ +\beta_{\text{pa}} = \frac{\langle p \rangle}{\frac{B_{\text{pa}^2}}{2\mu_0}} = \beta_{\text{tot}}\left(\frac{B_0}{B_{\text{pa}}}\right)^2 +$$ + +$$ +B_{\text{pa}} = \frac{I}{5\langle a \rangle} +$$ + +$$ +\langle a \rangle = \left(\frac{V}{2\pi^2 R_0}\right) +$$ + +------------ + +### Nevins Scaling | `bootstrap_fraction_nevins()` + +The general Nevins scaling is normally cited from a ITER specialists meeting in 1989[^1] which is not publicaly accessible. +However it can be found in the appendix [here](https://doi.org/10.1016/j.fusengdes.2014.07.009)[^2]. + +Is selected by setting `i_bootstrap_current = 2` + +$$ +f_{\text{BS}} = \frac{2.5\beta_{e0}R_pB_{T}q_{95}}{I_{\text{p}}}\int^1_0 B_{\text{int}}\ dy +$$ + +$$ +\beta_e = \frac{1.6022 \times 10^{-16}n_{\text{e}}T_{\text{e}}}{B_{T}^2 / 2\mu_0} +$$ + +$$ +\beta_{e0} = \frac{1.6022 \times 10^{-16}n_{\text{e0}}T_{\text{e0}}}{B_{T}^2 / 2\mu_0} +$$ + +$$ +\Delta = \epsilon y^{0.5} +$$ + +$$ +x = \frac{1.46 \sqrt{\Delta}+2.4\Delta}{\left(1-\Delta\right)^{1.5}} +$$ + +$$ +d = \sqrt{2}Z_{\text{eff}} + Z_{\text{eff}}^2 + x\left(0.75+2.657Z_{\text{eff}}+2Z_{\text{eff}}^2\right) \\ ++x^2\left(0.348+1.243Z_{\text{eff}}+Z_{\text{eff}}^2\right) +$$ + +$$ +A_1 = \left(\alpha_{\text{n}}+\alpha_{\text{T}}\right)\left(1-y\right)^{\alpha_{\text{n}}+\alpha_{\text{T}}-1} +$$ + +$$ +A_2 = \alpha_{\text{T}}\left(1-y\right)^{\alpha_{\text{n}}+\alpha_{\text{T}}-1} +$$ + +$$ +A_{l1} = \frac{x}{d}\left(0.754+2.21Z_{\text{eff}}+Z_{\text{eff}}^2+x\left(0.348+1.243Z_{\text{eff}}+Z_{\text{eff}}^2\right)\right) +$$ + +$$ +A_{l2}=-x\frac{0.884+2.0742Z_{\text{eff}}}{d} +$$ + +$$ +\alpha_i = -\frac{1.172}{1+0.462x} +$$ + +$$ +q = q_0+\left(q_{95}-q_0\right)\frac{y+y^2+y^3}{3} +$$ + +$$ +\beta_{\text{tot}} = \beta_{\text{T}}\frac{B_{\text{tot}}^2}{B_{\text{T}}^2} = \frac{\beta_{T}\left(B_{T}^2+\beta_{\text{p}}\right)}{B_{\text{T}}^2} +$$ + +$$ +P_{\text{ratio}} = \frac{\beta_{\text{T}}-\beta_e}{\beta_e} +$$ + +$$ +B_{\text{int}} = \frac{q}{q_{95}}\left[A_{l1}\left(A_1+P_{\text{ratio}}\left(A_1+\alpha_i A_2\right)\right)+A_{l2}A_2\right] +$$ + + + +---------------- + + +### Wilson Scaling | `bootstrap_fraction_wilson()` + +An empirical formula[^3] as a function of the pressure, +temperature and total current profiles as well as the poloidal beta and aspect ratio of the tokamak. This empirical formula is compared with an expression obtained by the ITER group; also a comparison with an analytical result (valid at large aspect ratio) is made. It is found that the empirical result determined here agrees well with the large but not so well with the empirical formula of the ITER group[^0] + +Is selected by setting `i_bootstrap_current = 3` + +- The large aspect ratio expression is valid only for $Z$ = 1, so the $Z$ dependence cannot be obtained from this result. + +Data is fitted to 3000 equilibria evenly distributed across the parameter range below: + +| Variable | $R$ | $A$ | $B_{\text{T}}$ | $\delta$ | $\kappa$ | $\alpha_{\text{p}}$ | $\alpha_{\text{T}}$ | $\alpha_{\text{J}}$ | $Z$ | +|----------|-----|-----|----------------|-----------|-----------|-------------------|-------------------|-------------------|-----| +| Value | 5.31 | 1.1-5 | 6.2 | 0.2 | 2.0 | 1-3 | 0.1-$\alpha_{\text{p}}$ | 0.5-2.0 | 1-3 | + + +Using the relation: + +$$ +\frac{I_{\text{b}}}{I_{\text{p}}} = \beta_{\text{p}}\epsilon_0^{\frac{1}{2}} \sum_{i=1}^{12}a_i(\alpha_{\text{J}}, Z)b_i +$$ + +In the paper definition $\epsilon_0$ is not the standard inverse aspect ration but is defined as: + +$$ +\epsilon_0 = \frac{R_2-R_1}{R_2+R_1} +$$ + +Where $R_2$ and $R_1$ are the maximum and minimum radii of the plasma + +$$ +b_1 = 1 \ \ b_2 = \alpha_{\text{p}} \ \ b_3 = \alpha_{\text{T}} \ \ b_4 = \alpha_{\text{p}}\alpha_{\text{T}} \\ +b_5 = \epsilon_0^{\frac{1}{2}} \ \ b_6 = \alpha_{\text{p}}\epsilon_0^{\frac{1}{2}} \ \ b_7 = \alpha_{\text{T}}\epsilon_0^{\frac{1}{2}} \ \ b_8 = \alpha_{\text{p}}\alpha_{\text{T}}\epsilon_0^{\frac{1}{2}} \\ +b_9 = \epsilon_0 \ \ b_{10} = \alpha_{\text{p}}\epsilon_0 \ \ b_{11} = \alpha_{\text{T}}\epsilon_0 \ \ b_{12} = \alpha_{\text{p}}\alpha_{\text{T}}\epsilon_0 +$$ + +$$ +a_1 = 1.41\left(1.0 - 0.28 \alpha_{\text{J}}^{\frac{1}{2}}\right)\left(1.0 + \frac{0.12}{Z}\right) \\ +a_2 = 0.36 \left(1.0 - 0.59 \alpha_{\text{J}}^{\frac{1}{2}}\right) \left(1.0 + \frac{0.8}{Z}\right) \\ +a_3 = -0.27 \left(1.0 - 0.47 \alpha_{\text{J}}^{\frac{1}{2}}\right) \left(1.0 + \frac{3.0}{Z}\right) \\ +a_4 = 0.0053 \left(1.0 + \frac{5.0}{Z}\right) \\ +a_5 = -0.93 \left(1.0 - 0.34 \alpha_{\text{J}}^{\frac{1}{2}}\right) \left(1.0 + \frac{0.15}{Z}\right) \\ +a_6 = -0.26 \left(1.0 - 0.57 \alpha_{\text{J}}^{\frac{1}{2}}\right) \left(1.0 - 0.27 Z\right) \\ +a_7 = 0.064 \left(1.0 - 0.6 \alpha_{\text{J}} + 0.15 \alpha_{\text{J}}^2\right) \left(1.0 + \frac{7.6}{Z}\right) \\ +a_8 = -0.0011 \left(1.0 + \frac{9.0}{Z}\right) \\ +a_9 = -0.33 \left(1.0 - \alpha_{\text{J}} + 0.33 \alpha_{\text{J}}^2\right) \\ +a_{10} = -0.26 \left(1.0 - \frac{0.87}{\alpha_{\text{J}}^{\frac{1}{2}}} - 0.16 \alpha_{\text{J}}\right) \\ +a_{11} = -0.14 \left(1.0 - \frac{1.14}{\alpha_{\text{J}}^{\frac{1}{2}}} - 0.45 \alpha_{\text{J}}^{\frac{1}{2}}\right) \\ +a_{12} = -0.0069 \\ +$$ + +Coefficients are obtained by a least squares fit to the 3000 equilibria numerical solutions. Error distribution is shows an average error of 3.6% and a maximum error of 20%. These larger errors appear to come from the cases where the temperature profile is approximately equal to the pressure profile. For these cases the density profile is very flat over much of the plasma radius and (as it is forced to be zero at the plasma edge) this +means that it falls off sharply at the plasma edge. + +!!! quote "Excerpt from Wilson[^3]" + + *"The ITER group gives an expression for the bootstrap current[^0] which differs significantly from that + presented here. Their relatively simple expression, + shows no variation with density and temperature profiles. It also does not reproduce the large aspect ratio + scaling with $\beta_{\text{p}}$, and $\epsilon$ in this limit."* + +-------------------- + +### Sauter Scaling | `bootstrap_fraction_sauter()` + +Sauter et al.[^4] [^5] provides a formula using the exact Fokker–Planck operator and +without any approximation on the plasma geometry or collisionality. In this way we have been able to accurately determine the neoclassical resistivity and the coefficients for the +bootstrap current which allows one to calculate the bootstrap fraction + +Is selected by setting `i_bootstrap_current = 4` + +$$ +\left\langle j_{\|} B\right\rangle= \sigma_{\text {neo }}\left\langle E_{\|} B\right\rangle-I(\psi) p(\psi)\left[\mathcal{L}_{31} \frac{\partial \ln n_e}{\partial \psi} \\ ++R_{p e}\left(\mathcal{L}_{31}+\mathcal{L}_{32}\right) \frac{\partial \ln T_e}{\partial \psi}+\left(1-R_{p e}\right) \times\left(1+\frac{\mathcal{L}_{34}}{\mathcal{L}_{31}} \alpha\right) \mathcal{L}_{31} \frac{\partial \ln T_i}{\partial \psi}\right] +$$ + +----------- + +#### Calculate electron density coefficient | `calculate_l31_coefficient()` + +This function calulates and returns the $\mathcal{L}_{31}$ coefficient value for $\frac{\partial \ln n_e}{\partial \psi}$ + +$$ +\mathcal{L}_{31}= F_{31}\left(X=f_{\text {teff }}^{31}\right) \equiv\left(1+\frac{1.4}{Z+1}\right) X-\frac{1.9}{Z+1} X^2+\frac{0.3}{Z+1} X^3 +\frac{0.2}{Z+1} X^4 \\ +f_{\text {teff }}^{31}\left(\nu_{e *}\right)= \frac{f_t}{1+\left(1-0.1 f_t\right) \sqrt{\nu_{e *}}+0.5\left(1-f_t\right) \nu_{e *} / Z} +$$ + +--------------- + +#### Calculate electron temperature coefficient | `calculate_l31_32_coefficient()` + +This function calculates and returns the $\left(\mathcal{L}_{31}+\mathcal{L}_{32}\right)$ coefficient value for $\frac{\partial \ln T_{\text{e}}}{\partial \psi}$. + +$$ +\begin{align*} +\mathcal{L}_{32} &= F_{32 \_e e}\left(X=f_{\text {teff }}^{32 \_e e}\right)+F_{32 \_e i}\left(Y=f_{\text {teff }}^{32 \_e i}\right) \\ \\ +F_{32 \_e e}(X) &= \frac{0.05+0.62 Z}{Z(1+0.44 Z)}\left(X-X^4\right)+\frac{1}{1+0.22 Z}\left[X^2-X^4\right. \\ +& \quad \left.-1.2\left(X^3-X^4\right)\right]+\frac{1.2}{1+0.5 Z} X^4 \\ +f_{\text {teff }}^{32_{-e e}}\left(\nu_{e *}\right) &= \frac{f_t}{1+0.26\left(1-f_t\right) \sqrt{\nu_{e *}}+0.18\left(1-0.37 f_t\right) \frac{\nu_{e *}}{\sqrt{Z}}} +\end{align*} +$$ + +$$ +F_{32 \_e i}(Y) = -\frac{0.56+1.93 Z}{Z(1+0.44 Z)}\left(Y-Y^4\right)+\frac{4.95}{1+2.48 Z}\left[Y^2-Y^4\right] \\ +-0.55\left(Y^3-Y^4\right)-\frac{1.2}{1+0.5 Z} Y^4 \\ +f_{\text {teff }}^{32 \_e i}\left(\nu_{e *}\right) = \frac{f_t}{1+\left(1+0.6 f_t\right) \sqrt{\nu_{e *}}+0.85\left(1-0.37 f_t\right) \nu_{e *}(1+Z)} +$$ + +The above is added to a call of `calculate_l31_coefficient()` and is then returned + +--------------- + +#### Calculate ion temperature coefficient | `calculate_l34_alpha_31_coefficient()` + +This function calculates and returns the $\left(1+\frac{\mathcal{L}_{34}}{\mathcal{L}_{31}}\alpha\right)\mathcal{L}_{31}$ coefficient value for $\frac{\partial \ln T_{\text{i}}}{\partial \psi}$. + +$$ +\mathcal{L}_{34}=F_{31}\left(X=f_{\text {teff }}^{34}\right) +$$ + +$$ +f_{\text {teff }}^{34}\left(\nu_{e *}\right)=\frac{f_t}{1+\left(1-0.1 f_t\right) \sqrt{\nu_{e *}}+0.5\left(1-0.5 f_t\right) \nu_{e *} / Z} +$$ + +$$ +\alpha_0=-\frac{1.17\left(1-f_t\right)}{1-0.22 f_t-0.19 f_t^2} +$$ + +$$ +\alpha\left(\nu_{i *}\right)=\left[\frac{\alpha_0+0.25\left(1-f_t^2\right) \sqrt{\nu_{i *}}}{1+0.5 \sqrt{\nu_{i *}}} \\ ++0.315 \nu_{i *}^2 f_t^6\right] \frac{1}{1+0.15 \nu_{i *}^2 f_t^6} +$$ + +The definition of $\alpha\left(\nu_{i *}\right)$ is that found in the erratum paper which changes the value of $-0.315\nu_{i *}^2 f_t^6$ to posotive.[^5] +The above is added to a call of `calculate_l31_coefficient()` and is then returned. + +------------- + +#### Calculate the Coloumb logarith | `coulomb_logarithm_sauter()` + +$$ +\ln \Lambda = 15.9 -0.5 \times \ln{n_{\text{e}}}+\ln{T_{\text{e}}} +$$ + +----------- + +#### Calculate frequency of electron collisions | `electron_collisions_sauter()` + +Using the Coulomb logarithm ($\ln \Lambda$) calculated from `coulomb_logarithm_sauter()` we get: + +$$ +\nu_{\text{e}} = 670 \times \frac{\ln \Lambda \times n_{\text{e}}}{T_{\text{e}}^{3/2}} +$$ + +------------ + +#### Calculate electron collisionality | `electron_collisionality_sauter()` + +The value coefficient origins are not known but thought to be derived from a condition of the [Bohm diffusion coefficient](https://en.wikipedia.org/wiki/Bohm_diffusion) + +Using the electron collision frequency ($\nu_{\text{e}}$) calculated from `electron_collisions_sauter()` we get: +$$ +\nu_{\text{e*}} = \frac{1.4 \ R \ \nu_{\text{e}} \ Z_{\text{eff}}}{\left|\frac{1}{q}\epsilon^{3/2}\sqrt{T_{\text{e}}}\times 1.875\times10^7\right|} +$$ + +------------- + +#### Calculate frequency of ion collisions | `ion_collisions_sauter()` + + +$$ +\nu_{\text{i}} = 320 \times \frac{Z_{\text{eff}}^4n_{\text{i}}}{T_{\text{i}}^{3/2}\sqrt{a_{\text{i}}}} +$$ + +----- + +#### Calculate ion collisionality | `ion_collisionality_sauter()` + +The value coefficient origins are not known but thought to be derived from a condition of the [Bohm diffusion coefficient](https://en.wikipedia.org/wiki/Bohm_diffusion) + +Using the ion collision frequency ($\nu_{\text{i}}$) calculated from `ion_collisions_sauter()` we get: + +$$ +\nu_{\text{e*}} = \frac{3.2\times10^{-6} \nu_{\text{i}} R}{\left|(\frac{1}{q}+0.0001)\epsilon^{3/2} \sqrt{\frac{T_{\text{i}}}{a_{\text{i}}}} \right|} +$$ + +---------------- + +### Sakai Scaling | `bootstrap_fraction_sakai()` + +Is selected by setting `i_bootstrap_current = 5`[^5] + +$$ +f_{\text{BS}} = 10^{0.951 \epsilon - 0.948} \cdot \beta_p^{1.226 \epsilon + 1.584} \cdot l_i^{-0.184\epsilon - 0.282} \cdot \left(\frac{q_{95}}{q_0}\right)^{-0.042 \epsilon - 0.02} \\ +\cdot \alpha_n^{0.13 \epsilon + 0.05} \cdot \alpha_t^{0.502 \epsilon - 0.273} +$$ + +The model includes the toroidal diamagnetic current in the calculation due to the dataset, so `i_diamagnetic_current = 0` can only be used with it + +--------------------- + +[^0]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', +[^1]: Nevins, W. M. "Summary report: ITER specialists’ meeting on heating and current drive." ITER-TN-PH-8-4, June 1988. 1988. +[^2]: Keii Gi, Makoto Nakamura, Kenji Tobita, Yasushi Ono, Bootstrap current fraction scaling for a tokamak reactor design study, +Fusion Engineering and Design, Volume 89, Issue 11, 2014, Pages 2709-2715, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2014.07.009. +[^3]: Wilson, H.R. (1992). Bootstrap current scaling in tokamaks. Nuclear Fusion, 32(2), pp.257–263. doi:https://doi.org/10.1088/0029-5515/32/2/i05. +[^4]: O. Sauter, C. Angioni, Y. R. Lin-Liu; Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 +[^5]: O. Sauter, C. Angioni, Y. R. Lin-Liu; Erratum: “Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime” [Phys. Plasmas 6, 2834 (1999)]. Phys. Plasmas 1 December 2002; 9 (12): 5140. https://doi.org/10.1063/1.1517052 +[^6]: Ryosuke Sakai, Takaaki Fujita, Atsushi Okamoto, Derivation of bootstrap current fraction scaling formula for 0-D system code analysis, Fusion Engineering and Design, Volume 149, 2019, 111322, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2019.111322. + + From d00f786fed0866677e752e17001af8e3aa183f5d Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 17 Sep 2024 10:10:42 +0100 Subject: [PATCH 058/108] Turn i_plasma_current = 1 into a callable function named calculate_current_coefficient_peng() --- .../plasma_current/plasma_current.md | 2 +- process/physics.py | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index e27ab2d8f6..ebaf5fa640 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -39,7 +39,7 @@ the switch `i_plasma_current`, as follows: ------------ -#### Peng analytic fit +#### Peng analytic fit | `calculate_current_coefficient_peng()` Switch value: `i_plasma_current = 1` diff --git a/process/physics.py b/process/physics.py index 1ada8f9202..2d9d9e4a1f 100644 --- a/process/physics.py +++ b/process/physics.py @@ -143,6 +143,20 @@ def calculate_poloidal_field( return bt * (ff1 + ff2) / (2.0 * np.pi * qbar) +def calculate_current_coefficient_peng(eps: float, sf: float) -> float: + """ + Calculate the plasma current scaling coefficient for the Peng scaling from the STAR code. + + Parameters: + - eps: float, plasma inverse aspect ratio + - sf: float, shaping factor calculated in the poloidal perimeter function + + References: + - None + """ + return (1.22 - 0.68 * eps) / ((1.0 - eps * eps) ** 2) * sf**2 + + @nb.jit(nopython=True, cache=True) def calculate_plasma_current_peng( qbar: float, @@ -2656,7 +2670,7 @@ def calculate_plasma_current( # Peng analytical fit if i_plasma_current == 1: - fq = (1.22 - 0.68 * eps) / ((1.0 - eps * eps) ** 2) * sf**2 + fq = calculate_current_coefficient_peng(eps, sf) # Peng scaling for double null divertor; TARTs [STAR Code] elif i_plasma_current == 2: From c4e6b3b0ba5c34557abb0dfa545e372d79adc4f8 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 17 Sep 2024 10:21:01 +0100 Subject: [PATCH 059/108] Refactor ITER IPDG89 scaling to use a callable function Instead of directly calculating the fq coefficient for ITER IPDG89 scaling in the Physics class, refactor the code to use a callable function named calculate_current_coefficient_ipdg89(). This function takes in the plasma parameters (eps, kappa95, and triang95) and returns the fq coefficient based on the given parameters. This improves code readability and maintainability. References: - N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989' - T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 --- .../plasma_current/plasma_current.md | 2 +- process/physics.py | 37 ++++++++++++++----- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index ebaf5fa640..6bd0b87bd0 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -93,7 +93,7 @@ f_q = 1 $$ ----------------- -#### ITER IPDG89 scaling +#### ITER IPDG89 scaling | `calculate_current_coefficient_ipdg89()` Switch value: `i_plasma_current = 4`[^5] [^7] diff --git a/process/physics.py b/process/physics.py index 2d9d9e4a1f..555bb4aaa6 100644 --- a/process/physics.py +++ b/process/physics.py @@ -212,6 +212,33 @@ def calculate_plasma_current_peng( ) +def calculate_current_coefficient_ipdg89(eps: float, kappa95: float, triang95: float) -> float: + """ + Calculate the fq coefficient from the IPDG89 guidlines used in the plasma current scaling. + + Parameters: + - eps: float, plasma inverse aspect ratio + - kappa95: float, plasma elongation 95% + - triang95: float, plasma triangularity 95% + + Returns: + - float, the fq plasma current coefficient + + This function calculates the fq coefficient used in the IPDG89 plasma current scaling, + based on the given plasma parameters. + + References: + - N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989' + - T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 + """ + return ( + 0.5 + * (1.17 - 0.65 * eps) + / ((1.0 - eps * eps) ** 2) + * (1.0 + kappa95**2 * (1.0 + 2.0 * triang95**2 - 1.2 * triang95**3)) + ) + + @nb.jit(nopython=True, cache=True) def conhas( alphaj: float, @@ -2684,15 +2711,7 @@ def calculate_plasma_current( # ITER formula (IPDG89) elif i_plasma_current == 4: - fq = ( - 0.5 - * (1.17 - 0.65 * eps) - / ((1.0 - eps * eps) ** 2) - * ( - 1.0 - + kappa95**2 * (1.0 + 2.0 * triang95**2 - 1.2 * triang95**3) - ) - ) + fq = calculate_current_coefficient_ipdg89(eps, kappa95, triang95) # Todd empirical scalings # D.C.Robinson and T.N.Todd, Plasma and Contr Fusion 28 (1986) 1181 From a573a7c41b498f39bfb2a5fc274e7ba567ad4663 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 17 Sep 2024 10:38:47 +0100 Subject: [PATCH 060/108] Refactor Connor-Hastie model to use a callable function named calculate_current_coefficient_hastie() --- .../plasma_current/plasma_current.md | 5 +---- process/physics.py | 14 +++++++++----- tests/unit/test_physics.py | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 6bd0b87bd0..664931d96e 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -146,7 +146,7 @@ $$ ------------------ -#### Connor-Hastie model +#### Connor-Hastie model | `calculate_current_coefficient_hastie()` Switch value: `i_plasma_current = 7` [^7] [^8] @@ -158,9 +158,6 @@ Asymptotically correct in the range of: Assumes a parabolic profile as seen [here](../profiles/plasma_profiles.md#parabolic-profile-l-mode) -Ran by the `conhas()` -function - $$ f_q = \left(\frac{(\kappa+1)^2}{2}\right)\left(1+\left(\frac{\kappa+1}{2}\right)^2\epsilon^2+\frac{1}{2}\Delta^{\prime 2}+2\frac{\Delta}{R_0} \\ + \frac{1}{2}\left(E^{\prime 2}+\frac{E^2}{r^2}\right)+\frac{1}{2}\left(T^{\prime 2}+\frac{4T^2}{r^2}\right)\right) diff --git a/process/physics.py b/process/physics.py index 555bb4aaa6..3082e5e2fb 100644 --- a/process/physics.py +++ b/process/physics.py @@ -240,7 +240,7 @@ def calculate_current_coefficient_ipdg89(eps: float, kappa95: float, triang95: f @nb.jit(nopython=True, cache=True) -def conhas( +def calculate_current_coefficient_hastie( alphaj: float, alphap: float, bt: float, @@ -251,7 +251,7 @@ def conhas( rmu0: float, ) -> float: """ - Routine to calculate the F coefficient used for scaling the plasma current. + Routine to calculate the f_q coefficient for the Connor-Hastie model used for scaling the plasma current. Parameters: - alphaj: float, the current profile index @@ -267,8 +267,12 @@ def conhas( - float, the F coefficient This routine calculates the F coefficient used for scaling the plasma current, - using the Connor-Hastie scaling given in AEA FUS 172: Physics Assessment for - the European Reactor Study. + using the Connor-Hastie scaling + + Reference: + - J.W.Connor and R.J.Hastie, Culham Lab Report CLM-M106 (1985). + https://scientific-publications.ukaea.uk/wp-content/uploads/CLM-M106-1.pdf + - T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 """ # Exponent in Connor-Hastie current profile - matching total # current gives the following trivial relation @@ -2733,7 +2737,7 @@ def calculate_plasma_current( # Connor-Hastie asymptotically-correct expression elif i_plasma_current == 7: # N.B. If iprofile=1, alphaj will be wrong during the first call (only) - fq = conhas(alphaj, alphap, bt, triang95, eps, kappa95, p0, constants.rmu0) + fq = calculate_current_coefficient_hastie(alphaj, alphap, bt, triang95, eps, kappa95, p0, constants.rmu0) # Sauter scaling allowing negative triangularity [FED May 2016] elif i_plasma_current == 8: diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 3cb1a563bd..eec5b44fc4 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -18,7 +18,7 @@ ps_fraction_scene, calculate_plasma_current_peng, culblm, - conhas, + calculate_current_coefficient_hastie, vscalc, rether, ) @@ -808,7 +808,7 @@ def test_culblm(): def test_conhas(): - assert conhas(5, 5, 12, 0.5, 0.33, 1.85, 2e3, constants.rmu0) == pytest.approx( + assert calculate_current_coefficient_hastie(5, 5, 12, 0.5, 0.33, 1.85, 2e3, constants.rmu0) == pytest.approx( 2.518876726889116 ) From 8d3005786fc9c12d2d24801920a584523966c315 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 09:58:48 +0100 Subject: [PATCH 061/108] Refactor Todd empirical scaling to use a callable function named calculate_current_coefficient_todd() --- .../plasma_current/plasma_current.md | 2 +- process/physics.py | 43 ++++++++++++++----- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 664931d96e..42a214101e 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -109,7 +109,7 @@ $$ -------------- -#### Todd empirical scaling, I +#### Todd empirical scaling, I | `calculate_current_coefficient_todd()` Switch value: `i_plasma_current = 5`[^6] [^7] diff --git a/process/physics.py b/process/physics.py index 3082e5e2fb..2ca4da3380 100644 --- a/process/physics.py +++ b/process/physics.py @@ -239,6 +239,36 @@ def calculate_current_coefficient_ipdg89(eps: float, kappa95: float, triang95: f ) +def calculate_current_coefficient_todd(eps: float, kappa95: float, triang95: float) -> float: + """ + Calculate the fq coefficient used in the Todd plasma current scaling. + + Parameters: + - eps: float, plasma inverse aspect ratio + - kappa95: float, plasma elongation 95% + - triang95: float, plasma triangularity 95% + + Returns: + - float, the fq plasma current coefficient + + This function calculates the fq coefficient based on the given plasma parameters for the Todd scaling. + + References: + - D.C.Robinson and T.N.Todd, Plasma and Contr Fusion 28 (1986) 1181 + - T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 + """ + return ( + (1.0 + 2.0 * eps**2) + * ((1.0 + kappa95**2) / 0.5) + * ( + 1.24 + - 0.54 * kappa95 + + 0.3 * (kappa95**2 + triang95**2) + + 0.125 * triang95 + ) + ) + + @nb.jit(nopython=True, cache=True) def calculate_current_coefficient_hastie( alphaj: float, @@ -2640,7 +2670,7 @@ def calculate_plasma_current( 1 = Peng analytic fit 2 = Peng divertor scaling (TART,STAR) 3 = Simple ITER scaling - 4 = Revised ITER scaling + 4 = IPDG89 scaling 5 = Todd empirical scaling I 6 = Todd empirical scaling II 7 = Connor-Hastie model @@ -2720,16 +2750,7 @@ def calculate_plasma_current( # Todd empirical scalings # D.C.Robinson and T.N.Todd, Plasma and Contr Fusion 28 (1986) 1181 elif i_plasma_current in [5, 6]: - fq = ( - (1.0 + 2.0 * eps**2) - * ((1.0 + kappa95**2) / 0.5) - * ( - 1.24 - - 0.54 * kappa95 - + 0.3 * (kappa95**2 + triang95**2) - + 0.125 * triang95 - ) - ) + fq = calculate_current_coefficient_todd(eps, kappa95, triang95) if i_plasma_current == 6: fq *= 1.0 + (abs(kappa95 - 1.2)) ** 3 From 6a63fff6b8271fafa1204c8204605d104a5ff153 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 10:12:01 +0100 Subject: [PATCH 062/108] Refactor Sauter model to use a callable function named calculate_current_coefficient_sauter() --- .../plasma_current/plasma_current.md | 2 +- process/physics.py | 44 ++++++++++++++----- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 42a214101e..5810ce0691 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -193,7 +193,7 @@ and the parameters $\lambda$ and $\nu$ characterise the current profile $J_{\phi --------------- -#### Sauter model, allows negative triangularity +#### Sauter model, allows negative triangularity | `calculate_current_coefficient_sauter()` Switch value: `i_plasma_current = 8`[^9] diff --git a/process/physics.py b/process/physics.py index 2ca4da3380..00bc1e88b8 100644 --- a/process/physics.py +++ b/process/physics.py @@ -352,6 +352,37 @@ def calculate_current_coefficient_hastie( ) +def calculate_current_coefficient_sauter(eps: float, kappa: float, triang: float, ) -> float: + """ + Routine to calculate the f_q coefficient for the Sauter model used for scaling the plasma current. + + Parameters: + - eps: float, inverse aspect ratio + - kappa: float, plasma elongation at the separatrix + - triang: float, plasma triangularity at the separatrix + + Returns: + - float, the fq coefficient + + Reference: + - O. Sauter, Geometric formulas for system codes including the effect of negative triangularity, + Fusion Engineering and Design, Volume 112, 2016, Pages 633-645, + ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2016.04.033. + """ + w07 = 1.0 # zero squareness - can be modified later if required + + fq = ( + (4.1e6 / 5.0e6) + * (1.0 + 1.2 * (kappa - 1.0) + 0.56 * (kappa - 1.0) ** 2) + * (1.0 + 0.09 * triang + 0.16 * triang**2) + * (1.0 + 0.45 * triang * eps) + / (1.0 - 0.74 * eps) + * (1.0 + 0.55 * (w07 - 1.0)) + ) + + return fq + + def nevins_integral( y: float, dene: float, @@ -2761,19 +2792,10 @@ def calculate_plasma_current( fq = calculate_current_coefficient_hastie(alphaj, alphap, bt, triang95, eps, kappa95, p0, constants.rmu0) # Sauter scaling allowing negative triangularity [FED May 2016] + # https://doi.org/10.1016/j.fusengdes.2016.04.033. elif i_plasma_current == 8: # Assumes zero squareness, note takes kappa, delta at separatrix not _95 - - w07 = 1.0 # zero squareness - can be modified later if required - - fq = ( - (4.1e6 / 5.0e6) - * (1.0 + 1.2 * (kappa - 1.0) + 0.56 * (kappa - 1.0) ** 2) - * (1.0 + 0.09 * triang + 0.16 * triang**2) - * (1.0 + 0.45 * triang * eps) - / (1.0 - 0.74 * eps) - * (1.0 + 0.55 * (w07 - 1.0)) - ) + fq = calculate_current_coefficient_sauter(eps, kappa, triang) elif i_plasma_current == 9: fq = 0.538 * (1.0 + 2.440 * eps**2.736) * kappa**2.154 * triang**0.060 From e96d6001e81d4c593d4015c231cb749fe4113446 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 10:26:16 +0100 Subject: [PATCH 063/108] Refactor the FIESTA plasma current scaling to use a callable function --- .../plasma_current/plasma_current.md | 4 +-- process/physics.py | 25 ++++++++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 5810ce0691..725b730e72 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -212,12 +212,10 @@ $$ ---------------------- -#### FIESTA for ST's: +#### FIESTA for ST's | `calculate_current_coefficient_fiesta()` Switch value: `i_plasma_current = 9`[^10] - - Assumptions: - D-shaped plasmas with $A < 3$: diff --git a/process/physics.py b/process/physics.py index 00bc1e88b8..c9a1f07963 100644 --- a/process/physics.py +++ b/process/physics.py @@ -383,6 +383,27 @@ def calculate_current_coefficient_sauter(eps: float, kappa: float, triang: float return fq +def calculate_current_coefficient_fiesta(eps: float, kappa: float, triang: float) -> float: + """ + Calculate the fq coefficient used in the FIESTA plasma current scaling. + + Parameters: + - eps: float, plasma inverse aspect ratio + - kappa: float, plasma elongation at the separatrix + - triang: float, plasma triangularity at the separatrix + + Returns: + - float, the fq plasma current coefficient + + This function calculates the fq coefficient based on the given plasma parameters for the FIESTA scaling. + + References: + - S.Muldrew et.al,“PROCESS”: Systems studies of spherical tokamaks, Fusion Engineering and Design, + Volume 154, 2020, 111530, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2020.111530. + """ + return 0.538 * (1.0 + 2.440 * eps**2.736) * kappa**2.154 * triang**0.060 + + def nevins_integral( y: float, dene: float, @@ -2797,8 +2818,10 @@ def calculate_plasma_current( # Assumes zero squareness, note takes kappa, delta at separatrix not _95 fq = calculate_current_coefficient_sauter(eps, kappa, triang) + # FIESTA ST scaling + # https://doi.org/10.1016/j.fusengdes.2020.111530. elif i_plasma_current == 9: - fq = 0.538 * (1.0 + 2.440 * eps**2.736) * kappa**2.154 * triang**0.060 + fq = calculate_current_coefficient_fiesta(eps, kappa, triang) else: raise ValueError(f"Invalid value {i_plasma_current=}") From 86ac02e3165cf1617bb782a6039205525ed4dcbb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 10:35:57 +0100 Subject: [PATCH 064/108] Re-arrange physics.py again to group function and add section for the Nevins bootstrap integral --- process/physics.py | 270 +++++++++++++++++++++++---------------------- 1 file changed, 138 insertions(+), 132 deletions(-) diff --git a/process/physics.py b/process/physics.py index c9a1f07963..73d98d0faf 100644 --- a/process/physics.py +++ b/process/physics.py @@ -29,6 +29,139 @@ process_output as po, ) + +@nb.jit(nopython=True, cache=True) +def rether(alphan, alphat, dene, dlamie, te, ti, zeffai): + """Routine to find the equilibration power between the + ions and electrons + author: P J Knight, CCFE, Culham Science Centre + alphan : input real : density profile index + alphat : input real : temperature profile index + dene : input real : electron density (/m3) + dlamie : input real : ion-electron coulomb logarithm + te : input real : electron temperature (keV) + ti : input real : ion temperature (keV) + zeffai : input real : mass weighted plasma effective charge + piepv : output real : ion/electron equilibration power (MW/m3) + This routine calculates the equilibration power between the + ions and electrons. + Unknown origin + """ + profie = (1.0 + alphan) ** 2 / ( + (2.0 * alphan - 0.5 * alphat + 1.0) * np.sqrt(1.0 + alphat) + ) + conie = 2.42165e-41 * dlamie * dene**2 * zeffai * profie + + return conie * (ti - te) / (te**1.5) + + +@nb.jit(nopython=True, cache=True) +def vscalc( + csawth, + eps, + facoh, + gamma, + kappa, + rmajor, + rplas, + plascur, + t_fusion_ramp, + tburn, + rli, + rmu0, +): + """Volt-second requirements + author: P J Knight, CCFE, Culham Science Centre + csawth : input real : coefficient for sawteeth effects + eps : input real : inverse aspect ratio + facoh : input real : fraction of plasma current produced inductively + gamma : input real : Ejima coeff for resistive start-up V-s component + kappa : input real : plasma elongation + plascur: input real : plasma current (A) + rli : input real : plasma normalised inductivity + rmajor : input real : plasma major radius (m) + rplas : input real : plasma resistance (ohm) + t_fusion_ramp : input real : heating time (s) + tburn : input real : burn time (s) + phiint : output real : internal plasma volt-seconds (Wb) + rlp : output real : plasma inductance (H) + vsbrn : output real : volt-seconds needed during flat-top (heat+burn) (Wb) + vsind : output real : internal and external plasma inductance V-s (Wb) + vsres : output real : resistive losses in start-up volt-seconds (Wb) + vsstt : output real : total volt-seconds needed (Wb) + This subroutine calculates the volt-second requirements and some + other related items. + """ + # Internal inductance + + rlpint = rmu0 * rmajor * rli / 2.0 + phiint = rlpint * plascur + + # Start-up resistive component + # Uses ITER formula without the 10 V-s add-on + + vsres = gamma * rmu0 * plascur * rmajor + + # Hirshman, Neilson: Physics of Fluids, 29 (1986) p790 + # fit for external inductance + + aeps = (1.0 + 1.81 * np.sqrt(eps) + 2.05 * eps) * np.log(8.0 / eps) - ( + 2.0 + 9.25 * np.sqrt(eps) - 1.21 * eps + ) + beps = ( + 0.73 * np.sqrt(eps) * (1.0 + 2.0 * eps**4 - 6.0 * eps**5 + 3.7 * eps**6) + ) + rlpext = rmajor * rmu0 * aeps * (1.0 - eps) / (1.0 - eps + beps * kappa) + + rlp = rlpext + rlpint + + # Inductive V-s component + + vsind = rlp * plascur + vsstt = vsres + vsind + + # Loop voltage during flat-top + # Include enhancement factor in flattop V-s requirement + # to account for MHD sawtooth effects. + + vburn = plascur * rplas * facoh * csawth + + # N.B. tburn on first iteration will not be correct + # if the pulsed reactor option is used, but the value + # will be correct on subsequent calls. + + vsbrn = vburn * (t_fusion_ramp + tburn) + vsstt = vsstt + vsbrn + + return phiint, rlp, vsbrn, vsind, vsres, vsstt + + +@nb.jit(nopython=True, cache=True) +def culblm(bt, dnbeta, plascur, rminor): + """Beta scaling limit + author: P J Knight, CCFE, Culham Science Centre + bt : input real : toroidal B-field on plasma axis (T) + dnbeta : input real : Troyon-like g coefficient + plascur : input real : plasma current (A) + rminor : input real : plasma minor axis (m) + betalim : output real : beta limit as defined below + This subroutine calculates the beta limit, using + the algorithm documented in AEA FUS 172. + The limit applies to beta defined with respect to the total B-field. + Switch iculbl determines which components of beta to include. + + If iculbl = 0, then the limit is applied to the total beta + If iculbl = 1, then the limit is applied to the thermal beta only + If iculbl = 2, then the limit is applied to the thermal + neutral beam beta components + If iculbl = 3, then the limit is applied to the toroidal beta + + The default value for the g coefficient is dnbeta = 3.5 + AEA FUS 172: Physics Assessment for the European Reactor Study + """ + + return 0.01 * dnbeta * (plascur / 1.0e6) / (rminor * bt) + + # ----------------------------------------------------- # Plasma Current & Poloidal Field Calculations # ----------------------------------------------------- @@ -404,6 +537,11 @@ def calculate_current_coefficient_fiesta(eps: float, kappa: float, triang: float return 0.538 * (1.0 + 2.440 * eps**2.736) * kappa**2.154 * triang**0.060 +# -------------------------------- +# Bootstrap Current Calculations +# -------------------------------- + + def nevins_integral( y: float, dene: float, @@ -477,138 +615,6 @@ def nevins_integral( return (q / q95) * (al1 * (a1 + (pratio * (a1 + alphai * a2))) + al2 * a2) -@nb.jit(nopython=True, cache=True) -def rether(alphan, alphat, dene, dlamie, te, ti, zeffai): - """Routine to find the equilibration power between the - ions and electrons - author: P J Knight, CCFE, Culham Science Centre - alphan : input real : density profile index - alphat : input real : temperature profile index - dene : input real : electron density (/m3) - dlamie : input real : ion-electron coulomb logarithm - te : input real : electron temperature (keV) - ti : input real : ion temperature (keV) - zeffai : input real : mass weighted plasma effective charge - piepv : output real : ion/electron equilibration power (MW/m3) - This routine calculates the equilibration power between the - ions and electrons. - Unknown origin - """ - profie = (1.0 + alphan) ** 2 / ( - (2.0 * alphan - 0.5 * alphat + 1.0) * np.sqrt(1.0 + alphat) - ) - conie = 2.42165e-41 * dlamie * dene**2 * zeffai * profie - - return conie * (ti - te) / (te**1.5) - - -@nb.jit(nopython=True, cache=True) -def vscalc( - csawth, - eps, - facoh, - gamma, - kappa, - rmajor, - rplas, - plascur, - t_fusion_ramp, - tburn, - rli, - rmu0, -): - """Volt-second requirements - author: P J Knight, CCFE, Culham Science Centre - csawth : input real : coefficient for sawteeth effects - eps : input real : inverse aspect ratio - facoh : input real : fraction of plasma current produced inductively - gamma : input real : Ejima coeff for resistive start-up V-s component - kappa : input real : plasma elongation - plascur: input real : plasma current (A) - rli : input real : plasma normalised inductivity - rmajor : input real : plasma major radius (m) - rplas : input real : plasma resistance (ohm) - t_fusion_ramp : input real : heating time (s) - tburn : input real : burn time (s) - phiint : output real : internal plasma volt-seconds (Wb) - rlp : output real : plasma inductance (H) - vsbrn : output real : volt-seconds needed during flat-top (heat+burn) (Wb) - vsind : output real : internal and external plasma inductance V-s (Wb) - vsres : output real : resistive losses in start-up volt-seconds (Wb) - vsstt : output real : total volt-seconds needed (Wb) - This subroutine calculates the volt-second requirements and some - other related items. - """ - # Internal inductance - - rlpint = rmu0 * rmajor * rli / 2.0 - phiint = rlpint * plascur - - # Start-up resistive component - # Uses ITER formula without the 10 V-s add-on - - vsres = gamma * rmu0 * plascur * rmajor - - # Hirshman, Neilson: Physics of Fluids, 29 (1986) p790 - # fit for external inductance - - aeps = (1.0 + 1.81 * np.sqrt(eps) + 2.05 * eps) * np.log(8.0 / eps) - ( - 2.0 + 9.25 * np.sqrt(eps) - 1.21 * eps - ) - beps = ( - 0.73 * np.sqrt(eps) * (1.0 + 2.0 * eps**4 - 6.0 * eps**5 + 3.7 * eps**6) - ) - rlpext = rmajor * rmu0 * aeps * (1.0 - eps) / (1.0 - eps + beps * kappa) - - rlp = rlpext + rlpint - - # Inductive V-s component - - vsind = rlp * plascur - vsstt = vsres + vsind - - # Loop voltage during flat-top - # Include enhancement factor in flattop V-s requirement - # to account for MHD sawtooth effects. - - vburn = plascur * rplas * facoh * csawth - - # N.B. tburn on first iteration will not be correct - # if the pulsed reactor option is used, but the value - # will be correct on subsequent calls. - - vsbrn = vburn * (t_fusion_ramp + tburn) - vsstt = vsstt + vsbrn - - return phiint, rlp, vsbrn, vsind, vsres, vsstt - - -@nb.jit(nopython=True, cache=True) -def culblm(bt, dnbeta, plascur, rminor): - """Beta scaling limit - author: P J Knight, CCFE, Culham Science Centre - bt : input real : toroidal B-field on plasma axis (T) - dnbeta : input real : Troyon-like g coefficient - plascur : input real : plasma current (A) - rminor : input real : plasma minor axis (m) - betalim : output real : beta limit as defined below - This subroutine calculates the beta limit, using - the algorithm documented in AEA FUS 172. - The limit applies to beta defined with respect to the total B-field. - Switch iculbl determines which components of beta to include. - - If iculbl = 0, then the limit is applied to the total beta - If iculbl = 1, then the limit is applied to the thermal beta only - If iculbl = 2, then the limit is applied to the thermal + neutral beam beta components - If iculbl = 3, then the limit is applied to the toroidal beta - - The default value for the g coefficient is dnbeta = 3.5 - AEA FUS 172: Physics Assessment for the European Reactor Study - """ - - return 0.01 * dnbeta * (plascur / 1.0e6) / (rminor * bt) - - # ----------------------------------------------------- # Diamagnetic and Pfirsch-Schlüter Current Calculations # ----------------------------------------------------- From dca1504cbe2bbe635cefd898ccc353be74f1c268 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 11:59:43 +0100 Subject: [PATCH 065/108] Add documentation about the electron and ion local poloidal beta corrections for the Sauter bootstrap current model --- .../plasma_current/bootstrap_current.md | 43 +++++++++++++++++++ process/physics.py | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index 97510baacf..d37abcd82b 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -305,6 +305,49 @@ $$ ---------------- +#### Calculate electron only poloidal beta correction | `beta_poloidal_sauter()` + +This function returns an electron only local poloidal beta correction dependant on the array index of the profile. + +If the current index is not equal to the size value (or end of the array) then the following is returned: + +$$ +\frac{1.6\times 10^{-4}\pi R \left(n_{\text{e}}+n_{\text{e-1}}\right)\times \left(T_{\text{e}}+T_{\text{e-1}}\right)}{\left(B_{\text{T}}\rho_{-1}\left|\left(\frac{1}{q}\right)_{-1}+1\times 10^{-4}\right|\right)^2} +$$ + +Otherwise the following is returned: + +$$ +\frac{6.4\times 10^{-4}\pi R \left(n_{\text{e-1}}T_{\text{e-1}}\right)}{\left(B_{\text{T}}\rho_{-1}\left|\left(\frac{1}{q}\right)_{-1}+1\times 10^{-4}\right|\right)^2} +$$ + +The $-1$ subscript in this case refers to the value of the variable in the previous array index value + + + +--------------- + +#### Calculate ion and electron poloidal beta correction | `beta_poloidal_total_sauter()` + +This function returns the local poloidal beta correction with both electron and ion pressure dependant on the array index of the profile. + +If the current index is not equal to the size value (or end of the array) then the following is returned: + +$$ +\frac{1.6\times 10^{-4}\pi R \left[\left(\left(n_{\text{e}}+n_{\text{e-1}}\right)\times \left(T_{\text{e}}+T_{\text{e-1}}\right)\right)+\left(\left(n_{\text{i}}+n_{\text{i-1}}\right)\times \left(T_{\text{i}}+T_{\text{i-1}}\right)\right)\right]}{\left(B_{\text{T}}\rho_{-1}\left|\left(\frac{1}{q}\right)_{-1}+1\times 10^{-4}\right|\right)^2} +$$ + +Otherwise the following is returned: + +$$ +\frac{6.4\times 10^{-4}\pi R \left[\left(n_{\text{e-1}}T_{\text{e-1}}\right)+\left(n_{\text{i-1}}T_{\text{i-1}}\right)\right]}{\left(B_{\text{T}}\rho_{-1}\left|\left(\frac{1}{q}\right)_{-1}+1\times 10^{-4}\right|\right)^2} +$$ + +The $-1$ subscript in this case refers to the value of the variable in the previous array index value + + +------------------ + ### Sakai Scaling | `bootstrap_fraction_sakai()` Is selected by setting `i_bootstrap_current = 5`[^5] diff --git a/process/physics.py b/process/physics.py index 73d98d0faf..aa68da7538 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1320,7 +1320,7 @@ def beta_poloidal_total_sauter( Parameters: - radial_elements: np.ndarray, radial element indexes in range 1 to nr - - nr: int, maximum value of j + - nr: int, maximum value of radial_elements - rmajor: float, plasma major radius (m) - bt: float, toroidal field on axis (T) - ne: np.ndarray, electron density profile (/m^3) From f133bad1df61dded5d442167ec1747a276f47ea4 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 12:29:59 +0100 Subject: [PATCH 066/108] Add descriptions and links about how the different Sauter bootstrap function coefficients are scaled with the poloidal beta corrections and discuss this correction in the docs of the main model --- .../plasma_current/bootstrap_current.md | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index d37abcd82b..c89ea25d0b 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -193,6 +193,16 @@ $$ +R_{p e}\left(\mathcal{L}_{31}+\mathcal{L}_{32}\right) \frac{\partial \ln T_e}{\partial \psi}+\left(1-R_{p e}\right) \times\left(1+\frac{\mathcal{L}_{34}}{\mathcal{L}_{31}} \alpha\right) \mathcal{L}_{31} \frac{\partial \ln T_i}{\partial \psi}\right] $$ +Note that the above $\left\langle j_{\|} B\right\rangle$ given by Sauter et.al.[^4] gives the component of the current density in the direction of the field – not the toroidal component of the current. The error is second order in the pitch angle, but can be important, especially in the outboard region of a low aspect ratio tokamak, where the pitch angle is large. Moreover this error will always have the effect of overestimating the current. This is accounted for via poloidal correction function implemented as: [`beta_poloidal_sauter()`](#calculate-electron-only-poloidal-beta-correction-beta_poloidal_sauter) and[`beta_poloidal_total_sauter()`](#calculate-ion-and-electron-poloidal-beta-correction-beta_poloidal_total_sauter) + +The correction is of the form: + +$$ +I_{\phi}^{\text{bs}} = 2\pi \int d\psi \frac{q(\psi)}{\langle B^{2}\rangle} \left\langle j_{\|} B\right\rangle +$$ + +where $q(\psi)$ is the safety factor. + ----------- #### Calculate electron density coefficient | `calculate_l31_coefficient()` @@ -204,6 +214,8 @@ $$ f_{\text {teff }}^{31}\left(\nu_{e *}\right)= \frac{f_t}{1+\left(1-0.1 f_t\right) \sqrt{\nu_{e *}}+0.5\left(1-f_t\right) \nu_{e *} / Z} $$ +The returned value is $\mathcal{L}_{31} \times$ [`beta_poloidal_total_sauter()`](#calculate-ion-and-electron-poloidal-beta-correction-beta_poloidal_total_sauter) + --------------- #### Calculate electron temperature coefficient | `calculate_l31_32_coefficient()` @@ -225,7 +237,9 @@ F_{32 \_e i}(Y) = -\frac{0.56+1.93 Z}{Z(1+0.44 Z)}\left(Y-Y^4\right)+\frac{4.95} f_{\text {teff }}^{32 \_e i}\left(\nu_{e *}\right) = \frac{f_t}{1+\left(1+0.6 f_t\right) \sqrt{\nu_{e *}}+0.85\left(1-0.37 f_t\right) \nu_{e *}(1+Z)} $$ -The above is added to a call of `calculate_l31_coefficient()` and is then returned +The above is added to a call of [`calculate_l31_coefficient()`](#calculate-electron-density-coefficient-calculate_l31_coefficient). This is then multiplied by [`beta_poloidal_sauter()`](#calculate-electron-only-poloidal-beta-correction-beta_poloidal_sauter). + +This product above is then multplied by ([`beta_poloidal_sauter()`](#calculate-electron-only-poloidal-beta-correction-beta_poloidal_sauter) divided by [`beta_poloidal_total_sauter()`](#calculate-ion-and-electron-poloidal-beta-correction-beta_poloidal_total_sauter)) --------------- @@ -251,7 +265,10 @@ $$ $$ The definition of $\alpha\left(\nu_{i *}\right)$ is that found in the erratum paper which changes the value of $-0.315\nu_{i *}^2 f_t^6$ to posotive.[^5] -The above is added to a call of `calculate_l31_coefficient()` and is then returned. + +The return sequence is ([`beta_poloidal_total_sauter()`](#calculate-ion-and-electron-poloidal-beta-correction-beta_poloidal_total_sauter) - [`beta_poloidal_sauter()`](#calculate-electron-only-poloidal-beta-correction-beta_poloidal_sauter)) $\times (\mathcal{L}_{34} + \alpha)$ + [`calculate_l31_coefficient()`](#calculate-electron-density-coefficient-calculate_l31_coefficient) $\times$ (1.0 - [`beta_poloidal_sauter()`](#calculate-electron-only-poloidal-beta-correction-beta_poloidal_sauter) divided by [`beta_poloidal_total_sauter()`](#calculate-ion-and-electron-poloidal-beta-correction-beta_poloidal_total_sauter)) + + ------------- From 18204ae01ab681e8c198b1b0181c53951aa800da Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 13:22:58 +0100 Subject: [PATCH 067/108] Add documentation for setting maximum desirable bootstrap current fraction and fixing the bootstrap current fraction --- .../plasma_current/bootstrap_current.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index c89ea25d0b..a7acecce7c 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -378,6 +378,26 @@ The model includes the toroidal diamagnetic current in the calculation due to th --------------------- +## Setting of maximum desireable bootstrap current fraction + +The variable `bootstrap_current_fraction_max` can be set to the value of maximum desireable bootstrap current fraction for a specific design. When optimsiing if the value of the calculated `bootstrap_current_fraction` for the model selected with `i_bootstrap_current` exceeds this value, then `bootstrap_current_fraction` is set to the value of `bootstrap_current_fraction_max`. + +An error is also raised to the user in the terminal output at the end of the run saying "Bootstrap fraction upper limit enforced". + +## Fixing the bootstrap current fraction + +If the user wants to set the value of the bootrap current fraction directly then the value can be set by assigning the negative of the desired value to `bootstrap_current_fraction_max`. + + +```txt +>>> IN.DAT + +# Setting a fixed bootstrap current fraction of 80% + +bootstrap_current_fraction_max = -0.8 +``` + + [^0]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', [^1]: Nevins, W. M. "Summary report: ITER specialists’ meeting on heating and current drive." ITER-TN-PH-8-4, June 1988. 1988. [^2]: Keii Gi, Makoto Nakamura, Kenji Tobita, Yasushi Ono, Bootstrap current fraction scaling for a tokamak reactor design study, From 3b244cd3922b4801b3290a0eb7bf9664e4acbf15 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 13:28:10 +0100 Subject: [PATCH 068/108] Rename diaipf to diamagnetic_current_fraction --- process/current_drive.py | 4 ++-- process/physics.py | 10 +++++----- source/fortran/current_drive_variables.f90 | 4 ++-- tests/unit/test_current_drive.py | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index d902d17a4a..b562bbf3d6 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -916,8 +916,8 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Diamagnetic fraction", - "(diaipf)", - current_drive_variables.diaipf, + "(diamagnetic_current_fraction)", + current_drive_variables.diamagnetic_current_fraction, "OP ", ) po.ovarrf( diff --git a/process/physics.py b/process/physics.py index aa68da7538..0422fdccef 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1597,9 +1597,9 @@ def physics(self): ) if physics_variables.i_diamagnetic_current == 1: - current_drive_variables.diaipf = current_drive_variables.diacf_hender + current_drive_variables.diamagnetic_current_fraction = current_drive_variables.diacf_hender elif physics_variables.i_diamagnetic_current == 2: - current_drive_variables.diaipf = current_drive_variables.diacf_scene + current_drive_variables.diamagnetic_current_fraction = current_drive_variables.diacf_scene # ***************************** # # PFIRSCH-SCHLÜTER CURRENT # @@ -1719,7 +1719,7 @@ def physics(self): current_drive_variables.plasma_current_internal_fraction = ( current_drive_variables.bootstrap_current_fraction - + current_drive_variables.diaipf + + current_drive_variables.diamagnetic_current_fraction + current_drive_variables.psipf ) @@ -4872,8 +4872,8 @@ def outplas(self): po.ovarrf( self.outfile, "Diamagnetic fraction (enforced)", - "(diaipf.)", - current_drive_variables.diaipf, + "(diamagnetic_current_fraction.)", + current_drive_variables.diamagnetic_current_fraction, "OP ", ) po.ovarrf( diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 03e6a23962..c6aeef7f7d 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -57,7 +57,7 @@ module current_drive_variables real(dp) :: diacf_scene !! diamagnetic current fraction, SCENE fit - real(dp) :: diaipf + real(dp) :: diamagnetic_current_fraction !! diamagnetic current fraction real(dp) :: echpwr @@ -247,7 +247,7 @@ subroutine init_current_drive_variables cnbeam = 0.0D0 diacf_hender = 0.0D0 diacf_scene = 0.0D0 - diaipf = 0.0D0 + diamagnetic_current_fraction = 0.0D0 echpwr = 0.0D0 echwpow = 0.0D0 effcd = 0.0D0 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index b0383e1b45..5b49a2a3f9 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -108,7 +108,7 @@ class CudrivParam(NamedTuple): rtanmax: Any = None - diaipf: Any = None + diamagnetic_current_fraction: Any = None psipf: Any = None @@ -246,7 +246,7 @@ class CudrivParam(NamedTuple): frbeam=1.05, rtanbeam=0, rtanmax=0, - diaipf=0, + diamagnetic_current_fraction=0, psipf=0, plasma_current_internal_fraction=0.27635918746616817, harnum=1, @@ -336,7 +336,7 @@ class CudrivParam(NamedTuple): frbeam=1.05, rtanbeam=8.4000000000000004, rtanmax=13.179564451855533, - diaipf=0, + diamagnetic_current_fraction=0, psipf=0, plasma_current_internal_fraction=0.27635918746616817, harnum=1, @@ -485,7 +485,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(current_drive_variables, "rtanmax", cudrivparam.rtanmax) - monkeypatch.setattr(current_drive_variables, "diaipf", cudrivparam.diaipf) + monkeypatch.setattr(current_drive_variables, "diamagnetic_current_fraction", cudrivparam.diamagnetic_current_fraction) monkeypatch.setattr(current_drive_variables, "psipf", cudrivparam.psipf) From 8d69fe0d747b4f052518fe87ac02ebcb8680e823 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 18 Sep 2024 14:31:16 +0100 Subject: [PATCH 069/108] Add documentation for plasma current ramp-up time lower limit and plasma and rod current fraction upper limit constraints --- .../plasma_current/plasma_current.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 725b730e72..37d1c626ec 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -375,6 +375,26 @@ $$ y_2 = \frac{\sqrt{c_2\epsilon+1}}{1-\epsilon}\frac{1-\delta}{\kappa} $$ +----------------------- + +## Key Constraints + +----------------------- + +### Plasma current ramp-up time lower limit + +This constraint can be activated by stating `icc = 41` in the input file. + +The value of `tohsm` can be set to the required minimum plasma current ramp up time at the start of a pulse. The scaling value `ftohs` can be varied also + +The calculated plasma current ramp up time `tohs` is dictated by the [pulsed plant operation configuration](../pulsed-plant.md). + +This constraint will ensure that the value of `tohs` is always greater than or equal to `tohsm` + +-------------------- + +### Plasma and Rod current fraction upper limit + [^3]: Peng, Y. K. M., Galambos, J. D., & Shipe, P. C. (1992). 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), 1729–1738. https://doi.org/10.13182/FST92-A29971 [^4]: J.D. Galambos, 'STAR Code : Spherical Tokamak Analysis and Reactor Code', Unpublished internal Oak Ridge document. From 861e7b7d7fac7d5af74f46f0006de393ab587dbb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 19 Sep 2024 10:34:25 +0100 Subject: [PATCH 070/108] Add bokeh plot to show difference between current profiles for the Connor-Hastie plasma current scaling --- .../plasma_current/plasma_current.md | 94 ++++++++++++++++++- process/physics.py | 5 +- 2 files changed, 91 insertions(+), 8 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 37d1c626ec..03c23555ca 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -156,8 +156,6 @@ Asymptotically correct in the range of: - $\delta \ll 1$ - $(\kappa - 1) \ll 1$ -Assumes a parabolic profile as seen [here](../profiles/plasma_profiles.md#parabolic-profile-l-mode) - $$ f_q = \left(\frac{(\kappa+1)^2}{2}\right)\left(1+\left(\frac{\kappa+1}{2}\right)^2\epsilon^2+\frac{1}{2}\Delta^{\prime 2}+2\frac{\Delta}{R_0} \\ + \frac{1}{2}\left(E^{\prime 2}+\frac{E^2}{r^2}\right)+\frac{1}{2}\left(T^{\prime 2}+\frac{4T^2}{r^2}\right)\right) @@ -187,9 +185,95 @@ $$ \frac{\Delta}{R_0} = \frac{\beta_0}{6}\left[1+\frac{5}{6}\lambda+\frac{1}{4}\lambda^2\right]+\left(\frac{\kappa+1}{2}\epsilon\right)^2 \frac{1}{8}\left(1-\frac{\lambda^2}{3}\right) $$ -and the parameters $\lambda$ and $\nu$ characterise the current profile $J_{\phi} = \frac{j_0}{(1+\lambda r^2)^2}$ and pressure profile $p = p_0(1-r^2)^{\nu}$ - - +The parameters $\lambda$ and $\nu$ characterise the current profile $J_{\phi} = \frac{j_0}{(1+\lambda r^2)^2}$ and pressure profile $p = p_0(1-r^2)^{\nu}$. The pressure profile used by Connor-Hastie is still of the normal parabolic type. + + +!!! warning Assumed current profiles + + Since $\lambda$ in this case is treated as the current profile index `alphaj` within PROCESS will use its assumed standard [parabolic profile](../profiles/plasma_profiles.md`). Even though the profile given above by Connor-Hastie is different. The differenc between these two assumed current profiles can be experimented with below. + + + + + + + +My Bokeh Plot + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + --------------- diff --git a/process/physics.py b/process/physics.py index 0422fdccef..23198b3ea0 100644 --- a/process/physics.py +++ b/process/physics.py @@ -429,7 +429,7 @@ def calculate_current_coefficient_hastie( Returns: - float, the F coefficient - This routine calculates the F coefficient used for scaling the plasma current, + This routine calculates the f_q coefficient used for scaling the plasma current, using the Connor-Hastie scaling Reference: @@ -437,8 +437,7 @@ def calculate_current_coefficient_hastie( https://scientific-publications.ukaea.uk/wp-content/uploads/CLM-M106-1.pdf - T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 """ - # Exponent in Connor-Hastie current profile - matching total - # current gives the following trivial relation + # Exponent in Connor-Hastie current profile lamda = alphaj # Exponent in Connor-Hastie pressure profile From 5551b66ceba323bb3bf64e9d119c66ab3667ecef Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 19 Sep 2024 14:18:34 +0100 Subject: [PATCH 071/108] Remove the calculation of qbar from the top of physics() and place it into the plasma current calculations that require it only. This prevents the wrong definition of q95 propagating to other models in the run --- process/physics.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/process/physics.py b/process/physics.py index 23198b3ea0..b0d224533b 100644 --- a/process/physics.py +++ b/process/physics.py @@ -227,7 +227,7 @@ def _plascar_bpol( def calculate_poloidal_field( i_plasma_current: int, ip: float, - qbar: float, + q95: float, aspect: float, eps: float, bt: float, @@ -242,7 +242,7 @@ def calculate_poloidal_field( Parameters: - i_plasma_current: int, current scaling model to use - ip: float, plasma current (A) - - qbar: float, edge q-bar + - q95: float, 95% flux surface safety factor - aspect: float, plasma aspect ratio - eps: float, inverse aspect ratio - bt: float, toroidal field on axis (T) @@ -273,6 +273,9 @@ def calculate_poloidal_field( # Use the relation from Peng, Galambos and Shipe (1992) [STAR code] otherwise ff1, ff2, _, _ = _plascar_bpol(aspect, eps, kappa, delta) + # Transform q95 to qbar + qbar = (physics_variables.q * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0) + return bt * (ff1 + ff2) / (2.0 * np.pi * qbar) @@ -292,7 +295,7 @@ def calculate_current_coefficient_peng(eps: float, sf: float) -> float: @nb.jit(nopython=True, cache=True) def calculate_plasma_current_peng( - qbar: float, + q95: float, aspect: float, eps: float, rminor: float, @@ -304,7 +307,7 @@ def calculate_plasma_current_peng( Function to calculate plasma current (Peng scaling from the STAR code) Parameters: - - qbar: float, edge q-bar + - q95: float, 95% flux surface safety factor - aspect: float, plasma aspect ratio - eps: float, inverse aspect ratio - rminor: float, plasma minor radius (m) @@ -328,6 +331,9 @@ def calculate_plasma_current_peng( 1729–1738. https://doi.org/10.13182/FST92-A29971 """ + # Transform q95 to qbar + qbar = (physics_variables.q * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0) + ff1, ff2, d1, d2 = _plascar_bpol(aspect, eps, kappa, delta) e1 = (2.0 * kappa) / (d1 * (1.0 + delta)) @@ -1449,24 +1455,18 @@ def physics(self): Routine to calculate tokamak plasma physics information author: P J Knight, CCFE, Culham Science Centre None - This routine calculates all the primary plasma physics - M. Kovari et al, 2014, "PROCESS": A systems code for fusion power plants - - Part 1: Physics https://www.sciencedirect.com/science/article/pii/S0920379614005961 - H. Zohm et al, 2013, On the Physics Guidelines for a Tokamak DEMO - https://iopscience.iop.org/article/10.1088/0029-5515/53/7/073019 - T. Hartmann, 2013, Development of a modular systems code to analyse the - implications of physics assumptions on the design of a demonstration fusion power plant - https://inis.iaea.org/search/search.aspx?orig_q=RN:45031642 + This routine calculates all the primary plasma physics parameters for a tokamak fusion reactor. + + References: + - M. Kovari et al, 2014, "PROCESS": A systems code for fusion power plants - Part 1: Physics + https://www.sciencedirect.com/science/article/pii/S0920379614005961 + - H. Zohm et al, 2013, On the Physics Guidelines for a Tokamak DEMO + https://iopscience.iop.org/article/10.1088/0029-5515/53/7/073019 + - T. Hartmann, 2013, Development of a modular systems code to analyse the implications of physics assumptions on the design of a demonstration fusion power plant + https://inis.iaea.org/search/search.aspx?orig_q=RN:45031642 """ - if physics_variables.i_plasma_current == 2: - physics_variables.q95 = ( - physics_variables.q * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0 - ) - else: - physics_variables.q95 = ( - physics_variables.q - ) # i.e. input (or iteration variable) value + physics_variables.q95 = physics_variables.q # Calculate plasma composition # Issue #261 Remove old radiation model (imprad_model=0) From eee2ad47e249969a572d37fcb2635db9f4c5e210 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 19 Sep 2024 15:29:59 +0100 Subject: [PATCH 072/108] Add graph and description about the qbar definition for the STAR Peng scaling --- .../plasma_current/plasma_current.md | 110 +++++++++++++++++- 1 file changed, 104 insertions(+), 6 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 03c23555ca..5f0641a037 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -51,14 +51,11 @@ Where $\epsilon$ is the inverse [aspect ratio](../plasma_geometry.md) ($\mathtt{ ----------- -#### STAR, Peng double null divertor scaling (ST) +#### STAR, Peng double null divertor scaling | `calculate_plasma_current_peng()` Switch value: `i_plasma_current = 2` [^3] [^4] -This is currently the only scaling in which the calculated plasma current does not follow the form of that show above. The bounds of applicability is for aspect ratios $\le 3$ -It uses the `calculate_plasma_current_peng()` function. - -##### `calculate_plasma_current_peng()` +This is currently the only scaling in which the calculated plasma current does not follow the form of that show above. The bounds of applicability is for aspect ratios $\le 3$. The plasma current is given by: @@ -66,7 +63,7 @@ $$ I_{\text{p}} = \frac{5a B_{\text{T}}\kappa}{2\pi^2 \bar{q}}(F_1+F_2)\left(\frac{\arcsin{E_1}}{E_1}+\frac{\arcsin{E_2}}{E_2}\right) $$ -The values of $F_1$, $F_2$, $d_1$ & $d_2$ are first calculated from the `_plascar_bpol` function. +The values of $F_1$, $F_2$, $d_1$ & $d_2$ are first calculated from the [`_plascar_bpol()`](#_plasc_bpol) function. The values of $E_1$ & $E_2$ are then calculated such as @@ -79,6 +76,107 @@ E_2 = \frac{2\kappa}{d_2(1.0 - \delta)} $$ $I_{\text{p}}$ from above is then calculated from these values +$\bar{q}$ is defined as the average safety factor[^4]. +In the original STAR code model $\bar{q}$ is defined as: + +$$ +\bar{q} = \bar{q}_0(1+2.6\epsilon^{2.8}) +$$ + +The STAR code document states that the $\bar{q}_0$ is normally equal to 3.0 +In PROCESS this is implemented differently as the function: + +$$ +\bar{q} = q_{95} \times 1.3(1-\epsilon)^{0.6} +$$ + +This is to allow the use of the available $q_{95}$ parameter as **the origin and definition of $\bar{q}_0$ is not fully known.** + +The coefficient values $q_{95}$ and $\bar{q}_0$ for the PROCESS and STAR code implementations can be experiemented with in the graph below: + + + + + + + + +My Bokeh Plot + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + ---------------- From c5ca0e8182cd3892e6b0179c4f924871d0f087ee Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 11:03:56 +0100 Subject: [PATCH 073/108] Update docs to describe more of q_cyl and add references for different interpretations --- .../plasma_current/plasma_current.md | 40 +++++++++++++++++-- process/physics.py | 2 +- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 5f0641a037..436f4907c7 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -418,12 +418,37 @@ $$ ----------------------------- -### 2. Calculate the cylidrical safety factor +### 2. Calculate the cylindrical safety factor + +In reactor design the total plasma current $I_{\text{p}}$, is limited by considerations of tearing mode stability, and major disruptions. These considerations place a limit on the safety factor at the plasma boundary, $q_{\psi}$. In a cylindrical plasma model there is a simple relation between this value, $q_{\text{cyl}}$, and the plasma current, given by + +$$ +q_{\psi} = q_{\text{cyl}} \equiv \frac{5a^2B_0}{R_0I_p} +$$ + +where the minor and major radii are expressed in metres, the toroidal magnetic field $B_0$, in Tesla, and the plasma current $I_{\text{p}}$, in megamps. Thus a stability requirement of the form $q_{\psi} > q_{\text{crit}}$ (usually considered to be ~ 2.0) places a limit on $I_{\text{p}}$. +The effect of toroidicity and of shaping of the plasma cross section is to modify the relation above between $q_{\psi}$ and the plasma current, $I_{\text{p}}$. In general this relation may be written in the form: + + +$$ +q_{\psi} = \frac{5a^2B_0}{R_0I_p}F\left(\epsilon,\kappa,\delta; \text{profiles}\right) +$$ + +It is not possible to derive a general analytic expression for $F$, so it has been customary to employ an empirical, or semi-empirical expression involving $\epsilon$,$\kappa$ and $\delta$, chosen to fit data taken from numerical solutions of the Grad Shafranov equation. + +The cylindrical equaivalent $q$ definition used currenly is the one given below from IPDG89[^5] $$ -q^* = \frac{5 \times 10^6a^2B_T}{RI_{\text{p}}}\frac{(1+\kappa^2(1+2\delta^2-1.2\delta^3))}{2} +q_* = \frac{5 \times 10^6a^2B_T}{RI_{\text{p}}}\frac{(1+\kappa^2(1+2\delta^2-1.2\delta^3))}{2} $$ + +!!! note "$q_{\text{cyl}}$ definition and use in PROCESS" + + Though this seems to not be the definition of the cyclindrical safety factor due to the elongation and triangularity scaling. + Zohm[^12], Wesson[^13], and AEA FUS 172[^7] all say that cyclindrical safety factor is just the first fraction. + And if we assume a cylindrical plasma where $\kappa = 1$ and $\delta = 0$ then the second term reduces to 1. + -------------- ### 3. Caclulate the normalized beta @@ -434,6 +459,9 @@ $$ \beta_N = \beta\frac{1\times10^8 a B_{\text{T}}}{I_{\text{P}}} $$ + +----------------- + ### 4. Plasma Current Poloidal Field For calculating the poloidal magnetic field created due to the presence of the plasma current, [Ampere's law](https://en.wikipedia.org/wiki/Amp%C3%A8re%27s_circuital_law) can simply be used. In this case the poloidal field is simply returned as: @@ -457,7 +485,7 @@ $$ A limited degree of self-consistency between the plasma current profile and other parameters can be enforced by setting switch `iprofile = 1`. This sets the current profile peaking factor $\alpha_J$ (`alphaj`), the normalised internal inductance $l_i$ (`rli`) and beta limit $g$-factor (`dnbeta`) using the -safety factor on axis `q0` and the cylindrical safety factor $q*$ (`qstar`): +safety factor on axis `q0` and the cylindrical safety factor $q_*$ (`qstar`): $$\begin{aligned} \alpha_J = \frac{q*}{q_0} - 1 @@ -482,6 +510,8 @@ l_i = 3.4 - \kappa_x Further desciption of `iprofile` is given in [Beta Limit](../plasma_beta.md). +----------------------- + ## _plasc_bpol This intenral function is used to calculate the plasma shape and poloidal coefficients for calculating the plasma current in the [Peng double null scaling from the STAR code](plasma_current.md#star-peng-double-null-divertor-scaling-st). If this scaling is selected the coefficents are also used to calculate the [poloidal field from the plasma current](plasma_current.md#plasma-current-poloidal-field). @@ -588,4 +618,8 @@ Unpublished internal Oak Ridge document. https://doi.org/10.1016/j.fusengdes.2016.04.033. [^10]: Stuart I. Muldrew, Hanni Lux, Geof Cunningham, Tim C. Hender, Sebastien Kahn, Peter J. Knight, Bhavin Patel, Garry M. Voss, Howard R. Wilson, “PROCESS”: Systems studies of spherical tokamaks, Fusion Engineering and Design, Volume 154, 2020, 111530, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2020.111530. [^11]: J. E. Menard et al., “Fusion nuclear science facilities and pilot plants based on the spherical tokamak,” Nuclear Fusion, vol. 56, no. 10, p. 106023, Aug. 2016, doi: https://doi.org/10.1088/0029-5515/56/10/106023. +[^12]: Zohm Hartmut, 2019, "On the size of tokamak fusion power plants", Phil. Trans. R. Soc. A.37720170437 +http://doi.org/10.1098/rsta.2017.0437 +[^13]: Wesson, J. and Campbell, D. J. (2004) Tokamaks. Clarendon Press (International series of monographs on physics). Available at: https://books.google.co.uk/books?id=iPlAwZI6HIYC. + diff --git a/process/physics.py b/process/physics.py index b0d224533b..c3bebc4f41 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2841,7 +2841,7 @@ def calculate_plasma_current( ) # i_plasma_current == 2 case covered above - # Calculate cyclindrical safety factor + # Calculate cyclindrical safety factor from IPDG89 qstar = ( 5.0e6 * rminor**2 From 571fcd8084ce5470deb28a92a5ac5fa2054f6a3b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 11:19:38 +0100 Subject: [PATCH 074/108] Change the 95% values of kappa and traing to the separatrix values, in line with IPDG89 --- process/physics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/physics.py b/process/physics.py index c3bebc4f41..8968e2f21b 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2847,7 +2847,7 @@ def calculate_plasma_current( * rminor**2 / (rmajor * plascur / bt) * 0.5 - * (1.0 + kappa95**2 * (1.0 + 2.0 * triang95**2 - 1.2 * triang95**3)) + * (1.0 + kappa**2 * (1.0 + 2.0 * triang**2 - 1.2 * triang**3)) ) physics_variables.normalised_total_beta = ( From 2486f02e901f327f04db608cd3ac7b6595771e1a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 14:03:27 +0100 Subject: [PATCH 075/108] Update documentation for wilson bootstrap model and add AEA FUS 172 reference --- .../plasma_current/bootstrap_current.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index a7acecce7c..7559bbae6d 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -119,7 +119,7 @@ $$ ### Wilson Scaling | `bootstrap_fraction_wilson()` -An empirical formula[^3] as a function of the pressure, +An empirical formula[^3] [^7] as a function of the pressure, temperature and total current profiles as well as the poloidal beta and aspect ratio of the tokamak. This empirical formula is compared with an expression obtained by the ITER group; also a comparison with an analytical result (valid at large aspect ratio) is made. It is found that the empirical result determined here agrees well with the large but not so well with the empirical formula of the ITER group[^0] Is selected by setting `i_bootstrap_current = 3` @@ -145,7 +145,16 @@ $$ \epsilon_0 = \frac{R_2-R_1}{R_2+R_1} $$ -Where $R_2$ and $R_1$ are the maximum and minimum radii of the plasma +Where $R_2$ and $R_1$ are the maximum and minimum radii of the plasma. + +The poloidal beta term is defined as: + +$$ +\beta_{\text{p}} = \frac{2\mu_0\langle p \rangle}{\langle \langle B_{\text{p}} \rangle \rangle^2} +$$ + +Where $\langle p \rangle$ is the volume averaged pressure and $\langle \langle B_{\text{p}} \rangle \rangle$ is the plasma surface average of the polidal field. + $$ b_1 = 1 \ \ b_2 = \alpha_{\text{p}} \ \ b_3 = \alpha_{\text{T}} \ \ b_4 = \alpha_{\text{p}}\alpha_{\text{T}} \\ @@ -405,6 +414,7 @@ Fusion Engineering and Design, Volume 89, Issue 11, 2014, Pages 2709-2715, ISSN [^3]: Wilson, H.R. (1992). Bootstrap current scaling in tokamaks. Nuclear Fusion, 32(2), pp.257–263. doi:https://doi.org/10.1088/0029-5515/32/2/i05. [^4]: O. Sauter, C. Angioni, Y. R. Lin-Liu; Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime. Phys. Plasmas 1 July 1999; 6 (7): 2834–2839. https://doi.org/10.1063/1.873240 [^5]: O. Sauter, C. Angioni, Y. R. Lin-Liu; Erratum: “Neoclassical conductivity and bootstrap current formulas for general axisymmetric equilibria and arbitrary collisionality regime” [Phys. Plasmas 6, 2834 (1999)]. Phys. Plasmas 1 December 2002; 9 (12): 5140. https://doi.org/10.1063/1.1517052 -[^6]: Ryosuke Sakai, Takaaki Fujita, Atsushi Okamoto, Derivation of bootstrap current fraction scaling formula for 0-D system code analysis, Fusion Engineering and Design, Volume 149, 2019, 111322, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2019.111322. +[^6]: Ryosuke Sakai, Takaaki Fujita, Atsushi Okamoto, Derivation of bootstrap current fraction scaling formula for 0-D system code analysis, Fusion Engineering and Design, Volume 149, 2019, 111322, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2019.111322. +[^7]: T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 From 3162aa59f264461bb854866d6c42dae9c5c68de0 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 14:18:21 +0100 Subject: [PATCH 076/108] Refactor Todd plasma current scaling calculation in physics.py to include both models --- process/physics.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/process/physics.py b/process/physics.py index 8968e2f21b..f385027fc2 100644 --- a/process/physics.py +++ b/process/physics.py @@ -378,9 +378,9 @@ def calculate_current_coefficient_ipdg89(eps: float, kappa95: float, triang95: f ) -def calculate_current_coefficient_todd(eps: float, kappa95: float, triang95: float) -> float: +def calculate_current_coefficient_todd(eps: float, kappa95: float, triang95: float, model: int) -> float: """ - Calculate the fq coefficient used in the Todd plasma current scaling. + Calculate the fq coefficient used in the two Todd plasma current scalings. Parameters: - eps: float, plasma inverse aspect ratio @@ -390,13 +390,14 @@ def calculate_current_coefficient_todd(eps: float, kappa95: float, triang95: flo Returns: - float, the fq plasma current coefficient - This function calculates the fq coefficient based on the given plasma parameters for the Todd scaling. + This function calculates the fq coefficient based on the given plasma parameters for the two Todd scalings. References: - D.C.Robinson and T.N.Todd, Plasma and Contr Fusion 28 (1986) 1181 - T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 """ - return ( + # Calculate the Todd scaling based on the model + base_scaling = ( (1.0 + 2.0 * eps**2) * ((1.0 + kappa95**2) / 0.5) * ( @@ -406,6 +407,10 @@ def calculate_current_coefficient_todd(eps: float, kappa95: float, triang95: flo + 0.125 * triang95 ) ) + if model == 1: + return base_scaling + elif model == 2: + return base_scaling * (1.0 + (abs(kappa95 - 1.2)) ** 3) @nb.jit(nopython=True, cache=True) @@ -2807,10 +2812,10 @@ def calculate_plasma_current( # Todd empirical scalings # D.C.Robinson and T.N.Todd, Plasma and Contr Fusion 28 (1986) 1181 elif i_plasma_current in [5, 6]: - fq = calculate_current_coefficient_todd(eps, kappa95, triang95) + fq = calculate_current_coefficient_todd(eps, kappa95, triang95, model=1) if i_plasma_current == 6: - fq *= 1.0 + (abs(kappa95 - 1.2)) ** 3 + fq = calculate_current_coefficient_todd(eps, kappa95, triang95, model=2) # Connor-Hastie asymptotically-correct expression elif i_plasma_current == 7: From 58ffae47700efa533005424b6667f6257ff10bbc Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 14:20:05 +0100 Subject: [PATCH 077/108] Ad @nb.jit decorators to physics.py functions --- process/physics.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/process/physics.py b/process/physics.py index f385027fc2..302485da98 100644 --- a/process/physics.py +++ b/process/physics.py @@ -279,6 +279,7 @@ def calculate_poloidal_field( return bt * (ff1 + ff2) / (2.0 * np.pi * qbar) +@nb.jit(nopython=True, cache=True) def calculate_current_coefficient_peng(eps: float, sf: float) -> float: """ Calculate the plasma current scaling coefficient for the Peng scaling from the STAR code. @@ -351,6 +352,7 @@ def calculate_plasma_current_peng( ) +@nb.jit(nopython=True, cache=True) def calculate_current_coefficient_ipdg89(eps: float, kappa95: float, triang95: float) -> float: """ Calculate the fq coefficient from the IPDG89 guidlines used in the plasma current scaling. @@ -378,6 +380,7 @@ def calculate_current_coefficient_ipdg89(eps: float, kappa95: float, triang95: f ) +@nb.jit(nopython=True, cache=True) def calculate_current_coefficient_todd(eps: float, kappa95: float, triang95: float, model: int) -> float: """ Calculate the fq coefficient used in the two Todd plasma current scalings. @@ -495,6 +498,7 @@ def calculate_current_coefficient_hastie( ) +@nb.jit(nopython=True, cache=True) def calculate_current_coefficient_sauter(eps: float, kappa: float, triang: float, ) -> float: """ Routine to calculate the f_q coefficient for the Sauter model used for scaling the plasma current. @@ -526,6 +530,7 @@ def calculate_current_coefficient_sauter(eps: float, kappa: float, triang: float return fq +@nb.jit(nopython=True, cache=True) def calculate_current_coefficient_fiesta(eps: float, kappa: float, triang: float) -> float: """ Calculate the fq coefficient used in the FIESTA plasma current scaling. @@ -552,6 +557,7 @@ def calculate_current_coefficient_fiesta(eps: float, kappa: float, triang: float # -------------------------------- +@nb.jit(nopython=True, cache=True) def nevins_integral( y: float, dene: float, @@ -630,6 +636,7 @@ def nevins_integral( # ----------------------------------------------------- +@nb.jit(nopython=True, cache=True) def diamagnetic_fraction_hender(beta: float) -> float: """ Calculate the diamagnetic fraction based on the Hender fit. @@ -643,6 +650,7 @@ def diamagnetic_fraction_hender(beta: float) -> float: return beta / 2.8 +@nb.jit(nopython=True, cache=True) def diamagnetic_fraction_scene(beta: float, q95: float, q0: float) -> float: """ Calculate the diamagnetic fraction based on the SCENE fit by Tim Hender. @@ -658,6 +666,7 @@ def diamagnetic_fraction_scene(beta: float, q95: float, q0: float) -> float: return beta * (0.1 * q95 / q0 + 0.44) * 0.414 +@nb.jit(nopython=True, cache=True) def ps_fraction_scene(beta: float) -> float: """ Calculate the Pfirsch-Schlüter fraction based on the SCENE fit by Tim Hender 2019. From e6190dde23322420c7e2f568e6030bf6bd19e209 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 14:52:29 +0100 Subject: [PATCH 078/108] Add about rod and plasma current constraint equation in docs --- .../plasma_current/plasma_current.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index 436f4907c7..f2c7e7040d 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -607,6 +607,21 @@ This constraint will ensure that the value of `tohs` is always greater than or e ### Plasma and Rod current fraction upper limit +This constraint can be activated by stating `icc = 46` in the input file. + +The constraint condition is[^14]: + +$$ +\frac{I_{\text{p}}}{I_{\text{cp}}} < 1.0 + 4.91\left(\epsilon - 0.62\right) +$$ + +In this case $I_{\text{cp}}$ is the total current going up the centrepost in a spherical tokamak. +This constraint was initially though to prevent instabilites and act as a guideline to limit power dissipation when generating new designs. The scaling value for the constraint, `fipir` can be varied also. + + The origins of the relation should be seen in early spherical tokamak papers not yet referenced here. + +--------------------- + [^3]: Peng, Y. K. M., Galambos, J. D., & Shipe, P. C. (1992). 'Small Tokamaks for Fusion Technology Testing'. Fusion Technology, 21(3P2A), 1729–1738. https://doi.org/10.13182/FST92-A29971 [^4]: J.D. Galambos, 'STAR Code : Spherical Tokamak Analysis and Reactor Code', Unpublished internal Oak Ridge document. @@ -621,5 +636,9 @@ https://doi.org/10.1016/j.fusengdes.2016.04.033. [^12]: Zohm Hartmut, 2019, "On the size of tokamak fusion power plants", Phil. Trans. R. Soc. A.37720170437 http://doi.org/10.1098/rsta.2017.0437 [^13]: Wesson, J. and Campbell, D. J. (2004) Tokamaks. Clarendon Press (International series of monographs on physics). Available at: https://books.google.co.uk/books?id=iPlAwZI6HIYC. +[^14]: Stuart I. Muldrew, Hanni Lux, Geof Cunningham, Tim C. Hender, Sebastien Kahn, Peter J. Knight, Bhavin Patel, Garry M. Voss, Howard R. Wilson,“PROCESS”: Systems studies of spherical tokamaks, Fusion Engineering and Design, Volume 154, 2020, +111530, ISSN 0920-3796, https://doi.org/10.1016/j.fusengdes.2020.111530. + + From fe9dd13af303a5a760e10bcb59ec0a40cba46888 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 15:02:49 +0100 Subject: [PATCH 079/108] Update expected values for the Sakai, bootstrap current fraction model. The inclusion of the inverse aspect ratio in the exponent of the inductance was forgotten and so was added correctly back in to the model. This update ensures the outputs are now true for the corrected model --- tests/unit/test_physics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index eec5b44fc4..ccd2d0d062 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -493,7 +493,7 @@ class BootstrapFractionSakaiParam(NamedTuple): alphat=1.45, eps=1 / 3, rli=1.2098126022585098, - expected_bfs=0.34204201506155418, + expected_bfs=0.3501274900057279, ), BootstrapFractionSakaiParam( betap=1.1701245502231756, @@ -503,7 +503,7 @@ class BootstrapFractionSakaiParam(NamedTuple): alphat=1.3999999999999999, eps=1 / 1.8, rli=0.3, - expected_bfs=0.90349498124262029, + expected_bfs=0.81877746774625, ), ), ) From a483dda679b6f1a4a26ef539365f6a3acb1ebda3 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 15:30:33 +0100 Subject: [PATCH 080/108] Refactor physics.py to remove @nb.jit decorator from nevins_integral function. Rename the input variables for the Nevins bootstrap models to `te` instead of `ten` --- process/physics.py | 1 - tests/unit/test_physics.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/process/physics.py b/process/physics.py index 302485da98..9b03b0321f 100644 --- a/process/physics.py +++ b/process/physics.py @@ -557,7 +557,6 @@ def calculate_current_coefficient_fiesta(eps: float, kappa: float, triang: float # -------------------------------- -@nb.jit(nopython=True, cache=True) def nevins_integral( y: float, dene: float, diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index ccd2d0d062..fce4bf674e 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -148,7 +148,7 @@ class BootstrapFractionNevinsParam(NamedTuple): rminor: Any = None - ten: Any = None + te: Any = None zeff: Any = None @@ -171,7 +171,7 @@ class BootstrapFractionNevinsParam(NamedTuple): alphat=1.45, rmajor=8, rminor=2.6666666666666665, - ten=12.626131115905864, + te=12.626131115905864, zeff=2.0909945616489103, expected_fibs=889258771342.7881, ), @@ -205,7 +205,7 @@ def test_bootstrap_fraction_nevins(bootstrapfractionnevinsparam, monkeypatch, ph q95=bootstrapfractionnevinsparam.q95, rmajor=bootstrapfractionnevinsparam.rmajor, rminor=bootstrapfractionnevinsparam.rminor, - ten=bootstrapfractionnevinsparam.ten, + te=bootstrapfractionnevinsparam.te, zeff=bootstrapfractionnevinsparam.zeff, ) From 16fefd3b5bee064f76624b1e0c52b900a9d34aba Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 16:05:14 +0100 Subject: [PATCH 081/108] Refactor physics.py to remove @nb.jit decorator peng plasma current calculations an rename qbar to q95 in the test_physics test suite for the appropriate scalings --- process/physics.py | 8 ++------ tests/unit/test_physics.py | 10 +++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/process/physics.py b/process/physics.py index 9b03b0321f..38d7c7eb56 100644 --- a/process/physics.py +++ b/process/physics.py @@ -167,7 +167,6 @@ def culblm(bt, dnbeta, plascur, rminor): # ----------------------------------------------------- -@nb.jit(nopython=True, cache=True) def _plascar_bpol( aspect: float, eps: float, kappa: float, delta: float ) -> Tuple[float, float, float, float]: @@ -223,7 +222,6 @@ def _plascar_bpol( return ff1, ff2, d1, d2 -@nb.jit(nopython=True, cache=True) def calculate_poloidal_field( i_plasma_current: int, ip: float, @@ -274,12 +272,11 @@ def calculate_poloidal_field( ff1, ff2, _, _ = _plascar_bpol(aspect, eps, kappa, delta) # Transform q95 to qbar - qbar = (physics_variables.q * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0) + qbar = (q95 * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0) return bt * (ff1 + ff2) / (2.0 * np.pi * qbar) -@nb.jit(nopython=True, cache=True) def calculate_current_coefficient_peng(eps: float, sf: float) -> float: """ Calculate the plasma current scaling coefficient for the Peng scaling from the STAR code. @@ -294,7 +291,6 @@ def calculate_current_coefficient_peng(eps: float, sf: float) -> float: return (1.22 - 0.68 * eps) / ((1.0 - eps * eps) ** 2) * sf**2 -@nb.jit(nopython=True, cache=True) def calculate_plasma_current_peng( q95: float, aspect: float, @@ -333,7 +329,7 @@ def calculate_plasma_current_peng( """ # Transform q95 to qbar - qbar = (physics_variables.q * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0) + qbar = (q95 * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0) ff1, ff2, d1, d2 = _plascar_bpol(aspect, eps, kappa, delta) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index fce4bf674e..98bb689a50 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -721,7 +721,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): ( ( { - "qbar": 2.5, + "q95": 2.5, "aspect": 2.7, "eps": 0.37037037, "rminor": 1.5, @@ -733,7 +733,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): ), ( { - "qbar": 2.5, + "q95": 2.5, "aspect": 3.0, "eps": 0.33333333, "rminor": 1.5, @@ -756,7 +756,7 @@ def test_plasc(arguments, expected): { "i_plasma_current": 2, "ip": 1.6e7, - "qbar": 2.5, + "q95": 2.5, "aspect": 2.7, "eps": 0.37037037, "bt": 12, @@ -771,7 +771,7 @@ def test_plasc(arguments, expected): { "i_plasma_current": 2, "ip": 1.6e7, - "qbar": 2.5, + "q95": 2.5, "aspect": 3.0, "eps": 0.33333333, "bt": 12, @@ -786,7 +786,7 @@ def test_plasc(arguments, expected): { "i_plasma_current": 3, "ip": 1.6e7, - "qbar": 2.5, + "q95": 2.5, "aspect": 3.0, "eps": 0.33333333, "bt": 12, From 85dfc0524ffa01d846e6817028b4c25b0649ba19 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 16:12:28 +0100 Subject: [PATCH 082/108] Update the tests relating to i_plasma_current = 2 which had the definition of qbar placed internally to their functions. This change propagated an incorrect value of q95 to other models that should have stayed in just 2 functions --- tests/unit/test_physics.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 98bb689a50..bc5742829e 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -630,7 +630,7 @@ class PlasmaCurrentParam(NamedTuple): expected_alphaj=1.9008029008029004, expected_rli=1.2064840230894305, expected_bp=0.96008591022564971, - expected_qstar=2.9008029008029004, + expected_qstar=3.869423496255382, expected_plascur=18398455.678867526, ), PlasmaCurrentParam( @@ -658,7 +658,7 @@ class PlasmaCurrentParam(NamedTuple): expected_alphaj=1.9008029008029004, expected_rli=1.2064840230894305, expected_bp=0.96008591022564971, - expected_qstar=2.9008029008029004, + expected_qstar=3.869423496255382, expected_plascur=18398455.678867526, ), ), @@ -729,7 +729,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): "kappa": 1.85, "delta": 0.5, }, - 37.43306888647351, + 46.84050744522757, ), ( { @@ -741,7 +741,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): "kappa": 1.85, "delta": 0.5, }, - 31.893383344142052, + 39.90862317467305, ), ), ) @@ -765,7 +765,7 @@ def test_plasc(arguments, expected): "perim": 24, "rmu0": constants.rmu0, }, - 3.4726549397470703, + 4.3453802853633166, ), ( { @@ -780,7 +780,7 @@ def test_plasc(arguments, expected): "perim": 24, "rmu0": constants.rmu0, }, - 2.958739919272374, + 3.702311392804667, ), ( { From aa082aaba867960550a57b4fb9e6d18be5c702ae Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 16:13:11 +0100 Subject: [PATCH 083/108] black format --- process/current_drive.py | 5 +- process/physics.py | 101 ++++++++++++++++++++++--------- tests/unit/test_current_drive.py | 24 ++++++-- tests/unit/test_physics.py | 10 +-- 4 files changed, 103 insertions(+), 37 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index b562bbf3d6..7e7cd84109 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -970,7 +970,10 @@ def cudriv(self, output: bool): ) if ( - abs(current_drive_variables.bootstrap_current_fraction - current_drive_variables.bootstrap_current_fraction_max) + abs( + current_drive_variables.bootstrap_current_fraction + - current_drive_variables.bootstrap_current_fraction_max + ) < 1.0e-8 ): po.ocmmnt(self.outfile, "Warning : bootstrap current fraction is at") diff --git a/process/physics.py b/process/physics.py index 38d7c7eb56..25e651f197 100644 --- a/process/physics.py +++ b/process/physics.py @@ -272,7 +272,7 @@ def calculate_poloidal_field( ff1, ff2, _, _ = _plascar_bpol(aspect, eps, kappa, delta) # Transform q95 to qbar - qbar = (q95 * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0) + qbar = q95 * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0 return bt * (ff1 + ff2) / (2.0 * np.pi * qbar) @@ -329,7 +329,7 @@ def calculate_plasma_current_peng( """ # Transform q95 to qbar - qbar = (q95 * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0) + qbar = q95 * 1.3e0 * (1.0e0 - physics_variables.eps) ** 0.6e0 ff1, ff2, d1, d2 = _plascar_bpol(aspect, eps, kappa, delta) @@ -349,7 +349,9 @@ def calculate_plasma_current_peng( @nb.jit(nopython=True, cache=True) -def calculate_current_coefficient_ipdg89(eps: float, kappa95: float, triang95: float) -> float: +def calculate_current_coefficient_ipdg89( + eps: float, kappa95: float, triang95: float +) -> float: """ Calculate the fq coefficient from the IPDG89 guidlines used in the plasma current scaling. @@ -377,7 +379,9 @@ def calculate_current_coefficient_ipdg89(eps: float, kappa95: float, triang95: f @nb.jit(nopython=True, cache=True) -def calculate_current_coefficient_todd(eps: float, kappa95: float, triang95: float, model: int) -> float: +def calculate_current_coefficient_todd( + eps: float, kappa95: float, triang95: float, model: int +) -> float: """ Calculate the fq coefficient used in the two Todd plasma current scalings. @@ -495,7 +499,11 @@ def calculate_current_coefficient_hastie( @nb.jit(nopython=True, cache=True) -def calculate_current_coefficient_sauter(eps: float, kappa: float, triang: float, ) -> float: +def calculate_current_coefficient_sauter( + eps: float, + kappa: float, + triang: float, +) -> float: """ Routine to calculate the f_q coefficient for the Sauter model used for scaling the plasma current. @@ -527,7 +535,9 @@ def calculate_current_coefficient_sauter(eps: float, kappa: float, triang: float @nb.jit(nopython=True, cache=True) -def calculate_current_coefficient_fiesta(eps: float, kappa: float, triang: float) -> float: +def calculate_current_coefficient_fiesta( + eps: float, kappa: float, triang: float +) -> float: """ Calculate the fq coefficient used in the FIESTA plasma current scaling. @@ -1605,9 +1615,13 @@ def physics(self): ) if physics_variables.i_diamagnetic_current == 1: - current_drive_variables.diamagnetic_current_fraction = current_drive_variables.diacf_hender + current_drive_variables.diamagnetic_current_fraction = ( + current_drive_variables.diacf_hender + ) elif physics_variables.i_diamagnetic_current == 2: - current_drive_variables.diamagnetic_current_fraction = current_drive_variables.diacf_scene + current_drive_variables.diamagnetic_current_fraction = ( + current_drive_variables.diacf_scene + ) # ***************************** # # PFIRSCH-SCHLÜTER CURRENT # @@ -1699,29 +1713,47 @@ def physics(self): ) if current_drive_variables.bootstrap_current_fraction_max < 0.0e0: - current_drive_variables.bootstrap_current_fraction = abs(current_drive_variables.bootstrap_current_fraction_max) - current_drive_variables.plasma_current_internal_fraction = current_drive_variables.bootstrap_current_fraction + current_drive_variables.bootstrap_current_fraction = abs( + current_drive_variables.bootstrap_current_fraction_max + ) + current_drive_variables.plasma_current_internal_fraction = ( + current_drive_variables.bootstrap_current_fraction + ) else: if physics_variables.i_bootstrap_current == 1: - current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_iter89 + current_drive_variables.bootstrap_current_fraction = ( + current_drive_variables.bscf_iter89 + ) elif physics_variables.i_bootstrap_current == 2: - current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_nevins + current_drive_variables.bootstrap_current_fraction = ( + current_drive_variables.bscf_nevins + ) elif physics_variables.i_bootstrap_current == 3: - current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_wilson + current_drive_variables.bootstrap_current_fraction = ( + current_drive_variables.bscf_wilson + ) elif physics_variables.i_bootstrap_current == 4: - current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_sauter + current_drive_variables.bootstrap_current_fraction = ( + current_drive_variables.bscf_sauter + ) elif physics_variables.i_bootstrap_current == 5: # Sakai states that the ACCOME dataset used has the toridal diamagnetic current included in the bootstrap current # So the diamagnetic current calculation should be turned off when using, (i_diamagnetic_current = 0). - current_drive_variables.bootstrap_current_fraction = current_drive_variables.bscf_sakai + current_drive_variables.bootstrap_current_fraction = ( + current_drive_variables.bscf_sakai + ) else: error_handling.idiags[0] = physics_variables.i_bootstrap_current error_handling.report_error(75) physics_module.err242 = 0 - if current_drive_variables.bootstrap_current_fraction > current_drive_variables.bootstrap_current_fraction_max: + if ( + current_drive_variables.bootstrap_current_fraction + > current_drive_variables.bootstrap_current_fraction_max + ): current_drive_variables.bootstrap_current_fraction = min( - current_drive_variables.bootstrap_current_fraction, current_drive_variables.bootstrap_current_fraction_max + current_drive_variables.bootstrap_current_fraction, + current_drive_variables.bootstrap_current_fraction_max, ) physics_module.err242 = 1 @@ -1737,9 +1769,13 @@ def physics(self): # produced by non-inductive means (which also includes # the current drive proportion) physics_module.err243 = 0 - if current_drive_variables.plasma_current_internal_fraction > physics_variables.fvsbrnni: + if ( + current_drive_variables.plasma_current_internal_fraction + > physics_variables.fvsbrnni + ): current_drive_variables.plasma_current_internal_fraction = min( - current_drive_variables.plasma_current_internal_fraction, physics_variables.fvsbrnni + current_drive_variables.plasma_current_internal_fraction, + physics_variables.fvsbrnni, ) physics_module.err243 = 1 @@ -1747,7 +1783,8 @@ def physics(self): physics_variables.facoh = max(1.0e-10, (1.0e0 - physics_variables.fvsbrnni)) # Fraction of plasma current produced by auxiliary current drive physics_variables.faccd = ( - physics_variables.fvsbrnni - current_drive_variables.plasma_current_internal_fraction + physics_variables.fvsbrnni + - current_drive_variables.plasma_current_internal_fraction ) # Auxiliary current drive power calculations @@ -2824,7 +2861,9 @@ def calculate_plasma_current( # Connor-Hastie asymptotically-correct expression elif i_plasma_current == 7: # N.B. If iprofile=1, alphaj will be wrong during the first call (only) - fq = calculate_current_coefficient_hastie(alphaj, alphap, bt, triang95, eps, kappa95, p0, constants.rmu0) + fq = calculate_current_coefficient_hastie( + alphaj, alphap, bt, triang95, eps, kappa95, p0, constants.rmu0 + ) # Sauter scaling allowing negative triangularity [FED May 2016] # https://doi.org/10.1016/j.fusengdes.2016.04.033. @@ -5362,15 +5401,21 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: radial_elements = np.arange(2, NR) # Change in localised minor radius to be used as delta term in derivative - drho = rho[radial_elements] - rho[radial_elements-1] + drho = rho[radial_elements] - rho[radial_elements - 1] # Area of annulus, assuming circular plasma cross-section - da = 2 * np.pi * rho[radial_elements-1] * drho # area of annulus + da = 2 * np.pi * rho[radial_elements - 1] * drho # area of annulus # Create the partial derivatives - dlogte_drho = (np.log(tempe[radial_elements]) - np.log(tempe[radial_elements-1])) / drho - dlogti_drho = (np.log(tempi[radial_elements]) - np.log(tempi[radial_elements-1])) / drho - dlogne_drho = (np.log(ne[radial_elements]) - np.log(ne[radial_elements-1])) / drho + dlogte_drho = ( + np.log(tempe[radial_elements]) - np.log(tempe[radial_elements - 1]) + ) / drho + dlogti_drho = ( + np.log(tempi[radial_elements]) - np.log(tempi[radial_elements - 1]) + ) / drho + dlogne_drho = ( + np.log(ne[radial_elements]) - np.log(ne[radial_elements - 1]) + ) / drho jboot = ( 0.5 @@ -5430,8 +5475,8 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: * ( -physics_variables.bt / (0.2 * np.pi * physics_variables.rmajor) - * rho[radial_elements-1] - * inverse_q[radial_elements-1] + * rho[radial_elements - 1] + * inverse_q[radial_elements - 1] ) ) # A/m2 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 5b49a2a3f9..0dbc3dacb5 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -469,9 +469,17 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(current_drive_variables, "bigq", cudrivparam.bigq) - monkeypatch.setattr(current_drive_variables, "bootstrap_current_fraction", cudrivparam.bootstrap_current_fraction) + monkeypatch.setattr( + current_drive_variables, + "bootstrap_current_fraction", + cudrivparam.bootstrap_current_fraction, + ) - monkeypatch.setattr(current_drive_variables, "bootstrap_current_fraction_max", cudrivparam.bootstrap_current_fraction_max) + monkeypatch.setattr( + current_drive_variables, + "bootstrap_current_fraction_max", + cudrivparam.bootstrap_current_fraction_max, + ) monkeypatch.setattr(current_drive_variables, "taubeam", cudrivparam.taubeam) @@ -485,11 +493,19 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(current_drive_variables, "rtanmax", cudrivparam.rtanmax) - monkeypatch.setattr(current_drive_variables, "diamagnetic_current_fraction", cudrivparam.diamagnetic_current_fraction) + monkeypatch.setattr( + current_drive_variables, + "diamagnetic_current_fraction", + cudrivparam.diamagnetic_current_fraction, + ) monkeypatch.setattr(current_drive_variables, "psipf", cudrivparam.psipf) - monkeypatch.setattr(current_drive_variables, "plasma_current_internal_fraction", cudrivparam.plasma_current_internal_fraction) + monkeypatch.setattr( + current_drive_variables, + "plasma_current_internal_fraction", + cudrivparam.plasma_current_internal_fraction, + ) monkeypatch.setattr(current_drive_variables, "harnum", cudrivparam.harnum) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index bc5742829e..48757bb3b0 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -120,7 +120,9 @@ def test_bootstrap_fraction_iter89(bootstrapfractioniter89param, physics): vol=bootstrapfractioniter89param.vol, ) - assert bootstrap_current_fraction == pytest.approx(bootstrapfractioniter89param.expected_bootipf) + assert bootstrap_current_fraction == pytest.approx( + bootstrapfractioniter89param.expected_bootipf + ) class BootstrapFractionNevinsParam(NamedTuple): @@ -808,9 +810,9 @@ def test_culblm(): def test_conhas(): - assert calculate_current_coefficient_hastie(5, 5, 12, 0.5, 0.33, 1.85, 2e3, constants.rmu0) == pytest.approx( - 2.518876726889116 - ) + assert calculate_current_coefficient_hastie( + 5, 5, 12, 0.5, 0.33, 1.85, 2e3, constants.rmu0 + ) == pytest.approx(2.518876726889116) class PlasmaCompositionParam(NamedTuple): From 4dd5071160c92608bc8dd676f76f4a569e11e0c3 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 20 Sep 2024 16:26:46 +0100 Subject: [PATCH 084/108] Refactor variable name bscfmax to bootstrap_current_fraction_max in large_tokamak_IN.DAT, scan_example_file_IN.DAT, large_tokamak_1_MFILE.DAT, large_tokamak_2_MFILE.DAT, large_tokamak_3_MFILE.DAT, large_tokamak_4_MFILE.DAT, large_tokamak_nof.IN.DAT, large_tokamak_once_through.IN.DAT, ref_IN.DAT, uncertainties_ref_IN.DAT, uncertainties_nonopt_ref_IN.DAT, st_regression.IN.DAT, and uncetainties_ref_IN.DAT --- .../data/csv_output_large_tokamak_MFILE.DAT | 4 +-- examples/data/large_tokamak_1_MFILE.DAT | 4 +-- examples/data/large_tokamak_2_MFILE.DAT | 4 +-- examples/data/large_tokamak_3_MFILE.DAT | 4 +-- examples/data/large_tokamak_4_MFILE.DAT | 4 +-- examples/data/large_tokamak_IN.DAT | 2 +- examples/data/scan_MFILE.DAT | 20 ++++++------ examples/data/scan_example_file_IN.DAT | 2 +- .../data/large_tokamak_1_MFILE.DAT | 4 +-- .../data/large_tokamak_2_MFILE.DAT | 4 +-- .../data/large_tokamak_3_MFILE.DAT | 4 +-- .../data/large_tokamak_4_MFILE.DAT | 4 +-- tests/integration/data/large_tokamak_IN.DAT | 2 +- .../integration/data/large_tokamak_MFILE.DAT | 4 +-- tests/integration/data/ref_IN.DAT | 2 +- tests/integration/data/scan_2D_MFILE.DAT | 32 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 20 ++++++------ .../data/uncertainties_nonopt_ref_IN.DAT | 2 +- .../integration/data/uncertainties_ref_IN.DAT | 2 +- tests/integration/ref_dicts.json | 14 ++++---- .../input_files/large_tokamak.IN.DAT | 2 +- .../input_files/large_tokamak_nof.IN.DAT | 2 +- .../large_tokamak_once_through.IN.DAT | 2 +- .../input_files/st_regression.IN.DAT | 2 +- tests/unit/data/large_tokamak_IN.DAT | 2 +- tests/unit/data/large_tokamak_MFILE.DAT | 4 +-- 26 files changed, 76 insertions(+), 76 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 8436672bb9..8d40848a4c 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -535,7 +535,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 2.1293E-01 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0990E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 9.8586E+03 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6299E-02 OP @@ -1649,7 +1649,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 746cca4426..cb68dac12b 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -533,7 +533,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.1429E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0060E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.3908E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6488E-02 OP @@ -1643,7 +1643,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 55786a4215..23169207eb 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -533,7 +533,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.1429E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0060E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.3908E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6488E-02 OP @@ -1643,7 +1643,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 06f98982c3..dc89cb5f4e 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -533,7 +533,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.1429E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0060E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.3908E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6488E-02 OP @@ -1643,7 +1643,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index eabdfb3a9b..7a28a871a8 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -533,7 +533,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.1429E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0060E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.3908E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6488E-02 OP @@ -1643,7 +1643,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/examples/data/large_tokamak_IN.DAT b/examples/data/large_tokamak_IN.DAT index 350d6727de..d686f0f0c0 100644 --- a/examples/data/large_tokamak_IN.DAT +++ b/examples/data/large_tokamak_IN.DAT @@ -453,7 +453,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 3e7b1bbfc0..542ee077a3 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -388,7 +388,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -1383,7 +1383,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -2378,7 +2378,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -3373,7 +3373,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -4368,7 +4368,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -5363,7 +5363,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -6358,7 +6358,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -7353,7 +7353,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -8348,7 +8348,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -9145,7 +9145,7 @@ ucme = 3.0d8 * Unit cost of maintenance equipment ($/w**0;3) *-------------Current Drive Variables--------------* -bscfmax = 0.99 * Maximum fraction of plasma current from bootstrap; +bootstrap_current_fraction_max = 0.99 * Maximum fraction of plasma current from bootstrap; iefrf = 10 * Switch for current drive efficiency model; gamma_ecrh = 0.30 * ECRH gamma_CD (user input) etaech = 0.4 * ECRH wall-plug efficiency diff --git a/examples/data/scan_example_file_IN.DAT b/examples/data/scan_example_file_IN.DAT index bb6a863b62..9d42b64771 100644 --- a/examples/data/scan_example_file_IN.DAT +++ b/examples/data/scan_example_file_IN.DAT @@ -453,7 +453,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 1ae338e1f7..1d1c290283 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -533,7 +533,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.1429E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0060E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.3908E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6488E-02 OP @@ -1643,7 +1643,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 815c4eb482..b1c83a75ff 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -533,7 +533,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.1429E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0060E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.3908E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6488E-02 OP @@ -1643,7 +1643,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index e85015ddfe..3e1abf1d78 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -533,7 +533,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.1429E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0060E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.3908E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6488E-02 OP @@ -1643,7 +1643,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 52a73a2d18..41398b4a0c 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -533,7 +533,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.1429E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0060E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.3908E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6488E-02 OP @@ -1643,7 +1643,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/integration/data/large_tokamak_IN.DAT b/tests/integration/data/large_tokamak_IN.DAT index 350d6727de..d686f0f0c0 100644 --- a/tests/integration/data/large_tokamak_IN.DAT +++ b/tests/integration/data/large_tokamak_IN.DAT @@ -453,7 +453,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 184867eb68..5fa1328116 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -530,7 +530,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 4.7098E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0141E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.2041E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6799E-02 OP @@ -1644,7 +1644,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/integration/data/ref_IN.DAT b/tests/integration/data/ref_IN.DAT index eff7d05c4d..2d40ad05bf 100644 --- a/tests/integration/data/ref_IN.DAT +++ b/tests/integration/data/ref_IN.DAT @@ -166,7 +166,7 @@ ucme = 3.0d8 * Unit cost of maintenance equipment ($/w**0;3) *-------------Current Drive Variables--------------* -bscfmax = 0.99 * Maximum fraction of plasma current from bootstrap; +bootstrap_current_fraction_max = 0.99 * Maximum fraction of plasma current from bootstrap; iefrf = 10 * Switch for current drive efficiency model; gamma_ecrh = 0.30 * ECRH gamma_CD (user input) etaech = 0.4 * ECRH wall-plug efficiency diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index eb57fa6d37..b17cf56f22 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -534,7 +534,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1129E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6662E-02 OP @@ -1697,7 +1697,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1326E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6483E-02 OP @@ -2860,7 +2860,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 5.5891E-01 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1272E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.5902E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6344E-02 OP @@ -4023,7 +4023,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1468E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6548E-02 OP @@ -5186,7 +5186,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1502E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6564E-02 OP @@ -6349,7 +6349,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1436E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6722E-02 OP @@ -7512,7 +7512,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1481E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6916E-02 OP @@ -8675,7 +8675,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1510E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6867E-02 OP @@ -9838,7 +9838,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1428E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6949E-02 OP @@ -11001,7 +11001,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1568E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.7010E-02 OP @@ -12164,7 +12164,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1696E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6863E-02 OP @@ -13327,7 +13327,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1690E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6900E-02 OP @@ -14490,7 +14490,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1807E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6986E-02 OP @@ -15653,7 +15653,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.1919E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6811E-02 OP @@ -16816,7 +16816,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 0.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.2037E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 0.0000E+00 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6629E-02 OP @@ -17929,7 +17929,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 6f9fc9acee..0af7f60750 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -388,7 +388,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -1383,7 +1383,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -2378,7 +2378,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -3373,7 +3373,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -4368,7 +4368,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -5363,7 +5363,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -6358,7 +6358,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -7353,7 +7353,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -8348,7 +8348,7 @@ Current_drive_efficiency_model__________________________________________ (iefrf)_______________________ 10 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 5.0000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 1.0000E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.9000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.9000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 3.9003E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 4.5950E+04 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.5950E-02 OP @@ -9145,7 +9145,7 @@ ucme = 3.0d8 * Unit cost of maintenance equipment ($/w**0;3) *-------------Current Drive Variables--------------* -bscfmax = 0.99 * Maximum fraction of plasma current from bootstrap; +bootstrap_current_fraction_max = 0.99 * Maximum fraction of plasma current from bootstrap; iefrf = 10 * Switch for current drive efficiency model; gamma_ecrh = 0.30 * ECRH gamma_CD (user input) etaech = 0.4 * ECRH wall-plug efficiency diff --git a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT index 7b5e292827..d48fca7fb8 100644 --- a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT +++ b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT @@ -166,7 +166,7 @@ ucme = 3.0d8 * Unit cost of maintenance equipment ($/w**0;3) *-------------Current Drive Variables--------------* -bscfmax = 0.99 * Maximum fraction of plasma current from bootstrap; +bootstrap_current_fraction_max = 0.99 * Maximum fraction of plasma current from bootstrap; iefrf = 10 * Switch for current drive efficiency model; gamma_ecrh = 0.30 * ECRH gamma_CD (user input) etaech = 0.4 * ECRH wall-plug efficiency diff --git a/tests/integration/data/uncertainties_ref_IN.DAT b/tests/integration/data/uncertainties_ref_IN.DAT index 86766e25b1..d19b6f2008 100644 --- a/tests/integration/data/uncertainties_ref_IN.DAT +++ b/tests/integration/data/uncertainties_ref_IN.DAT @@ -166,7 +166,7 @@ ucme = 3.0d8 * Unit cost of maintenance equipment ($/w**0;3) *-------------Current Drive Variables--------------* -bscfmax = 0.99 * Maximum fraction of plasma current from bootstrap; +bootstrap_current_fraction_max = 0.99 * Maximum fraction of plasma current from bootstrap; iefrf = 10 * Switch for current drive efficiency model; gamma_ecrh = 0.30 * ECRH gamma_CD (user input) etaech = 0.4 * ECRH wall-plug efficiency diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index a3cb783fa8..5a383d1a01 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1162,7 +1162,7 @@ "bscf_nevins": 0.0, "bscf_sauter": 0.0, "bscf_wilson": 0.0, - "bscfmax": 0.9, + "bootstrap_current_fraction_max": 0.9, "bt": 5.68, "btot": 0.0, "burnup": 0.0, @@ -8941,7 +8941,7 @@ "bscf_nevins": "bootstrap current fraction, Nevins et al model", "bscf_sauter": "bootstrap current fraction, Sauter et al model", "bscf_wilson": "bootstrap current fraction, Wilson et al model", - "bscfmax": "maximum fraction of plasma current from bootstrap; if `bscfmax < 0`,\n bootstrap fraction = abs(bscfmax)", + "bootstrap_current_fraction_max": "maximum fraction of plasma current from bootstrap; if `bootstrap_current_fraction_max < 0`,\n bootstrap fraction = abs(bootstrap_current_fraction_max)", "bt": "toroidal field on axis (T) (`iteration variable 2`)", "btot": "total toroidal + poloidal field (T)", "burnup": "fractional plasma burnup", @@ -10178,7 +10178,7 @@ "nre": "", "nsix": "", "nsixi": "", - "nsweep": "Switch denoting quantity to scan:
      \n
    • 1 aspect\n
    • 2 hldivlim\n
    • 3 pnetelin\n
    • 4 hfact\n
    • 5 oacdcp\n
    • 6 walalw\n
    • 7 beamfus0\n
    • 8 fqval\n
    • 9 te\n
    • 10 boundu(15: fvs)\n
    • 11 dnbeta\n
    • 12 bscfmax (use negative values only)\n
    • 13 boundu(10: hfact)\n
    • 14 fiooic\n
    • 15 fjprot\n
    • 16 rmajor\n
    • 17 bmxlim\n
    • 18 gammax\n
    • 19 boundl(16: ohcth)\n
    • 20 tbrnmn\n
    • 21 not used\n
    • 22 cfactr (N.B. requires iavail=0)\n
    • 23 boundu(72: fipir)\n
    • 24 powfmax\n
    • 25 kappa\n
    • 26 triang\n
    • 27 tbrmin (for blktmodel > 0 only)\n
    • 28 bt\n
    • 29 coreradius\n
    • 31 taulimit\n
    • 32 epsvmc\n
    • 33 ttarget\n
    • 34 qtargettotal\n
    • 35 lambda_q_omp\n
    • 36 lambda_target\n
    • 37 lcon_factor\n
    • 38 Neon upper limit\n
    • 39 Argon upper limit\n
    • 40 Xenon upper limit\n
    • 41 blnkoth\n
    • 42 Argon fraction fimp(9)\n
    • 43 normalised minor radius at which electron cyclotron current drive is maximum\n
    • 44 Allowable maximum shear stress (Tresca) in tf coil structural material\n
    • 45 Minimum allowable temperature margin ; tf coils\n
    • 46 boundu(150) fgwsep\n
    • 47 impurity_enrichment(9) Argon impurity enrichment\n
    • 48 TF coil - n_pancake (integer turn winding pack)\n
    • 49 TF coil - n_layer (integer turn winding pack)\n
    • 50 Xenon fraction fimp(13)\n
    • 51 Power fraction to lower DN Divertor ftar\n
    • 52 SoL radiation fraction\n
    • 54 GL_nbti upper critical field at 0 Kelvin\n
    • 55 `shldith` : Inboard neutron shield thickness\n
    • 56 crypmw_max: Maximum cryogenic power (ixx=164, ixc=87)\n
    • 57 `bt` lower boundary\n
    • 58 `scrapli` : Inboard plasma-first wall gap\n
    • 59 `scraplo` : Outboard plasma-first wall gap\n
    • 60 sig_tf_wp_max: Allowable stress in TF Coil conduit (Tresca)\n
    • 61 copperaoh_m2_max : CS coil current / copper area\n
    • 62 coheof : CS coil current density at EOF\n
    • 63 ohcth : CS thickness (m)\n
    • 64 ohhghf : CS height (m)
    ", + "nsweep": "Switch denoting quantity to scan:
      \n
    • 1 aspect\n
    • 2 hldivlim\n
    • 3 pnetelin\n
    • 4 hfact\n
    • 5 oacdcp\n
    • 6 walalw\n
    • 7 beamfus0\n
    • 8 fqval\n
    • 9 te\n
    • 10 boundu(15: fvs)\n
    • 11 dnbeta\n
    • 12 bootstrap_current_fraction_max (use negative values only)\n
    • 13 boundu(10: hfact)\n
    • 14 fiooic\n
    • 15 fjprot\n
    • 16 rmajor\n
    • 17 bmxlim\n
    • 18 gammax\n
    • 19 boundl(16: ohcth)\n
    • 20 tbrnmn\n
    • 21 not used\n
    • 22 cfactr (N.B. requires iavail=0)\n
    • 23 boundu(72: fipir)\n
    • 24 powfmax\n
    • 25 kappa\n
    • 26 triang\n
    • 27 tbrmin (for blktmodel > 0 only)\n
    • 28 bt\n
    • 29 coreradius\n
    • 31 taulimit\n
    • 32 epsvmc\n
    • 33 ttarget\n
    • 34 qtargettotal\n
    • 35 lambda_q_omp\n
    • 36 lambda_target\n
    • 37 lcon_factor\n
    • 38 Neon upper limit\n
    • 39 Argon upper limit\n
    • 40 Xenon upper limit\n
    • 41 blnkoth\n
    • 42 Argon fraction fimp(9)\n
    • 43 normalised minor radius at which electron cyclotron current drive is maximum\n
    • 44 Allowable maximum shear stress (Tresca) in tf coil structural material\n
    • 45 Minimum allowable temperature margin ; tf coils\n
    • 46 boundu(150) fgwsep\n
    • 47 impurity_enrichment(9) Argon impurity enrichment\n
    • 48 TF coil - n_pancake (integer turn winding pack)\n
    • 49 TF coil - n_layer (integer turn winding pack)\n
    • 50 Xenon fraction fimp(13)\n
    • 51 Power fraction to lower DN Divertor ftar\n
    • 52 SoL radiation fraction\n
    • 54 GL_nbti upper critical field at 0 Kelvin\n
    • 55 `shldith` : Inboard neutron shield thickness\n
    • 56 crypmw_max: Maximum cryogenic power (ixx=164, ixc=87)\n
    • 57 `bt` lower boundary\n
    • 58 `scrapli` : Inboard plasma-first wall gap\n
    • 59 `scraplo` : Outboard plasma-first wall gap\n
    • 60 sig_tf_wp_max: Allowable stress in TF Coil conduit (Tresca)\n
    • 61 copperaoh_m2_max : CS coil current / copper area\n
    • 62 coheof : CS coil current density at EOF\n
    • 63 ohcth : CS thickness (m)\n
    • 64 ohhghf : CS height (m)
    ", "nsweep_2": "nsweep_2 /3/ : switch denoting quantity to scan for 2D scan:", "nt": "", "ntype": "switch for vacuum pump type:\n
      \n
    • =0 - for turbomolecular pump (magnetic bearing) with speed of 2.0 m3/s\n (1.95 for N2, 1.8 for He, 1.8 for DT)
    • \n
    • =1 - for compound cryopump with nominal speed of 10.0 m3/s\n (9.0 for N2, 5.0 for He and 25.0 for DT)
    • \n
    ", @@ -11776,7 +11776,7 @@ "lb": 1, "ub": 3 }, - "bscfmax": { + "bootstrap_current_fraction_max": { "lb": -0.999, "ub": 0.999 }, @@ -17757,7 +17757,7 @@ "beamwd", "bigq", "bootipf", - "bscfmax", + "bootstrap_current_fraction_max", "bscf_iter89", "bscf_nevins", "bscf_sauter", @@ -19874,7 +19874,7 @@ "1": "aspect", "10": "boundu(15)", "11": "dnbeta", - "12": "bscfmax", + "12": "bootstrap_current_fraction_max", "13": "boundu(10)", "14": "fiooic", "15": "fjprot", @@ -20032,7 +20032,7 @@ "breeder_f": "real_variable", "breeder_multiplier": "real_variable", "breedmat": "int_variable", - "bscfmax": "real_variable", + "bootstrap_current_fraction_max": "real_variable", "bt": "real_variable", "c1div": "real_variable", "c2div": "real_variable", diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT index 927dbf9be0..c5282122ce 100644 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ b/tests/regression/input_files/large_tokamak.IN.DAT @@ -453,7 +453,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index 686a758ea0..7b040218cf 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -435,7 +435,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/regression/input_files/large_tokamak_once_through.IN.DAT b/tests/regression/input_files/large_tokamak_once_through.IN.DAT index 02068bac1e..27f3598b05 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -160,7 +160,7 @@ output_costs = 1 * Switch for costs output; *-------------Current Drive Variables--------------* -bscfmax = 0.95 * maximum fraction of plasma current from bootstrap; if `bscfmax < 0`; +bootstrap_current_fraction_max = 0.95 * maximum fraction of plasma current from bootstrap; if `bootstrap_current_fraction_max < 0`; etaech = 0.5 * ECH wall plug to injector efficiency gamma_ecrh = 0.30 * User input ECRH gamma (1;0e20 A/(W m^2)) iefrf = 10 * Switch for current drive efficiency model; diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index c130aec0db..4829042abe 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -2929,7 +2929,7 @@ etaech = 0.45 * Bootstrap Current * *-------------------* -bscfmax = 0.9 +bootstrap_current_fraction_max = 0.9 * DESCRIPTION: Maximum Fraction of Plasma Current from Bootstrap * JUSTIFICATION: upper limit set for plasma stability * diff --git a/tests/unit/data/large_tokamak_IN.DAT b/tests/unit/data/large_tokamak_IN.DAT index 62abe986c3..cac0303b87 100644 --- a/tests/unit/data/large_tokamak_IN.DAT +++ b/tests/unit/data/large_tokamak_IN.DAT @@ -453,7 +453,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 184867eb68..5fa1328116 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -530,7 +530,7 @@ Ratio_of_power_for_flat-top_to_start-up_(MW)____________________________ (startupratio)________________ 1.0000E+00 Auxiliary_power_used_for_plasma_heating_only_(MW)_______________________ (pheat)_______________________ 7.5000E+01 Power_injected_for_current_drive_(MW)___________________________________ (pcurrentdrivemw)_____________ 4.7098E+00 - Maximum_Allowed_Bootstrap_current_fraction______________________________ (bscfmax)_____________________ 9.5000E-01 + Maximum_Allowed_Bootstrap_current_fraction______________________________ (bootstrap_current_fraction_max)_____________________ 9.5000E-01 Fusion_gain_factor_Q____________________________________________________ (bigq)________________________ 2.0141E+01 OP Auxiliary_current_drive_(A)_____________________________________________ (auxiliary_cd)________________ 2.2041E+05 OP Current_drive_efficiency_(A/W)__________________________________________ (effcd)_______________________ 4.6799E-02 OP @@ -1644,7 +1644,7 @@ tramp = 500.0 *---------------* * Maximum fraction of plasma current from bootstrap -bscfmax = 0.95 +bootstrap_current_fraction_max = 0.95 * Switch for current drive efficiency model iefrf = 10 From 771ef4ead809478cc9e08c775f86cc65f569b03c Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 14:28:33 +0100 Subject: [PATCH 085/108] :memo: Add derivation of plasma current formula --- .../plasma_current/plasma_current.md | 80 ++++++++++++++++--- 1 file changed, 70 insertions(+), 10 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index f2c7e7040d..d020d39372 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -2,33 +2,93 @@ ## Overview +In tokamaks, the plasma current ($I_{\text{p}}$) plays a crucial role in confining the plasma and maintaining the stability of the magnetic fields. The plasma current generates a poloidal magnetic field, which, when combined with the toroidal magnetic field, creates a helical magnetic field structure. +The plasma current is typically driven by inductive means, where a central solenoid induces a current in the plasma, similar to the secondary winding of a transformer. However, non-inductive methods such as neutral beam injection and radiofrequency (RF) heating are also employed, especially for steady-state operation. +-------------------------- +### Derivation +Starting with the definition of $q$ in an axisymmetrix equilibria: +$$ +q = \frac{\Delta \phi}{2\pi} +$$ -## Plasma Current Calculation | `calculate_plasma_current()` +This is defined as the rate of returning to the same position in the poloidal plane after a change of toroidal angle $\Delta \phi$. -This function calculates the plasma current shaping factor ($f_q$), then plasma current ($I_{\text{p}}$) then qstar ($q^*$) then normalized beta ($\beta_{\text{N}}$) then poloidal field and the profile settings for $\mathtt{alphaj}$ ($\alpha_J$) and $\mathtt{rli}$ ($l_{\mathtt{i}}$) +In order to calculate the value of $q$ it is neccessary to use the equation of the field line: + +$$ +\frac{R d\phi}{ds} = \frac{B_{\text{T}}}{B_{\text{p}}} +$$ -A number of plasma current scaling laws are available in PROCESS. These are calculated in -routine `calculate_plasma_current()`, in `physics.py`. The safety factor $q_{95}$ required to prevent disruptive MHD instabilities dictates the plasma current $I_{\text{p}}$: +where $ds$ is the distance moved in the poloidal direction while moving through a toroidal angle $d\phi$ and $B_{\text{p}}$ and $B_{\text{T}}$ are the poloidal and toroidal magnetic fields. -$$\begin{aligned} -I_{\text{p}} = f_q \frac{2\pi}{\mu_0} \frac{a^2 B_{\text{T}}}{R \ q_{95}} -\end{aligned}$$ +Re-arranging the two equations above and substituting for $q$ we get: + +$$ +q = \frac{1}{2\pi} \oint \frac{1}{R}\frac{B_{\text{T}}}{B_{\text{p}}} ds +$$ + +where the integral is carrie dout over a single poloidal circuit around the flux surface. + +Assuming a large aspect ratio tokamak that has a circular plasma cross-section the integral simplifies to: + +$$ +q = \frac{r}{R_0}\frac{B_{\text{T}}}{B_{\text{p}}} +$$ + +where $r$ is the minor radius of the flux surface and $R_0$ is the major radius of the tokamak. Above is done assuming $ds = 2\pi r$ + + +From above, **assuming the toroidal field to be a contant radially**, the only variation of $q$ across the flux surfaces is caused solely by the poloidal magnetic field produced by the plasma current. Again assuming a large aspect ratio machine with circular plasma and flux surface cross sections, the toroidal current density profile $j(r)$, dictates $q$. + +Writing the plasma currernt via [Amperes's law](https://en.wikipedia.org/wiki/Amp%C3%A8re%27s_circuital_law): $$ -\mu_0 I = \mu_0 \int j_{\phi}\cdot \text{d}s = \int \nabla \times B \cdot \text{d}s = \oint B \cdot \text{d}l_{\text{p}} = 2\pi a l B_{\text{p}}(a) +2\pi r B_{\text{p}} = \mu_0 I(r) $$ -Where $l$ is the ratio of the poloidal plasma circumference to the circumference of the inscribed circle of radius $a$. The function $q$ becomes: +where the current inside $r$ is: $$ -q(r) = \frac{RB_{\phi}}{2\pi}\oint \frac{\text{d}l_{\text{p}}}{R^2B_{\text{p}}} = \frac{rlB_{\phi}}{RB_{\text{p}(r)}} +I(r) = 2\pi \int_0^r j(r^{\prime})r^{\prime} dr^{\prime} $$ +Substituting into the value of $q$ above: + +$$ +q(r) = \frac{2\pi r^2 B_{\text{T}}}{\mu_0 I(r) R} +$$ + +Taking the limit of $r$ to be the plasma minor radius, $a$: + +$$ +q_a = \frac{2\pi a^2 B_{\text{T}}}{\mu_0 I R} +$$ + +Re-arranging for $I$ we get a function for the total plasma current: + +$$ +I = \frac{2\pi a^2B_{\text{T}}}{\mu_0q_{95} R} +$$ + +Instead of $q_a$, $q_{95}$ is used as in plasma confurations with divertors the poloidal magnetic field has a null at the X-point. Thus as the separatrix is approached, $q$ tends to infinity. + +----------------- + +## Plasma Current Calculation | `calculate_plasma_current()` + +This function calculates the plasma current shaping factor ($f_q$), then plasma current ($I_{\text{p}}$) then qstar ($q^*$) then normalized beta ($\beta_{\text{N}}$) then poloidal field and the profile settings for $\mathtt{alphaj}$ ($\alpha_J$) and $\mathtt{rli}$ ($l_{\mathtt{i}}$) + + +$$\begin{aligned} +I_{\text{p}} = f_q \frac{2\pi}{\mu_0} \frac{a^2 B_{\text{T}}}{R \ q_{95}} +\end{aligned}$$ + + The factor $f_q$ makes allowance for toroidal effects and plasma shaping (elongation and triangularity). Several formulae for this factor are available depending on the value of the switch `i_plasma_current`, as follows: From 1018d8718f260ee4bbc077aa54bae68a7030c832 Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 16:18:19 +0100 Subject: [PATCH 086/108] Refactor variable name psipf to ps_current_fraction in current_drive.py and current_drive_variables.f90 --- .../data/csv_output_large_tokamak_MFILE.DAT | 4 +- examples/data/large_tokamak_1_MFILE.DAT | 4 +- examples/data/large_tokamak_2_MFILE.DAT | 4 +- examples/data/large_tokamak_3_MFILE.DAT | 4 +- examples/data/large_tokamak_4_MFILE.DAT | 4 +- examples/data/scan_MFILE.DAT | 36 +++++------ process/current_drive.py | 4 +- process/physics.py | 8 +-- source/fortran/current_drive_variables.f90 | 4 +- .../data/large_tokamak_1_MFILE.DAT | 4 +- .../data/large_tokamak_2_MFILE.DAT | 4 +- .../data/large_tokamak_3_MFILE.DAT | 4 +- .../data/large_tokamak_4_MFILE.DAT | 4 +- .../integration/data/large_tokamak_MFILE.DAT | 4 +- tests/integration/data/scan_2D_MFILE.DAT | 60 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 36 +++++------ tests/integration/ref_dicts.json | 6 +- tests/unit/data/large_tokamak_MFILE.DAT | 4 +- tests/unit/test_current_drive.py | 8 +-- 19 files changed, 103 insertions(+), 103 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 8d40848a4c..3cff57af98 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -520,7 +520,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.2449E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1436E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9627E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0562E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0010E+03 OP @@ -544,7 +544,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1436E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 5.9038E-04 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.8505E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index cb68dac12b..ec6758962b 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -516,7 +516,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0283E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1920E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.7450E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9755E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0619E+03 OP @@ -542,7 +542,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 23169207eb..426adfc7ff 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -516,7 +516,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0283E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1920E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.7450E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9755E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0619E+03 OP @@ -542,7 +542,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index dc89cb5f4e..240ba92a91 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -516,7 +516,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0283E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1920E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.7450E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9755E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0619E+03 OP @@ -542,7 +542,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index 7a28a871a8..bd594b8285 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -516,7 +516,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0283E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1920E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.7450E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9755E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0619E+03 OP @@ -542,7 +542,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 542ee077a3..737503ac75 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -373,7 +373,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -397,7 +397,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -1368,7 +1368,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -1392,7 +1392,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -2363,7 +2363,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -2387,7 +2387,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -3358,7 +3358,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -3382,7 +3382,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -4353,7 +4353,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -4377,7 +4377,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -5348,7 +5348,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -5372,7 +5372,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -6343,7 +6343,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -6367,7 +6367,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -7338,7 +7338,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -7362,7 +7362,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -8333,7 +8333,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -8357,7 +8357,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/process/current_drive.py b/process/current_drive.py index 7e7cd84109..25aa9048b2 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -923,8 +923,8 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Pfirsch-Schlueter fraction", - "(psipf)", - current_drive_variables.psipf, + "(ps_current_fraction)", + current_drive_variables.ps_current_fraction, "OP ", ) po.ovarrf( diff --git a/process/physics.py b/process/physics.py index 25e651f197..56c0a06bbf 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1631,7 +1631,7 @@ def physics(self): current_drive_variables.pscf_scene = ps_fraction_scene(physics_variables.beta) if physics_variables.i_pfirsch_schluter_current == 1: - current_drive_variables.psipf = current_drive_variables.pscf_scene + current_drive_variables.ps_current_fraction = current_drive_variables.pscf_scene # ***************************** # # BOOTSTRAP CURRENT # @@ -1760,7 +1760,7 @@ def physics(self): current_drive_variables.plasma_current_internal_fraction = ( current_drive_variables.bootstrap_current_fraction + current_drive_variables.diamagnetic_current_fraction - + current_drive_variables.psipf + + current_drive_variables.ps_current_fraction ) # Plasma driven current fraction (Bootstrap + Diamagnetic @@ -4926,8 +4926,8 @@ def outplas(self): po.ovarrf( self.outfile, "Pfirsch-Schlueter fraction (enforced)", - "(psipf.)", - current_drive_variables.psipf, + "(ps_current_fraction.)", + current_drive_variables.ps_current_fraction, "OP ", ) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index c6aeef7f7d..d68e097db7 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -208,7 +208,7 @@ module current_drive_variables real(dp) :: porbitlossmw !! neutral beam power lost after ionisation but before thermalisation (orbit loss power) (MW) - real(dp) :: psipf + real(dp) :: ps_current_fraction !! Pfirsch-Schlüter current fraction real(dp) :: pwplh @@ -286,7 +286,7 @@ subroutine init_current_drive_variables plhybd = 0.0D0 pnbeam = 0.0D0 porbitlossmw = 0.0D0 - psipf = 0.0D0 + ps_current_fraction = 0.0D0 pwplh = 0.0D0 pwpnb = 0.0D0 rtanbeam = 0.0D0 diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 1d1c290283..dce48517df 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -516,7 +516,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0283E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1920E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.7450E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9755E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0619E+03 OP @@ -542,7 +542,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index b1c83a75ff..0d5efc0b15 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -516,7 +516,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0283E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1920E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.7450E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9755E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0619E+03 OP @@ -542,7 +542,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 3e1abf1d78..55215063e7 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -516,7 +516,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0283E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1920E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.7450E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9755E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0619E+03 OP @@ -542,7 +542,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 41398b4a0c..cf765c9bdd 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -516,7 +516,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0283E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1920E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.7450E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9755E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0619E+03 OP @@ -542,7 +542,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 5fa1328116..5db5b6c1d2 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -513,7 +513,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.9744E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2290E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.6762E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9470E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0839E+03 OP @@ -539,7 +539,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2290E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.3342E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6376E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index b17cf56f22..9708ec6dd6 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -518,7 +518,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0453E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1061E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 4.1078E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0689E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 2.9916E+03 OP @@ -543,7 +543,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1061E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.0930E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -1681,7 +1681,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.1749E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1146E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 4.0431E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0820E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 2.9820E+03 OP @@ -1706,7 +1706,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1146E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9548E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -2844,7 +2844,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.3075E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1238E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 4.0227E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.1144E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 2.9585E+03 OP @@ -2869,7 +2869,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1238E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.5526E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.8606E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -4007,7 +4007,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.3228E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1715E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9960E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0884E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 2.9773E+03 OP @@ -4032,7 +4032,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1715E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.8847E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -5170,7 +5170,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.1983E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1531E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9998E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0680E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 2.9923E+03 OP @@ -5195,7 +5195,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1531E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9218E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -6333,7 +6333,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0727E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1452E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9635E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0504E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0053E+03 OP @@ -6358,7 +6358,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1452E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9136E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -7496,7 +7496,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.0874E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.1915E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9388E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0293E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0210E+03 OP @@ -7521,7 +7521,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1915E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9320E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -8659,7 +8659,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.2087E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2074E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9711E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0529E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0034E+03 OP @@ -8684,7 +8684,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2074E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9395E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -9822,7 +9822,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.3286E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2337E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 4.0073E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0706E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 2.9903E+03 OP @@ -9847,7 +9847,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2337E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9780E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -10985,7 +10985,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.3525E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2713E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9907E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0501E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0054E+03 OP @@ -11010,7 +11010,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2713E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9910E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -12148,7 +12148,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.2353E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2391E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9599E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0408E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0124E+03 OP @@ -12173,7 +12173,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2391E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9399E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -13311,7 +13311,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.1141E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2221E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9340E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0207E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0274E+03 OP @@ -13336,7 +13336,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2221E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9353E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -14474,7 +14474,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.1347E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2611E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9155E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9990E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0439E+03 OP @@ -14499,7 +14499,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2611E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9505E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -15637,7 +15637,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.2650E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2685E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.9658E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0183E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0292E+03 OP @@ -15662,7 +15662,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2685E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9754E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -16800,7 +16800,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -3.4036E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2763E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 4.0161E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 4.0375E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0148E+03 OP @@ -16825,7 +16825,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2763E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9990E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 0af7f60750..2b98b06d51 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -373,7 +373,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -397,7 +397,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -1368,7 +1368,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -1392,7 +1392,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -2363,7 +2363,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -2387,7 +2387,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -3358,7 +3358,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -3382,7 +3382,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -4353,7 +4353,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -4377,7 +4377,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -5348,7 +5348,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -5372,7 +5372,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -6343,7 +6343,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -6367,7 +6367,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -7338,7 +7338,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -7362,7 +7362,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 @@ -8333,7 +8333,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.7628E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 3.8470E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.1974E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 2.8865E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 4.8432E+03 OP @@ -8357,7 +8357,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 5a383d1a01..550c031d94 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -3625,7 +3625,7 @@ "psep_kallenbach": 0.0, "psepbqarmax": 9.5, "pseprmax": 25.0, - "psipf": 0.0, + "ps_current_fraction": 0.0, "psolradmw": 0.0, "psurffwi": 0.0, "psurffwo": 0.0, @@ -10368,7 +10368,7 @@ "psep_kallenbach": "Power conducted through the separatrix, as calculated by the divertor model [W]\n Not equal to pdivt unless `constraint 69` is imposed.", "psepbqarmax": "maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`)", "pseprmax": "maximum ratio of power crossing the separatrix to plasma major radius (Psep/R) (MW/m)\n (`constraint equation 56`)", - "psipf": "Pfirsch-Schl\u00fcter current fraction", + "ps_current_fraction": "Pfirsch-Schl\u00fcter current fraction", "psolradmw": "SOL radiation power (MW) (`stellarator only`)", "psurffwi": "Surface heat flux on first wall (MW) (sum = pradfw)", "psurffwo": "Surface heat flux on first wall (MW) (sum = pradfw)", @@ -17804,7 +17804,7 @@ "plhybd", "pnbeam", "porbitlossmw", - "psipf", + "ps_current_fraction", "pwplh", "pwpnb", "rtanbeam", diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 5fa1328116..5db5b6c1d2 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -513,7 +513,7 @@ Pfirsch-Schlueter_fraction_(SCENE)______________________________________ (pscf_scene)__________________ -2.9744E-03 Bootstrap_fraction_(enforced)___________________________________________ (bootipf.)____________________ 4.2290E-01 Diamagnetic_fraction_(enforced)_________________________________________ (diaipf.)_____________________ 0.0000E+00 - Pfirsch-Schlueter_fraction_(enforced)___________________________________ (psipf.)______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction_(enforced)___________________________________ (ps_current_fraction.)______________________ 0.0000E+00 Loop_voltage_during_burn_(V)____________________________________________ (vburn)_______________________ 3.6762E-02 OP Plasma_resistance_(ohm)_________________________________________________ (rplas)_______________________ 3.9470E-09 OP Resistive_diffusion_time_(s)____________________________________________ (res_time)____________________ 3.0839E+03 OP @@ -539,7 +539,7 @@ ECRH_plasma_heating_efficiency__________________________________________ (gamma_ecrh)__________________ 3.0000E-01 Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2290E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 - Pfirsch-Schlueter_fraction______________________________________________ (psipf)_______________________ 0.0000E+00 + Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.3342E-02 Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6376E-01 Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 0dbc3dacb5..3374e8f263 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -110,7 +110,7 @@ class CudrivParam(NamedTuple): diamagnetic_current_fraction: Any = None - psipf: Any = None + ps_current_fraction: Any = None plasma_current_internal_fraction: Any = None @@ -247,7 +247,7 @@ class CudrivParam(NamedTuple): rtanbeam=0, rtanmax=0, diamagnetic_current_fraction=0, - psipf=0, + ps_current_fraction=0, plasma_current_internal_fraction=0.27635918746616817, harnum=1, xi_ebw=0.80000000000000004, @@ -337,7 +337,7 @@ class CudrivParam(NamedTuple): rtanbeam=8.4000000000000004, rtanmax=13.179564451855533, diamagnetic_current_fraction=0, - psipf=0, + ps_current_fraction=0, plasma_current_internal_fraction=0.27635918746616817, harnum=1, xi_ebw=0.80000000000000004, @@ -499,7 +499,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): cudrivparam.diamagnetic_current_fraction, ) - monkeypatch.setattr(current_drive_variables, "psipf", cudrivparam.psipf) + monkeypatch.setattr(current_drive_variables, "ps_current_fraction", cudrivparam.ps_current_fraction) monkeypatch.setattr( current_drive_variables, From 0ef1a61da1abb060e2db7c95c77371310d646bac Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 16:24:50 +0100 Subject: [PATCH 087/108] Refactor variable name facoh to inductive_current_fraction in multiple files --- .../data/csv_output_large_tokamak_MFILE.DAT | 4 +- examples/data/large_tokamak_1_MFILE.DAT | 4 +- examples/data/large_tokamak_2_MFILE.DAT | 4 +- examples/data/large_tokamak_3_MFILE.DAT | 4 +- examples/data/large_tokamak_4_MFILE.DAT | 4 +- examples/data/scan_MFILE.DAT | 36 +++++------ process/current_drive.py | 12 ++-- process/io/mfile_comparison.py | 4 +- process/io/plot_proc.py | 10 ++-- process/io/variable_metadata.py | 2 +- process/pfcoil.py | 4 +- process/physics.py | 20 +++---- process/pulse.py | 2 +- source/fortran/physics_variables.f90 | 4 +- .../data/large_tokamak_1_MFILE.DAT | 4 +- .../data/large_tokamak_2_MFILE.DAT | 4 +- .../data/large_tokamak_3_MFILE.DAT | 4 +- .../data/large_tokamak_4_MFILE.DAT | 4 +- .../integration/data/large_tokamak_MFILE.DAT | 4 +- tests/integration/data/scan_2D_MFILE.DAT | 60 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 36 +++++------ tests/integration/ref_dicts.json | 6 +- tests/unit/data/large_tokamak_MFILE.DAT | 4 +- tests/unit/test_current_drive.py | 8 +-- tests/unit/test_physics.py | 14 ++--- tests/unit/test_pulse.py | 8 +-- tracking/tracking_data.py | 2 +- 27 files changed, 136 insertions(+), 136 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 3cff57af98..62c37d79ee 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -546,8 +546,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 5.9038E-04 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.8505E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8505E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5213E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index ec6758962b..2fc112252c 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 426adfc7ff..fbc7f3818d 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 240ba92a91..c156e013ea 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index bd594b8285..f6cca154f1 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 737503ac75..1a31a5b56b 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -399,8 +399,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -1394,8 +1394,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -2389,8 +2389,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -3384,8 +3384,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -4379,8 +4379,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -5374,8 +5374,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -6369,8 +6369,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -7364,8 +7364,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -8359,8 +8359,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 diff --git a/process/current_drive.py b/process/current_drive.py index 25aa9048b2..d861b486eb 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -766,7 +766,7 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) - if abs(physics_variables.facoh) > 1.0e-8: + if abs(physics_variables.inductive_current_fraction) > 1.0e-8: po.ocmmnt(self.outfile, "Current is driven by both inductive") po.ocmmnt(self.outfile, "and non-inductive means.") @@ -937,24 +937,24 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Inductive fraction", - "(facoh)", - physics_variables.facoh, + "(inductive_current_fraction)", + physics_variables.inductive_current_fraction, "OP ", ) # Add total error check. po.ovarrf( self.outfile, "Total", - "(plasma_current_internal_fraction+faccd+facoh)", + "(plasma_current_internal_fraction+faccd+inductive_current_fraction)", current_drive_variables.plasma_current_internal_fraction + physics_variables.faccd - + physics_variables.facoh, + + physics_variables.inductive_current_fraction, ) if ( abs( current_drive_variables.plasma_current_internal_fraction + physics_variables.faccd - + physics_variables.facoh + + physics_variables.inductive_current_fraction - 1.0e0 ) > 1.0e-8 diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index b730c23e4f..ea25266e98 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -86,7 +86,7 @@ "pheat", "bootstrap_current_fraction", "faccd", - "facoh", + "inductive_current_fraction", "gamnb", "enbeam", "powerht", @@ -175,7 +175,7 @@ "pheat", "bootstrap_current_fraction", "faccd", - "facoh", + "inductive_current_fraction", "gamnb", "enbeam", "powerht", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index dd2df4bce1..f8d80f75f4 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2737,7 +2737,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), - ("facoh", "Inductive fraction", ""), + ("inductive_current_fraction", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), ( "effcd", @@ -2767,7 +2767,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), - ("facoh", "Inductive fraction", ""), + ("inductive_current_fraction", "Inductive fraction", ""), ("gamnb", "NB gamma", "$10^{20}$ A W$^{-1}$ m$^{-2}$"), ("enbeam", "NB energy", "keV"), ("powerht", "Plasma heating used for H factor", "MW"), @@ -2793,7 +2793,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), - ("facoh", "Inductive fraction", ""), + ("inductive_current_fraction", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), ( "gamcd", @@ -2822,7 +2822,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), - ("facoh", "Inductive fraction", ""), + ("inductive_current_fraction", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), ( "gamcd", @@ -2851,7 +2851,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), ("faccd", "Auxiliary fraction", ""), - ("facoh", "Inductive fraction", ""), + ("inductive_current_fraction", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), ( "gamcd", diff --git a/process/io/variable_metadata.py b/process/io/variable_metadata.py index 3e376e443b..9d9eb9b019 100644 --- a/process/io/variable_metadata.py +++ b/process/io/variable_metadata.py @@ -233,7 +233,7 @@ class VariableMetadata: "faccd": VariableMetadata( latex=r"$f_{\mathrm{CD}}$", description="CD factor", units="" ), - "facoh": VariableMetadata( + "inductive_current_fraction": VariableMetadata( latex=r"$f_{\mathrm{CD,ind}}$", description="Inductive CD factor", units="" ), "bootstrap_current_fraction": VariableMetadata( diff --git a/process/pfcoil.py b/process/pfcoil.py index 4cafb95b39..ffc08c8ed8 100644 --- a/process/pfcoil.py +++ b/process/pfcoil.py @@ -1112,7 +1112,7 @@ def ohcalc(self): # Calculation of CS fatigue # this is only valid for pulsed reactor design - if pv.facoh > 0.0e-4: + if pv.inductive_current_fraction > 0.0e-4: csfv.n_cycle, csfv.t_crack_radial = self.cs_fatigue.ncycle( pf.sig_hoop, csfv.residual_sig_hoop, @@ -2126,7 +2126,7 @@ def outpf(self): tfv.tmargmin_cs, ) # only output CS fatigue model for pulsed reactor design - if pv.facoh > 0.0e-4: + if pv.inductive_current_fraction > 0.0e-4: op.ovarre( self.outfile, "Residual hoop stress in CS Steel (Pa)", diff --git a/process/physics.py b/process/physics.py index 56c0a06bbf..a80256daed 100644 --- a/process/physics.py +++ b/process/physics.py @@ -59,7 +59,7 @@ def rether(alphan, alphat, dene, dlamie, te, ti, zeffai): def vscalc( csawth, eps, - facoh, + inductive_current_fraction, gamma, kappa, rmajor, @@ -74,7 +74,7 @@ def vscalc( author: P J Knight, CCFE, Culham Science Centre csawth : input real : coefficient for sawteeth effects eps : input real : inverse aspect ratio - facoh : input real : fraction of plasma current produced inductively + inductive_current_fraction : input real : fraction of plasma current produced inductively gamma : input real : Ejima coeff for resistive start-up V-s component kappa : input real : plasma elongation plascur: input real : plasma current (A) @@ -124,7 +124,7 @@ def vscalc( # Include enhancement factor in flattop V-s requirement # to account for MHD sawtooth effects. - vburn = plascur * rplas * facoh * csawth + vburn = plascur * rplas * inductive_current_fraction * csawth # N.B. tburn on first iteration will not be correct # if the pulsed reactor option is used, but the value @@ -1780,7 +1780,7 @@ def physics(self): physics_module.err243 = 1 # Fraction of plasma current produced by inductive means - physics_variables.facoh = max(1.0e-10, (1.0e0 - physics_variables.fvsbrnni)) + physics_variables.inductive_current_fraction = max(1.0e-10, (1.0e0 - physics_variables.fvsbrnni)) # Fraction of plasma current produced by auxiliary current drive physics_variables.faccd = ( physics_variables.fvsbrnni @@ -1938,7 +1938,7 @@ def physics(self): physics_variables.rpfac, physics_variables.rplas, ) = self.pohm( - physics_variables.facoh, + physics_variables.inductive_current_fraction, physics_variables.kappa95, physics_variables.plascur, physics_variables.rmajor, @@ -2079,7 +2079,7 @@ def physics(self): ) = vscalc( physics_variables.csawth, physics_variables.eps, - physics_variables.facoh, + physics_variables.inductive_current_fraction, physics_variables.gamma, physics_variables.kappa, physics_variables.rmajor, @@ -2700,7 +2700,7 @@ def phyaux( return burnup, dntau, figmer, fusrat, qfuel, rndfuel, taup @staticmethod - def pohm(facoh, kappa95, plascur, rmajor, rminor, ten, vol, zeff): + def pohm(inductive_current_fraction, kappa95, plascur, rmajor, rminor, ten, vol, zeff): # Density weighted electron temperature in 10 keV units t10 = ten / 10.0 @@ -2731,9 +2731,9 @@ def pohm(facoh, kappa95, plascur, rmajor, rminor, ten, vol, zeff): error_handling.report_error(83) # Ohmic heating power per unit volume - # Corrected from: pohmpv = (facoh*plascur)**2 * ... + # Corrected from: pohmpv = (inductive_current_fraction*plascur)**2 * ... - pohmpv = facoh * plascur**2 * rplas * 1.0e-6 / vol + pohmpv = inductive_current_fraction * plascur**2 * rplas * 1.0e-6 / vol # Total ohmic heating power @@ -4937,7 +4937,7 @@ def outplas(self): "(vburn)", physics_variables.plascur * physics_variables.rplas - * physics_variables.facoh, + * physics_variables.inductive_current_fraction, "OP ", ) po.ovarre( diff --git a/process/pulse.py b/process/pulse.py index 561b2ce487..229712880b 100755 --- a/process/pulse.py +++ b/process/pulse.py @@ -151,7 +151,7 @@ def burn(self, output: bool): vburn = ( physics_variables.plascur * physics_variables.rplas - * physics_variables.facoh + * physics_variables.inductive_current_fraction * physics_variables.csawth ) diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 93cb43f9e2..a27078edf2 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -166,7 +166,7 @@ module physics_variables real(dp) :: faccd !! fraction of plasma current produced by auxiliary current drive - real(dp) :: facoh + real(dp) :: inductive_current_fraction !! fraction of plasma current produced inductively real(dp) :: falpe @@ -926,7 +926,7 @@ subroutine init_physics_variables epbetmax = 1.38D0 eps = 0.34399724802D0 faccd = 0.0D0 - facoh = 0.0D0 + inductive_current_fraction = 0.0D0 falpe = 0.0D0 falpha = 0.95D0 falpi = 0.0D0 diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index dce48517df..9f7d773ddb 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 0d5efc0b15..67ef84149c 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 55215063e7..6c6f19de5d 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index cf765c9bdd..a69d797d12 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 5db5b6c1d2..5a2137c372 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -541,8 +541,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.3342E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6376E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6376E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 9708ec6dd6..279c0d54b9 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -545,8 +545,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.0930E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.0930E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.9070E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -1708,8 +1708,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9548E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9548E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0452E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -2871,8 +2871,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.5526E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.8606E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8606E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1394E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5559E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -4034,8 +4034,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.8847E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8847E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1153E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -5197,8 +5197,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9218E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9218E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0782E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -6360,8 +6360,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9136E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9136E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0864E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -7523,8 +7523,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9320E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9320E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0680E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -8686,8 +8686,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9395E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9395E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0605E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -9849,8 +9849,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9780E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9780E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0220E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -11012,8 +11012,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9910E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9910E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0090E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -12175,8 +12175,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9399E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9399E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0601E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -13338,8 +13338,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9353E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9353E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0647E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -14501,8 +14501,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9505E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9505E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -15664,8 +15664,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9754E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9754E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0246E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -16827,8 +16827,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.9990E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9990E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0010E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 2b98b06d51..2aab2376f0 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -399,8 +399,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -1394,8 +1394,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -2389,8 +2389,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -3384,8 +3384,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -4379,8 +4379,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -5374,8 +5374,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -6369,8 +6369,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -7364,8 +7364,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -8359,8 +8359,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (facoh)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 550c031d94..8c66cc989d 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1852,7 +1852,7 @@ "f_w": 0.5, "faccd": 0.0, "fachtmw": 0.0, - "facoh": 0.0, + "inductive_current_fraction": 0.0, "factor": 0.1, "falpe": 0.0, "falpha": 0.95, @@ -9460,7 +9460,7 @@ "f_w": "island size fraction factor", "faccd": "fraction of plasma current produced by auxiliary current drive", "fachtmw": "facility heat removal (MW)", - "facoh": "fraction of plasma current produced inductively", + "inductive_current_fraction": "fraction of plasma current produced inductively", "factor": "factor /0.1/ : used in HYBRD for first step size", "falpe": "fraction of alpha energy to electrons", "falpha": "fraction of alpha power deposited in plasma (Physics of Energetic Ions, p.2489)", @@ -19078,7 +19078,7 @@ "epbetmax", "eps", "faccd", - "facoh", + "inductive_current_fraction", "falpe", "falpha", "falpi", diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 5db5b6c1d2..5a2137c372 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -541,8 +541,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.3342E-02 - Inductive_fraction______________________________________________________ (facoh)_______________________ 5.6376E-01 - Total___________________________________________________________________ (plasipf+faccd+facoh)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6376E-01 + Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 3374e8f263..fe5eeb38d1 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -170,7 +170,7 @@ class CudrivParam(NamedTuple): powfmw: Any = None - facoh: Any = None + inductive_current_fraction: Any = None fvsbrnni: Any = None @@ -277,7 +277,7 @@ class CudrivParam(NamedTuple): ignite=0, pohmmw=0, powfmw=0, - facoh=0.59999999999999998, + inductive_current_fraction=0.59999999999999998, fvsbrnni=0.40000000000000002, startupratio=1, iprint=0, @@ -367,7 +367,7 @@ class CudrivParam(NamedTuple): ignite=0, pohmmw=0.76707314489379119, powfmw=1051.6562748933977, - facoh=0.59999999999999998, + inductive_current_fraction=0.59999999999999998, fvsbrnni=0.40000000000000002, startupratio=1, iprint=0, @@ -563,7 +563,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(physics_variables, "powfmw", cudrivparam.powfmw) - monkeypatch.setattr(physics_variables, "facoh", cudrivparam.facoh) + monkeypatch.setattr(physics_variables, "inductive_current_fraction", cudrivparam.inductive_current_fraction) monkeypatch.setattr(physics_variables, "fvsbrnni", cudrivparam.fvsbrnni) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 48757bb3b0..b368820f48 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -1378,7 +1378,7 @@ class VscalcParam(NamedTuple): eps: Any = None - facoh: Any = None + inductive_current_fraction: Any = None gamma: Any = None @@ -1415,7 +1415,7 @@ class VscalcParam(NamedTuple): VscalcParam( csawth=1, eps=0.33333333333333331, - facoh=0.59999999999999998, + inductive_current_fraction=0.59999999999999998, gamma=0.30000000000000004, kappa=1.8500000000000001, plascur=18398455.678867526, @@ -1434,7 +1434,7 @@ class VscalcParam(NamedTuple): VscalcParam( csawth=1, eps=0.33333333333333331, - facoh=0.59999999999999998, + inductive_current_fraction=0.59999999999999998, gamma=0.30000000000000004, kappa=1.8500000000000001, plascur=18398455.678867526, @@ -1465,7 +1465,7 @@ def test_vscalc(vscalcparam): phiint, rlp, vsbrn, vsind, vsres, vsstt = vscalc( csawth=vscalcparam.csawth, eps=vscalcparam.eps, - facoh=vscalcparam.facoh, + inductive_current_fraction=vscalcparam.inductive_current_fraction, gamma=vscalcparam.gamma, kappa=vscalcparam.kappa, plascur=vscalcparam.plascur, @@ -1633,7 +1633,7 @@ class PohmParam(NamedTuple): plasma_res_factor: Any = None - facoh: Any = None + inductive_current_fraction: Any = None kappa95: Any = None @@ -1664,7 +1664,7 @@ class PohmParam(NamedTuple): PohmParam( aspect=3, plasma_res_factor=0.70000000000000007, - facoh=0.59999999999999998, + inductive_current_fraction=0.59999999999999998, kappa95=1.6517857142857142, plascur=18398455.678867526, rmajor=8, @@ -1699,7 +1699,7 @@ def test_pohm(pohmparam, monkeypatch, physics): ) pohmpv, pohmmw, rpfac, rplas = physics.pohm( - facoh=pohmparam.facoh, + inductive_current_fraction=pohmparam.inductive_current_fraction, kappa95=pohmparam.kappa95, plascur=pohmparam.plascur, rmajor=pohmparam.rmajor, diff --git a/tests/unit/test_pulse.py b/tests/unit/test_pulse.py index 9442052941..4b99c86b52 100755 --- a/tests/unit/test_pulse.py +++ b/tests/unit/test_pulse.py @@ -83,7 +83,7 @@ class BurnParam(NamedTuple): plascur: Any = None - facoh: Any = None + inductive_current_fraction: Any = None csawth: Any = None @@ -1277,7 +1277,7 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): vsbn=0, vstot=-718.91787876294552, plascur=17721306.969367817, - facoh=0.60433999999999999, + inductive_current_fraction=0.60433999999999999, csawth=1, lpulse=1, tburn=0, @@ -1293,7 +1293,7 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): vstot=-718.9849676846776, vsbn=-354.76231817639609, plascur=17721306.969367817, - facoh=0.60433999999999999, + inductive_current_fraction=0.60433999999999999, csawth=1, lpulse=1, tburn=10234.092022756307, @@ -1329,7 +1329,7 @@ def test_burn(burnparam, monkeypatch, initialise_error_module, pulse): monkeypatch.setattr(physics_variables, "plascur", burnparam.plascur) - monkeypatch.setattr(physics_variables, "facoh", burnparam.facoh) + monkeypatch.setattr(physics_variables, "inductive_current_fraction", burnparam.inductive_current_fraction) monkeypatch.setattr(physics_variables, "csawth", burnparam.csawth) diff --git a/tracking/tracking_data.py b/tracking/tracking_data.py index e3ef195454..7c0053ed2b 100644 --- a/tracking/tracking_data.py +++ b/tracking/tracking_data.py @@ -120,7 +120,7 @@ class ProcessTracker: "q95", "te", "beta", - "facoh", + "inductive_current_fraction", "zeff", "bt", "hfact", From b06a8cdc5f820c75143018e80b605af61c68a2aa Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 16:28:17 +0100 Subject: [PATCH 088/108] Refactor variable name faccd to aux_current_fraction in multiple files --- .../data/csv_output_large_tokamak_MFILE.DAT | 4 +- examples/data/large_tokamak_1_MFILE.DAT | 4 +- examples/data/large_tokamak_2_MFILE.DAT | 4 +- examples/data/large_tokamak_3_MFILE.DAT | 4 +- examples/data/large_tokamak_4_MFILE.DAT | 4 +- examples/data/scan_MFILE.DAT | 36 +++++------ process/current_drive.py | 18 +++--- process/io/mfile_comparison.py | 4 +- process/io/plot_proc.py | 10 ++-- process/io/variable_metadata.py | 2 +- process/physics.py | 2 +- source/fortran/physics_variables.f90 | 4 +- .../data/large_tokamak_1_MFILE.DAT | 4 +- .../data/large_tokamak_2_MFILE.DAT | 4 +- .../data/large_tokamak_3_MFILE.DAT | 4 +- .../data/large_tokamak_4_MFILE.DAT | 4 +- .../integration/data/large_tokamak_MFILE.DAT | 4 +- tests/integration/data/scan_2D_MFILE.DAT | 60 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 36 +++++------ tests/integration/ref_dicts.json | 6 +- tests/unit/data/large_tokamak_MFILE.DAT | 4 +- tests/unit/test_current_drive.py | 8 +-- tracking/tracking_data.py | 2 +- 23 files changed, 116 insertions(+), 116 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 62c37d79ee..bfb9da0b57 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -545,9 +545,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1436E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 5.9038E-04 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 5.9038E-04 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8505E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5213E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 2fc112252c..0032552099 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index fbc7f3818d..f3db3e958d 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index c156e013ea..b8cd0d49b7 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index f6cca154f1..83cb998975 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 1a31a5b56b..e64389eb2b 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -398,9 +398,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -1393,9 +1393,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -2388,9 +2388,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -3383,9 +3383,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -4378,9 +4378,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -5373,9 +5373,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -6368,9 +6368,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -7363,9 +7363,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -8358,9 +8358,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 diff --git a/process/current_drive.py b/process/current_drive.py index d861b486eb..549f765793 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -553,14 +553,14 @@ def cudriv(self, output: bool): ) # Compute current drive wall plug and injected powers (MW) and efficiencies - auxiliary_cd = physics_variables.faccd * physics_variables.plascur + auxiliary_cd = physics_variables.aux_current_fraction * physics_variables.plascur # LHCD or ICCD if current_drive_variables.iefrf in [1, 2, 4, 6]: # Injected power current_drive_variables.plhybd = ( 1.0e-6 - * (physics_variables.faccd - faccdfix) + * (physics_variables.aux_current_fraction - faccdfix) * physics_variables.plascur / effrfss + current_drive_variables.pheat @@ -585,7 +585,7 @@ def cudriv(self, output: bool): # Injected power (set to close to close the Steady-state current equilibrium) current_drive_variables.echpwr = ( 1.0e-6 - * (physics_variables.faccd - faccdfix) + * (physics_variables.aux_current_fraction - faccdfix) * physics_variables.plascur / effrfss + current_drive_variables.pheat @@ -604,7 +604,7 @@ def cudriv(self, output: bool): # MDK. See Gitlab issue #248, and scanned note. power1 = ( 1.0e-6 - * (physics_variables.faccd - faccdfix) + * (physics_variables.aux_current_fraction - faccdfix) * physics_variables.plascur / effnbss + current_drive_variables.pheat @@ -930,8 +930,8 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Auxiliary current drive fraction", - "(faccd)", - physics_variables.faccd, + "(aux_current_fraction)", + physics_variables.aux_current_fraction, "OP ", ) po.ovarrf( @@ -945,15 +945,15 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Total", - "(plasma_current_internal_fraction+faccd+inductive_current_fraction)", + "(plasma_current_internal_fraction+aux_current_fraction+inductive_current_fraction)", current_drive_variables.plasma_current_internal_fraction - + physics_variables.faccd + + physics_variables.aux_current_fraction + physics_variables.inductive_current_fraction, ) if ( abs( current_drive_variables.plasma_current_internal_fraction - + physics_variables.faccd + + physics_variables.aux_current_fraction + physics_variables.inductive_current_fraction - 1.0e0 ) diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index ea25266e98..c7f9da6875 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -85,7 +85,7 @@ "pdivt", "pheat", "bootstrap_current_fraction", - "faccd", + "aux_current_fraction", "inductive_current_fraction", "gamnb", "enbeam", @@ -174,7 +174,7 @@ "pinjmw", "pheat", "bootstrap_current_fraction", - "faccd", + "aux_current_fraction", "inductive_current_fraction", "gamnb", "enbeam", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index f8d80f75f4..848111a1d9 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2736,7 +2736,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), - ("faccd", "Auxiliary fraction", ""), + ("aux_current_fraction", "Auxiliary fraction", ""), ("inductive_current_fraction", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), ( @@ -2766,7 +2766,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), - ("faccd", "Auxiliary fraction", ""), + ("aux_current_fraction", "Auxiliary fraction", ""), ("inductive_current_fraction", "Inductive fraction", ""), ("gamnb", "NB gamma", "$10^{20}$ A W$^{-1}$ m$^{-2}$"), ("enbeam", "NB energy", "keV"), @@ -2792,7 +2792,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), - ("faccd", "Auxiliary fraction", ""), + ("aux_current_fraction", "Auxiliary fraction", ""), ("inductive_current_fraction", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), ( @@ -2821,7 +2821,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), - ("faccd", "Auxiliary fraction", ""), + ("aux_current_fraction", "Auxiliary fraction", ""), ("inductive_current_fraction", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), ( @@ -2850,7 +2850,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("pheat", "Power for heating only", "MW"), ("bootstrap_current_fraction", "Bootstrap fraction", ""), - ("faccd", "Auxiliary fraction", ""), + ("aux_current_fraction", "Auxiliary fraction", ""), ("inductive_current_fraction", "Inductive fraction", ""), ("powerht", "Plasma heating used for H factor", "MW"), ( diff --git a/process/io/variable_metadata.py b/process/io/variable_metadata.py index 9d9eb9b019..02c359c8fa 100644 --- a/process/io/variable_metadata.py +++ b/process/io/variable_metadata.py @@ -230,7 +230,7 @@ class VariableMetadata: latex=r"$\eta_{\mathrm{CD}}$[$A/W$]", description="CD efficiency", units="A/W" ), "bigq": VariableMetadata(latex=r"$Q$", description="Plasma Q value", units=""), - "faccd": VariableMetadata( + "aux_current_fraction": VariableMetadata( latex=r"$f_{\mathrm{CD}}$", description="CD factor", units="" ), "inductive_current_fraction": VariableMetadata( diff --git a/process/physics.py b/process/physics.py index a80256daed..2c0eede581 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1782,7 +1782,7 @@ def physics(self): # Fraction of plasma current produced by inductive means physics_variables.inductive_current_fraction = max(1.0e-10, (1.0e0 - physics_variables.fvsbrnni)) # Fraction of plasma current produced by auxiliary current drive - physics_variables.faccd = ( + physics_variables.aux_current_fraction = ( physics_variables.fvsbrnni - current_drive_variables.plasma_current_internal_fraction ) diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index a27078edf2..612e4d7711 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -163,7 +163,7 @@ module physics_variables real(dp) :: eps !! inverse aspect ratio - real(dp) :: faccd + real(dp) :: aux_current_fraction !! fraction of plasma current produced by auxiliary current drive real(dp) :: inductive_current_fraction @@ -925,7 +925,7 @@ subroutine init_physics_variables dnz = 0.0D0 epbetmax = 1.38D0 eps = 0.34399724802D0 - faccd = 0.0D0 + aux_current_fraction = 0.0D0 inductive_current_fraction = 0.0D0 falpe = 0.0D0 falpha = 0.95D0 diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 9f7d773ddb..c1b4004def 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 67ef84149c..d7bbaad2fe 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 6c6f19de5d..b2752fb894 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index a69d797d12..ff0ec15fdb 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 5a2137c372..b7f16a306c 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -540,9 +540,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2290E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.3342E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.3342E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6376E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 279c0d54b9..229b279ed1 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -544,9 +544,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1061E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.0930E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.9070E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -1707,9 +1707,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1146E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9548E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0452E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -2870,9 +2870,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1238E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.5526E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.5526E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8606E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1394E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5559E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -4033,9 +4033,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1715E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8847E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1153E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -5196,9 +5196,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1531E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9218E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0782E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -6359,9 +6359,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1452E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9136E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0864E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -7522,9 +7522,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1915E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9320E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0680E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -8685,9 +8685,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2074E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9395E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0605E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -9848,9 +9848,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2337E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9780E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0220E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -11011,9 +11011,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2713E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9910E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0090E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -12174,9 +12174,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2391E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9399E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0601E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -13337,9 +13337,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2221E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9353E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0647E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -14500,9 +14500,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2611E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9505E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -15663,9 +15663,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2685E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9754E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0246E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 @@ -16826,9 +16826,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2763E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9990E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0010E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 2aab2376f0..ecae80f226 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -398,9 +398,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -1393,9 +1393,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -2388,9 +2388,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -3383,9 +3383,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -4378,9 +4378,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -5373,9 +5373,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -6368,9 +6368,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -7363,9 +7363,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 @@ -8358,9 +8358,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 5.1000E+01 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 8c66cc989d..0be73da8af 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1850,7 +1850,7 @@ "f_tf_steel": 0.0, "f_vforce_inboard": 0.5, "f_w": 0.5, - "faccd": 0.0, + "aux_current_fraction": 0.0, "fachtmw": 0.0, "inductive_current_fraction": 0.0, "factor": 0.1, @@ -9458,7 +9458,7 @@ "f_tf_steel": "Inboard coil steel fraction [-]", "f_vforce_inboard": "Fraction of the total vertical force taken by the TF inboard leg tension\n Not used for resistive `itart=1` (sliding joints)", "f_w": "island size fraction factor", - "faccd": "fraction of plasma current produced by auxiliary current drive", + "aux_current_fraction": "fraction of plasma current produced by auxiliary current drive", "fachtmw": "facility heat removal (MW)", "inductive_current_fraction": "fraction of plasma current produced inductively", "factor": "factor /0.1/ : used in HYBRD for first step size", @@ -19077,7 +19077,7 @@ "ealphadt", "epbetmax", "eps", - "faccd", + "aux_current_fraction", "inductive_current_fraction", "falpe", "falpha", diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 5a2137c372..b7f16a306c 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -540,9 +540,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2290E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (ps_current_fraction)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (faccd)_______________________ 1.3342E-02 + Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.3342E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6376E-01 - Total___________________________________________________________________ (plasipf+faccd+inductive_current_fraction)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (echpwr)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (pinjalw)_____________________ 2.0000E+02 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index fe5eeb38d1..fc7701537b 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -162,7 +162,7 @@ class CudrivParam(NamedTuple): ipedestal: Any = None - faccd: Any = None + aux_current_fraction: Any = None ignite: Any = None @@ -273,7 +273,7 @@ class CudrivParam(NamedTuple): tbeta=2, plascur=18398455.678867526, ipedestal=1, - faccd=0.12364081253383186, + aux_current_fraction=0.12364081253383186, ignite=0, pohmmw=0, powfmw=0, @@ -363,7 +363,7 @@ class CudrivParam(NamedTuple): tbeta=2, plascur=18398455.678867526, ipedestal=1, - faccd=0.12364081253383186, + aux_current_fraction=0.12364081253383186, ignite=0, pohmmw=0.76707314489379119, powfmw=1051.6562748933977, @@ -555,7 +555,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(physics_variables, "ipedestal", cudrivparam.ipedestal) - monkeypatch.setattr(physics_variables, "faccd", cudrivparam.faccd) + monkeypatch.setattr(physics_variables, "aux_current_fraction", cudrivparam.aux_current_fraction) monkeypatch.setattr(physics_variables, "ignite", cudrivparam.ignite) diff --git a/tracking/tracking_data.py b/tracking/tracking_data.py index 7c0053ed2b..ad2372f1ec 100644 --- a/tracking/tracking_data.py +++ b/tracking/tracking_data.py @@ -133,7 +133,7 @@ class ProcessTracker: "dene", "pradmw", "ne0", - "faccd", + "aux_current_fraction", "dnz", "taueff", "te0", From 4829df3dd0975298d8c76d5f214b49338ecf2808 Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 16:31:08 +0100 Subject: [PATCH 089/108] Refactor variable name faccdfix to aux_current_fraction_fix in current_drive.py --- process/current_drive.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 549f765793..4ad2bedf12 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -41,7 +41,7 @@ def cudriv(self, output: bool): pinjemwfix = 0.0 pinjimwfix = 0.0 auxiliary_cdfix = 0.0 - faccdfix = 0.0 + aux_current_fraction_fix = 0.0 gamcdfix = 0.0e0 # To stop issues with input file we force @@ -284,7 +284,7 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - faccdfix = auxiliary_cdfix / physics_variables.plascur + aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plascur elif current_drive_variables.iefrffix in [3, 7, 10, 12, 13]: # Injected power pinjemwfix = current_drive_variables.pinjfixmw @@ -306,7 +306,7 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - faccdfix = auxiliary_cdfix / physics_variables.plascur + aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plascur elif current_drive_variables.iefrffix in [5, 8]: # Account for first orbit losses # (power due to particles that are ionised but not thermalised) [MW]: @@ -353,7 +353,7 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - faccdfix = auxiliary_cdfix / physics_variables.plascur + aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plascur # Fenstermacher Lower Hybrid model if current_drive_variables.iefrf == 1: @@ -560,7 +560,7 @@ def cudriv(self, output: bool): # Injected power current_drive_variables.plhybd = ( 1.0e-6 - * (physics_variables.aux_current_fraction - faccdfix) + * (physics_variables.aux_current_fraction - aux_current_fraction_fix) * physics_variables.plascur / effrfss + current_drive_variables.pheat @@ -585,7 +585,7 @@ def cudriv(self, output: bool): # Injected power (set to close to close the Steady-state current equilibrium) current_drive_variables.echpwr = ( 1.0e-6 - * (physics_variables.aux_current_fraction - faccdfix) + * (physics_variables.aux_current_fraction - aux_current_fraction_fix) * physics_variables.plascur / effrfss + current_drive_variables.pheat @@ -604,7 +604,7 @@ def cudriv(self, output: bool): # MDK. See Gitlab issue #248, and scanned note. power1 = ( 1.0e-6 - * (physics_variables.aux_current_fraction - faccdfix) + * (physics_variables.aux_current_fraction - aux_current_fraction_fix) * physics_variables.plascur / effnbss + current_drive_variables.pheat From 95cd92553c9c76401c2d2f4ce47c2385db2c26d5 Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 16:48:57 +0100 Subject: [PATCH 090/108] Refactor variable name plascur to plasma_current in multiple files --- .../data/csv_output_large_tokamak_MFILE.DAT | 2 +- examples/data/large_tokamak_1_MFILE.DAT | 2 +- examples/data/large_tokamak_2_MFILE.DAT | 2 +- examples/data/large_tokamak_3_MFILE.DAT | 2 +- examples/data/large_tokamak_4_MFILE.DAT | 2 +- examples/data/scan_MFILE.DAT | 18 +-- process/current_drive.py | 14 +- process/io/mfile_comparison.py | 6 +- process/io/plot_proc.py | 2 +- process/io/plot_scans.py | 6 +- process/io/variable_metadata.py | 2 +- process/pfcoil.py | 18 +-- process/physics.py | 120 +++++++++--------- process/pulse.py | 4 +- process/stellarator.py | 6 +- process/structure.py | 2 +- source/fortran/constraint_equations.f90 | 8 +- source/fortran/physics_functions.f90 | 8 +- source/fortran/physics_variables.f90 | 6 +- source/fortran/scan.f90 | 4 +- .../data/large_tokamak_1_MFILE.DAT | 2 +- .../data/large_tokamak_2_MFILE.DAT | 2 +- .../data/large_tokamak_3_MFILE.DAT | 2 +- .../data/large_tokamak_4_MFILE.DAT | 2 +- .../integration/data/large_tokamak_MFILE.DAT | 2 +- tests/integration/data/scan_2D_MFILE.DAT | 30 ++--- tests/integration/data/scan_MFILE.DAT | 18 +-- tests/integration/ref_dicts.json | 8 +- tests/integration/test_pfcoil_int.py | 6 +- tests/unit/data/large_tokamak_MFILE.DAT | 2 +- tests/unit/test_current_drive.py | 8 +- tests/unit/test_physics.py | 92 +++++++------- tests/unit/test_pulse.py | 16 +-- 33 files changed, 212 insertions(+), 212 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index bfb9da0b57..415c158c49 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6699E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6699E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8387E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1898E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3601E-01 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 0032552099..3827e64511 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index f3db3e958d..3d5eef2b23 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index b8cd0d49b7..8ff8edbef6 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index 83cb998975..a8820c9c79 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index e64389eb2b..e6c62079a1 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -188,7 +188,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -1183,7 +1183,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -2178,7 +2178,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -3173,7 +3173,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -4168,7 +4168,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -5163,7 +5163,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -6158,7 +6158,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -7153,7 +7153,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -8148,7 +8148,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 diff --git a/process/current_drive.py b/process/current_drive.py index 4ad2bedf12..9663277058 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -284,7 +284,7 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plascur + aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plasma_current elif current_drive_variables.iefrffix in [3, 7, 10, 12, 13]: # Injected power pinjemwfix = current_drive_variables.pinjfixmw @@ -306,7 +306,7 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plascur + aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plasma_current elif current_drive_variables.iefrffix in [5, 8]: # Account for first orbit losses # (power due to particles that are ionised but not thermalised) [MW]: @@ -353,7 +353,7 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plascur + aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plasma_current # Fenstermacher Lower Hybrid model if current_drive_variables.iefrf == 1: @@ -553,7 +553,7 @@ def cudriv(self, output: bool): ) # Compute current drive wall plug and injected powers (MW) and efficiencies - auxiliary_cd = physics_variables.aux_current_fraction * physics_variables.plascur + auxiliary_cd = physics_variables.aux_current_fraction * physics_variables.plasma_current # LHCD or ICCD if current_drive_variables.iefrf in [1, 2, 4, 6]: @@ -561,7 +561,7 @@ def cudriv(self, output: bool): current_drive_variables.plhybd = ( 1.0e-6 * (physics_variables.aux_current_fraction - aux_current_fraction_fix) - * physics_variables.plascur + * physics_variables.plasma_current / effrfss + current_drive_variables.pheat ) @@ -586,7 +586,7 @@ def cudriv(self, output: bool): current_drive_variables.echpwr = ( 1.0e-6 * (physics_variables.aux_current_fraction - aux_current_fraction_fix) - * physics_variables.plascur + * physics_variables.plasma_current / effrfss + current_drive_variables.pheat ) @@ -605,7 +605,7 @@ def cudriv(self, output: bool): power1 = ( 1.0e-6 * (physics_variables.aux_current_fraction - aux_current_fraction_fix) - * physics_variables.plascur + * physics_variables.plasma_current / effnbss + current_drive_variables.pheat ) diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index c7f9da6875..a16d094b64 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -57,7 +57,7 @@ "blnkith", "blnkoth", "powfmw", - "plascur/1d6", + "plasma_current/1d6", "bt", "q95", "betap", @@ -110,7 +110,7 @@ "vol", "n_tf", "powfmw", - "plascur/1d6", + "plasma_current/1d6", "bt", "q95", "beta", @@ -216,7 +216,7 @@ "triang", "triang95", "powfmw", - "plascur/1d6", + "plasma_current/1d6", "bt", "q95", "beta", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 848111a1d9..491ecc74fb 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2393,7 +2393,7 @@ def plot_physics_info(axis, mfile_data, scan): data = [ ("powfmw", "Fusion power", "MW"), ("bigq", "$Q_{p}$", ""), - ("plascur/1d6", "$I_p$", "MA"), + ("plasma_current/1d6", "$I_p$", "MA"), ("bt", "Vacuum $B_T$ at $R_0$", "T"), ("q95", r"$q_{\mathrm{95}}$", ""), ("normalised_thermal_beta", r"$\beta_N$, thermal", "% m T MA$^{-1}$"), diff --git a/process/io/plot_scans.py b/process/io/plot_scans.py index 9b34a4daeb..3df2a3ef50 100644 --- a/process/io/plot_scans.py +++ b/process/io/plot_scans.py @@ -632,12 +632,12 @@ def main(args=None): plt.tight_layout() # Output file naming - if output_name == "plascur/1d6": + if output_name == "plasma_current/1d6": plt.savefig( - f"{args.outputdir}/scan_{scan_var_name}_vs_plascur" + f"{args.outputdir}/scan_{scan_var_name}_vs_plasma_current" + f"_vs_{output_name2}" if output_names2 != [] - else f"{args.outputdir}/scan_{scan_var_name}_vs_plascur" + else f"{args.outputdir}/scan_{scan_var_name}_vs_plasma_current" + f".{save_format}" ) elif output_name == "pdivtbt/qar": diff --git a/process/io/variable_metadata.py b/process/io/variable_metadata.py index 02c359c8fa..2a710f47cc 100644 --- a/process/io/variable_metadata.py +++ b/process/io/variable_metadata.py @@ -161,7 +161,7 @@ class VariableMetadata: "f_tf_steel": VariableMetadata( latex=r"f_\mathrm{steel}^\mathrm{TF}", description="TF steel fraction", units="" ), - "plascur/1d6": VariableMetadata( + "plasma_current/1d6": VariableMetadata( latex=r"$I_{\mathrm{p}}$[$MA$]", description="Plasma current", units="MA" ), "n_cycle": VariableMetadata( diff --git a/process/pfcoil.py b/process/pfcoil.py index ffc08c8ed8..c52299e1c7 100644 --- a/process/pfcoil.py +++ b/process/pfcoil.py @@ -296,11 +296,11 @@ def pfcoil(self): elif pfv.ipfloc[i] == 2: # PF coil is on top of the TF coil - pf.ccls[i] = 0.3e0 * pv.aspect**1.6e0 * pv.plascur + pf.ccls[i] = 0.3e0 * pv.aspect**1.6e0 * pv.plasma_current elif pfv.ipfloc[i] == 3: # PF coil is radially outside the TF coil - pf.ccls[i] = -0.4e0 * pv.plascur + pf.ccls[i] = -0.4e0 * pv.plasma_current else: eh.idiags[0] = i @@ -310,7 +310,7 @@ def pfcoil(self): # Vertical field (T) pv.bvert = ( -1.0e-7 - * pv.plascur + * pv.plasma_current / pv.rmajor * ( math.log(8.0e0 * pv.aspect) @@ -343,7 +343,7 @@ def pfcoil(self): # This is a fixed current for this calculation -- RK 07/12 pf.ccls[i] = ( - pv.plascur + pv.plasma_current * 2.0e0 * (1.0e0 - (pv.kappa * pv.rminor) / abs(pf.zcls[i, 0])) ) @@ -391,7 +391,7 @@ def pfcoil(self): bzin[0] = ( -1.0e-7 - * pv.plascur + * pv.plasma_current / pv.rmajor * ( math.log(8.0e0 * pv.aspect) @@ -767,9 +767,9 @@ def pfcoil(self): # Plasma wave form pfv.cpt[pfv.ncirt - 1, 0] = 0.0e0 pfv.cpt[pfv.ncirt - 1, 1] = 0.0e0 - pfv.cpt[pfv.ncirt - 1, 2] = pv.plascur - pfv.cpt[pfv.ncirt - 1, 3] = pv.plascur - pfv.cpt[pfv.ncirt - 1, 4] = pv.plascur + pfv.cpt[pfv.ncirt - 1, 2] = pv.plasma_current + pfv.cpt[pfv.ncirt - 1, 3] = pv.plasma_current + pfv.cpt[pfv.ncirt - 1, 4] = pv.plasma_current pfv.cpt[pfv.ncirt - 1, 5] = 0.0e0 def efc( @@ -1348,7 +1348,7 @@ def peakb(self, i, ii, it): kk = kk + 1 pf.rfxf[kk - 1] = pv.rmajor pf.zfxf[kk - 1] = 0.0e0 - pf.cfxf[kk - 1] = pv.plascur + pf.cfxf[kk - 1] = pv.plasma_current # Calculate the field at the inner and outer edges # of the coil of interest diff --git a/process/physics.py b/process/physics.py index 2c0eede581..2808ad2e1e 100644 --- a/process/physics.py +++ b/process/physics.py @@ -64,7 +64,7 @@ def vscalc( kappa, rmajor, rplas, - plascur, + plasma_current, t_fusion_ramp, tburn, rli, @@ -77,7 +77,7 @@ def vscalc( inductive_current_fraction : input real : fraction of plasma current produced inductively gamma : input real : Ejima coeff for resistive start-up V-s component kappa : input real : plasma elongation - plascur: input real : plasma current (A) + plasma_current: input real : plasma current (A) rli : input real : plasma normalised inductivity rmajor : input real : plasma major radius (m) rplas : input real : plasma resistance (ohm) @@ -95,12 +95,12 @@ def vscalc( # Internal inductance rlpint = rmu0 * rmajor * rli / 2.0 - phiint = rlpint * plascur + phiint = rlpint * plasma_current # Start-up resistive component # Uses ITER formula without the 10 V-s add-on - vsres = gamma * rmu0 * plascur * rmajor + vsres = gamma * rmu0 * plasma_current * rmajor # Hirshman, Neilson: Physics of Fluids, 29 (1986) p790 # fit for external inductance @@ -117,14 +117,14 @@ def vscalc( # Inductive V-s component - vsind = rlp * plascur + vsind = rlp * plasma_current vsstt = vsres + vsind # Loop voltage during flat-top # Include enhancement factor in flattop V-s requirement # to account for MHD sawtooth effects. - vburn = plascur * rplas * inductive_current_fraction * csawth + vburn = plasma_current * rplas * inductive_current_fraction * csawth # N.B. tburn on first iteration will not be correct # if the pulsed reactor option is used, but the value @@ -137,12 +137,12 @@ def vscalc( @nb.jit(nopython=True, cache=True) -def culblm(bt, dnbeta, plascur, rminor): +def culblm(bt, dnbeta, plasma_current, rminor): """Beta scaling limit author: P J Knight, CCFE, Culham Science Centre bt : input real : toroidal B-field on plasma axis (T) dnbeta : input real : Troyon-like g coefficient - plascur : input real : plasma current (A) + plasma_current : input real : plasma current (A) rminor : input real : plasma minor axis (m) betalim : output real : beta limit as defined below This subroutine calculates the beta limit, using @@ -159,7 +159,7 @@ def culblm(bt, dnbeta, plascur, rminor): AEA FUS 172: Physics Assessment for the European Reactor Study """ - return 0.01 * dnbeta * (plascur / 1.0e6) / (rminor * bt) + return 0.01 * dnbeta * (plasma_current / 1.0e6) / (rminor * bt) # ----------------------------------------------------- @@ -1497,7 +1497,7 @@ def physics(self): physics_variables.rli, physics_variables.bp, physics_variables.qstar, - physics_variables.plascur, + physics_variables.plasma_current, ) = self.calculate_plasma_current( physics_variables.alphaj, physics_variables.alphap, @@ -1527,7 +1527,7 @@ def physics(self): physics_variables.neped = ( physics_variables.fgwped * 1.0e14 - * physics_variables.plascur + * physics_variables.plasma_current / (np.pi * physics_variables.rminor * physics_variables.rminor) ) @@ -1535,7 +1535,7 @@ def physics(self): physics_variables.nesep = ( physics_variables.fgwsep * 1.0e14 - * physics_variables.plascur + * physics_variables.plasma_current / (np.pi * physics_variables.rminor * physics_variables.rminor) ) @@ -1550,7 +1550,7 @@ def physics(self): # Set PF coil ramp times if pulse_variables.lpulse != 1: if times_variables.tohsin == 0.0e0: - times_variables.tohs = physics_variables.plascur / 5.0e5 + times_variables.tohs = physics_variables.plasma_current / 5.0e5 times_variables.tramp = times_variables.tohs times_variables.tqnch = times_variables.tohs else: @@ -1559,7 +1559,7 @@ def physics(self): else: if times_variables.pulsetimings == 0.0e0: # times_variables.tramp is input - times_variables.tohs = physics_variables.plascur / 1.0e5 + times_variables.tohs = physics_variables.plasma_current / 1.0e5 times_variables.tqnch = times_variables.tohs else: @@ -1644,7 +1644,7 @@ def physics(self): physics_variables.aspect, physics_variables.beta, physics_variables.btot, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.q95, physics_variables.q0, physics_variables.rmajor, @@ -1666,7 +1666,7 @@ def physics(self): betat, physics_variables.bt, physics_variables.dene, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.q95, physics_variables.q0, physics_variables.rmajor, @@ -1940,7 +1940,7 @@ def physics(self): ) = self.pohm( physics_variables.inductive_current_fraction, physics_variables.kappa95, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.rmajor, physics_variables.rminor, physics_variables.ten, @@ -2012,7 +2012,7 @@ def physics(self): physics_variables.bt, physics_variables.idensl, physics_variables.pdivt, - physics_variables.plascur, + physics_variables.plasma_current, divertor_variables.prn1, physics_variables.qstar, physics_variables.q95, @@ -2049,7 +2049,7 @@ def physics(self): physics_variables.kappa95, physics_variables.pchargemw, current_drive_variables.pinjmw, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.pcoreradpv, physics_variables.rmajor, physics_variables.rminor, @@ -2084,7 +2084,7 @@ def physics(self): physics_variables.kappa, physics_variables.rmajor, physics_variables.rplas, - physics_variables.plascur, + physics_variables.plasma_current, times_variables.t_fusion_ramp, times_variables.tburn, physics_variables.rli, @@ -2107,7 +2107,7 @@ def physics(self): physics_variables.deni, physics_variables.fusionrate, physics_variables.alpharate, - physics_variables.plascur, + physics_variables.plasma_current, sbar, physics_variables.dnalp, physics_variables.taueff, @@ -2155,7 +2155,7 @@ def physics(self): physics_variables.betalim = culblm( physics_variables.bt, physics_variables.dnbeta, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.rminor, ) @@ -2315,7 +2315,7 @@ def physics(self): @staticmethod def culdlm( - bt, idensl, pdivt, plascur, prn1, qcyl, q95, rmajor, rminor, sarea, zeff + bt, idensl, pdivt, plasma_current, prn1, qcyl, q95, rmajor, rminor, sarea, zeff ): """Density limit calculation author: P J Knight, CCFE, Culham Science Centre @@ -2323,7 +2323,7 @@ def culdlm( idensl : input/output integer : switch denoting which formula to enforce pdivt : input real : power flowing to the edge plasma via charged particles (MW) - plascur : input real : plasma current (A) + plasma_current : input real : plasma current (A) prn1 : input real : edge density / average plasma density qcyl : input real : equivalent cylindrical safety factor (qstar) q95 : input real : safety factor at 95% surface @@ -2406,7 +2406,7 @@ def culdlm( # Greenwald limit - dlimit[6] = 1.0e14 * plascur / (np.pi * rminor * rminor) + dlimit[6] = 1.0e14 * plasma_current / (np.pi * rminor * rminor) # Enforce the chosen density limit @@ -2628,7 +2628,7 @@ def phyaux( deni, fusionrate, alpharate, - plascur, + plasma_current, sbar, dnalp, taueff, @@ -2642,7 +2642,7 @@ def phyaux( dnalp : input real : alpha ash density (/m3) fusionrate : input real : fusion reaction rate (/m3/s) alpharate : input real : alpha particle production rate (/m3/s) - plascur: input real : plasma current (A) + plasma_current: input real : plasma current (A) sbar : input real : exponent for aspect ratio (normally 1) taueff : input real : global energy confinement time (s) vol : input real : plasma volume (m3) @@ -2657,7 +2657,7 @@ def phyaux( needed by other parts of the code """ - figmer = 1e-6 * plascur * aspect**sbar + figmer = 1e-6 * plasma_current * aspect**sbar dntau = taueff * dene @@ -2700,7 +2700,7 @@ def phyaux( return burnup, dntau, figmer, fusrat, qfuel, rndfuel, taup @staticmethod - def pohm(inductive_current_fraction, kappa95, plascur, rmajor, rminor, ten, vol, zeff): + def pohm(inductive_current_fraction, kappa95, plasma_current, rmajor, rminor, ten, vol, zeff): # Density weighted electron temperature in 10 keV units t10 = ten / 10.0 @@ -2731,9 +2731,9 @@ def pohm(inductive_current_fraction, kappa95, plascur, rmajor, rminor, ten, vol, error_handling.report_error(83) # Ohmic heating power per unit volume - # Corrected from: pohmpv = (inductive_current_fraction*plascur)**2 * ... + # Corrected from: pohmpv = (inductive_current_fraction*plasma_current)**2 * ... - pohmpv = inductive_current_fraction * plascur**2 * rplas * 1.0e-6 / vol + pohmpv = inductive_current_fraction * plasma_current**2 * rplas * 1.0e-6 / vol # Total ohmic heating power @@ -2800,7 +2800,7 @@ def calculate_plasma_current( triang95 (float): Plasma triangularity at 95% surface. Returns: - Tuple[float, float, float, float, float]: Tuple containing bp, qstar, plascur, alphaj, rli. + Tuple[float, float, float, float, float]: Tuple containing bp, qstar, plasma_current, alphaj, rli. Raises: ValueError: If invalid value for i_plasma_current is provided. @@ -2838,7 +2838,7 @@ def calculate_plasma_current( # Peng scaling for double null divertor; TARTs [STAR Code] elif i_plasma_current == 2: - plascur = 1.0e6 * calculate_plasma_current_peng( + plasma_current = 1.0e6 * calculate_plasma_current_peng( q95, aspect_ratio, eps, rminor, bt, kappa, triang ) @@ -2880,7 +2880,7 @@ def calculate_plasma_current( # Main plasma current calculation using the fq value from the different settings if i_plasma_current != 2: - plascur = ( + plasma_current = ( (constants.twopi / constants.rmu0) * rminor**2 / (rmajor * q95) @@ -2893,19 +2893,19 @@ def calculate_plasma_current( qstar = ( 5.0e6 * rminor**2 - / (rmajor * plascur / bt) + / (rmajor * plasma_current / bt) * 0.5 * (1.0 + kappa**2 * (1.0 + 2.0 * triang**2 - 1.2 * triang**3)) ) physics_variables.normalised_total_beta = ( - 1.0e8 * physics_variables.beta * rminor * bt / plascur + 1.0e8 * physics_variables.beta * rminor * bt / plasma_current ) # Calculate the poloidal field generated by the plasma current bp = calculate_poloidal_field( i_plasma_current, - plascur, + plasma_current, q95, aspect_ratio, eps, @@ -2929,7 +2929,7 @@ def calculate_plasma_current( # Menard et al. (2016), Nuclear Fusion, 56, 106023 rli = 3.4 - kappa - return alphaj, rli, bp, qstar, plascur + return alphaj, rli, bp, qstar, plasma_current def outtim(self): po.oheadr(self.outfile, "Times") @@ -2996,7 +2996,7 @@ def outplas(self): * physics_variables.kappa / ( physics_module.total_plasma_internal_energy**2 - * physics_variables.plascur + * physics_variables.plasma_current ) ) @@ -3256,8 +3256,8 @@ def outplas(self): po.ovarrf( self.outfile, "Plasma current (MA)", - "(plascur/1D6)", - physics_variables.plascur / 1.0e6, + "(plasma_current/1D6)", + physics_variables.plasma_current / 1.0e6, "OP ", ) @@ -3448,7 +3448,7 @@ def outplas(self): * betath * physics_variables.rminor * physics_variables.bt - / physics_variables.plascur, + / physics_variables.plasma_current, "OP ", ) @@ -4935,7 +4935,7 @@ def outplas(self): self.outfile, "Loop voltage during burn (V)", "(vburn)", - physics_variables.plascur + physics_variables.plasma_current * physics_variables.rplas * physics_variables.inductive_current_fraction, "OP ", @@ -5066,7 +5066,7 @@ def igmarcal(self): physics_variables.kappa95, physics_variables.pchargemw, current_drive_variables.pinjmw, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.pcoreradpv, physics_variables.rmajor, physics_variables.rminor, @@ -5093,7 +5093,7 @@ def bootstrap_fraction_iter89( aspect: float, beta: float, bt: float, - plascur: float, + plasma_current: float, q95: float, q0: float, rmajor: float, @@ -5106,7 +5106,7 @@ def bootstrap_fraction_iter89( aspect (float): Plasma aspect ratio. beta (float): Plasma total beta. bt (float): Toroidal field on axis (T). - plascur (float): Plasma current (A). + plasma_current (float): Plasma current (A). q95 (float): Safety factor at 95% surface. q0 (float): Central safety factor. rmajor (float): Plasma major radius (m). @@ -5124,7 +5124,7 @@ def bootstrap_fraction_iter89( cbs = 1.32 - 0.235 * xbs + 0.0185 * xbs**2 bpbs = ( constants.rmu0 - * plascur + * plasma_current / (2 * np.pi * np.sqrt(vol / (2 * np.pi**2 * rmajor))) ) betapbs = beta * bt**2 / bpbs**2 @@ -5247,7 +5247,7 @@ def bootstrap_fraction_nevins( betat: float, bt: float, dene: float, - plascur: float, + plasma_current: float, q95: float, q0: float, rmajor: float, @@ -5264,7 +5264,7 @@ def bootstrap_fraction_nevins( betat (float): Toroidal plasma beta. bt (float): Toroidal field on axis (T). dene (float): Electron density (/m3). - plascur (float): Plasma current (A). + plasma_current (float): Plasma current (A). q0 (float): Central safety factor. q95 (float): Safety factor at 95% surface. rmajor (float): Plasma major radius (m). @@ -5324,7 +5324,7 @@ def bootstrap_fraction_nevins( # Calculate bootstrap current and fraction aibs = 2.5 * betae0 * rmajor * bt * q95 * ainteg - return 1.0e6 * aibs / plascur + return 1.0e6 * aibs / plasma_current @staticmethod def bootstrap_fraction_sauter(plasma_profile: float) -> float: @@ -5480,7 +5480,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: ) ) # A/m2 - return np.sum(da * jboot, axis=0) / physics_variables.plascur + return np.sum(da * jboot, axis=0) / physics_variables.plasma_current @staticmethod def bootstrap_fraction_sakai( @@ -5578,7 +5578,7 @@ def fhz(self, hhh): physics_variables.kappa95, physics_variables.pchargemw, current_drive_variables.pinjmw, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.pcoreradpv, physics_variables.rmajor, physics_variables.rminor, @@ -5635,7 +5635,7 @@ def pcond( kappa95, pchargemw, pinjmw, - plascur, + plasma_current, pcoreradpv, rmajor, rminor, @@ -5668,7 +5668,7 @@ def pcond( kappaa : output real : plasma elongation calculated using area ratio pchargemw : input real : non-alpha charged particle fusion power (MW) pinjmw : input real : auxiliary power to ions and electrons (MW) - plascur : input real : plasma current (A) + plasma_current : input real : plasma current (A) pcoreradpv: input real : total core radiation power (MW/m3) q : input real : edge safety factor (tokamaks), or rotational transform iotabar (stellarators) @@ -5749,7 +5749,7 @@ def pcond( n20 = dene / 1.0e20 # Plasma current in MA - pcur = plascur / 1.0e6 + pcur = plasma_current / 1.0e6 # Separatrix kappa defined with X-section for general use kappaa = xarea / (np.pi * rminor * rminor) @@ -6383,12 +6383,12 @@ def pcond( # q should be q95: incorrect if i_plasma_current = 2 (ST current scaling) qratio = q / qstar # Greenwald density in m^-3 - nGW = 1.0e14 * plascur / (np.pi * rminor * rminor) + nGW = 1.0e14 * plasma_current / (np.pi * rminor * rminor) nratio = dnla / nGW tauee = ( hfact * 6.94e-7 - * plascur**1.3678e0 + * plasma_current**1.3678e0 * bt**0.12e0 * dnla**0.032236e0 * (powerht * 1.0e6) ** (-0.74e0) @@ -6405,7 +6405,7 @@ def pcond( tauee = ( hfact * 0.014e0 - * (plascur / 1.0e6) ** 0.68e0 + * (plasma_current / 1.0e6) ** 0.68e0 * bt**0.77e0 * dnla20**0.02e0 * powerht ** (-0.29e0) @@ -6415,7 +6415,7 @@ def pcond( tauee = ( hfact * 0.014e0 - * (plascur / 1.0e6) ** 0.60e0 + * (plasma_current / 1.0e6) ** 0.60e0 * bt**0.70e0 * dnla20 ** (-0.03e0) * powerht ** (-0.33e0) @@ -6425,7 +6425,7 @@ def pcond( tauee = ( hfact * 0.014e0 - * (plascur / 1.0e6) ** 0.76e0 + * (plasma_current / 1.0e6) ** 0.76e0 * bt**0.84e0 * dnla20**0.07 * powerht ** (-0.25e0) diff --git a/process/pulse.py b/process/pulse.py index 229712880b..6727c007ac 100755 --- a/process/pulse.py +++ b/process/pulse.py @@ -92,7 +92,7 @@ def tohswg(self, output: bool) -> None: # Maximum rate of change of plasma current (A/s) # - now a function of the plasma current itself (previously just 0.5e6) - ipdot = 0.0455e0 * physics_variables.plascur + ipdot = 0.0455e0 * physics_variables.plasma_current # Minimum plasma current ramp-up time (s) # - corrected (bus resistance is not a function of pfcoil_variables.turns) @@ -149,7 +149,7 @@ def burn(self, output: bool): # Loop voltage during flat-top (including MHD sawtooth enhancement) vburn = ( - physics_variables.plascur + physics_variables.plasma_current * physics_variables.rplas * physics_variables.inductive_current_fraction * physics_variables.csawth diff --git a/process/stellarator.py b/process/stellarator.py index 494f0bef77..62ff4a483b 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -221,7 +221,7 @@ def stigma(self): physics_variables.kappa95, physics_variables.pchargemw, current_drive_variables.pinjmw, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.pcoreradpv, physics_variables.rmajor, physics_variables.rminor, @@ -4203,7 +4203,7 @@ def stphys(self, output): physics_variables.kappa95, physics_variables.pchargemw, current_drive_variables.pinjmw, - physics_variables.plascur, + physics_variables.plasma_current, physics_variables.pcoreradpv, physics_variables.rmajor, physics_variables.rminor, @@ -4242,7 +4242,7 @@ def stphys(self, output): physics_variables.deni, physics_variables.fusionrate, physics_variables.alpharate, - physics_variables.plascur, + physics_variables.plasma_current, sbar, physics_variables.dnalp, physics_variables.taueff, diff --git a/process/structure.py b/process/structure.py index f4cac89f40..f8fc547a9f 100644 --- a/process/structure.py +++ b/process/structure.py @@ -47,7 +47,7 @@ def run(self, output: bool = False) -> None: stv.coldmass, stv.gsmass, ) = self.structure( - pv.plascur, + pv.plasma_current, pv.rmajor, pv.rminor, pv.kappa, diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index e881309fa1..d85a8f3c45 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -2022,11 +2022,11 @@ subroutine constraint_eqn_046(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! eps : input real : inverse aspect ratio !! fipir : input real : f-value for Ip/Irod upper limit !! ritfc : input real : total (summed) current in TF coils (A) - !! plascur : input real : plasma current (A) + !! plasma_current : input real : plasma current (A) !! itart : input integer : switch for spherical tokamak (ST) models:
      !!
    • = 0 use conventional aspect ratio models; !!
    • = 1 use spherical tokamak models
    - use physics_variables, only: eps, plascur, itart + use physics_variables, only: eps, plasma_current, itart use constraint_variables, only: fipir use tfcoil_variables, only: ritfc implicit none @@ -2041,9 +2041,9 @@ subroutine constraint_eqn_046(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! if the machine isn't a ST then report error if (itart == 0) call report_error(10) cratmx = 1.0D0 + 4.91D0*(eps-0.62D0) - tmp_cc = 1.0D0 - fipir * cratmx * ritfc/plascur + tmp_cc = 1.0D0 - fipir * cratmx * ritfc/plasma_current tmp_con = cratmx * (1.0D0 - tmp_cc) - tmp_err = plascur/ritfc * tmp_cc + tmp_err = plasma_current/ritfc * tmp_cc tmp_symbol = '<' tmp_units = '' diff --git a/source/fortran/physics_functions.f90 b/source/fortran/physics_functions.f90 index d940671ae9..f0b498e693 100644 --- a/source/fortran/physics_functions.f90 +++ b/source/fortran/physics_functions.f90 @@ -53,7 +53,7 @@ subroutine pthresh(dene,dnla,bt,rmajor,kappa,sarea,aion,aspect,pthrmw) !! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use physics_variables, only: rminor, plascur + use physics_variables, only: rminor, plasma_current implicit none ! Arguments @@ -132,13 +132,13 @@ subroutine pthresh(dene,dnla,bt,rmajor,kappa,sarea,aion,aspect,pthrmw) ! Hubbard et al. 2012 L-I threshold scaling ! Nominal - pthrmw(15) = 2.11 * (plascur/1.0D6)**0.94 * dnla20**0.65 + pthrmw(15) = 2.11 * (plasma_current/1.0D6)**0.94 * dnla20**0.65 ! Lower bound - pthrmw(16) = 2.11 * (plascur/1.0D6)**0.70 * dnla20**0.47 + pthrmw(16) = 2.11 * (plasma_current/1.0D6)**0.70 * dnla20**0.47 ! Upper bound - pthrmw(17) = 2.11 * (plascur/1.0D6)**1.18 * dnla20**0.83 + pthrmw(17) = 2.11 * (plasma_current/1.0D6)**1.18 * dnla20**0.83 ! Hubbard et al. 2017 L-I threshold scaling pthrmw(18) = 0.162 * dnla20 * sarea * (bt)**0.26 diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 612e4d7711..fdc06965da 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -203,7 +203,7 @@ module physics_variables !! helium-3 fuel fraction real(dp) :: figmer - !! physics figure of merit (= plascur*aspect**sbar, where `sbar=1`) + !! physics figure of merit (= plasma_current*aspect**sbar, where `sbar=1`) real(dp) :: fkzohm !! Zohm elongation scaling adjustment factor (`ishape=2, 3`) @@ -622,7 +622,7 @@ module physics_variables real(dp) :: piepv !! ion/electron equilibration power per volume (MW/m3) - real(dp) :: plascur + real(dp) :: plasma_current !! plasma current (A) real(dp) :: pneutmw @@ -1010,7 +1010,7 @@ subroutine init_physics_variables phiint = 0.0D0 photon_wall = 0.0D0 piepv = 0.0D0 - plascur = 0.0D0 + plasma_current = 0.0D0 pneutmw = 0.0D0 pneutpv = 0.0D0 pohmmw = 0.0D0 diff --git a/source/fortran/scan.f90 b/source/fortran/scan.f90 index ada8b132ab..4e82bd8748 100644 --- a/source/fortran/scan.f90 +++ b/source/fortran/scan.f90 @@ -197,7 +197,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) use fwbs_variables, only: tpeak use physics_variables, only: q, aspect, pradmw, dene, powfmw, btot, tesep, & pdivt, ralpne, ten, betap, hfac, teped, palpnb, qlim, rmajor, wallmw, & - beta, betalim, bt, plascur + beta, betalim, bt, plasma_current use global_variables, only: verbose, maxcal, runtitle, run_tests use constants, only: nout implicit none @@ -223,7 +223,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) outvar( 9,iscan) = cdirt / 1.0D3 outvar(10,iscan) = rmajor outvar(11,iscan) = aspect - outvar(12,iscan) = 1.0D-6 * plascur + outvar(12,iscan) = 1.0D-6 * plasma_current outvar(13,iscan) = bt outvar(14,iscan) = btot outvar(15,iscan) = q diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index c1b4004def..65d2a4153c 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index d7bbaad2fe..efbc6e4b93 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index b2752fb894..c18aebc479 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index ff0ec15fdb..4c08eb7a0f 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index b7f16a306c..431beec114 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -329,7 +329,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6521E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6521E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 2.0295E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2402E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4379E-01 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 229b279ed1..cae6878cfd 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -334,7 +334,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6569E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6569E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9385E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2165E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3401E-01 @@ -1497,7 +1497,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6633E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6633E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8709E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1985E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3404E-01 @@ -2660,7 +2660,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6683E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6683E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8062E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1810E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3354E-01 @@ -3823,7 +3823,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6609E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6609E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8186E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1844E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3410E-01 @@ -4986,7 +4986,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6604E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6604E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8760E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1999E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3571E-01 @@ -6149,7 +6149,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6548E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6548E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9423E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2175E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3617E-01 @@ -7312,7 +7312,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6479E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6479E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9545E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2207E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3684E-01 @@ -8475,7 +8475,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6497E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6497E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8947E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2048E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3564E-01 @@ -9638,7 +9638,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6468E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6468E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8429E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1909E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3335E-01 @@ -10801,7 +10801,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6447E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6447E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8466E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1919E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3508E-01 @@ -11964,7 +11964,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6498E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6498E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8944E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2048E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3786E-01 @@ -13127,7 +13127,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6485E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6485E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9535E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2204E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3919E-01 @@ -14290,7 +14290,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6455E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6455E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9590E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2219E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4071E-01 @@ -15453,7 +15453,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6516E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6516E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8912E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2039E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4046E-01 @@ -16616,7 +16616,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6581E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6581E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8235E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1857E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4025E-01 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index ecae80f226..24f9e5bb6a 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -188,7 +188,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -1183,7 +1183,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -2178,7 +2178,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -3173,7 +3173,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -4168,7 +4168,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -5163,7 +5163,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -6158,7 +6158,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -7153,7 +7153,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -8148,7 +8148,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 0be73da8af..084aa9c269 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -3533,7 +3533,7 @@ "pinjwpfix": 0.0, "pinnerzoneradmw": 0.0, "pitch": 0.02, - "plascur": 0.0, + "plasma_current": 0.0, "plasipf": 0.0, "plasma_res_factor": 1.0, "plhthresh": 0.0, @@ -9538,7 +9538,7 @@ "fhout": "fraction of power to outboard divertor (for single null)", "fhts": "technology adjustment factor for critical current density fit for isumat..=2\n Bi-2212 superconductor, to describe the level of technology assumed (i.e. to\n account for stress, fatigue, radiation, AC losses, joints or manufacturing\n variations; 1.0 would be very optimistic)", "fififi": "coefficient for gamdiv", - "figmer": "physics figure of merit (= plascuraspect*sbar, where `sbar=1`)", + "figmer": "physics figure of merit (= plasma_currentaspect*sbar, where `sbar=1`)", "fileprefix": "input file prefix", "fimp": "", "fio": "", @@ -10282,7 +10282,7 @@ "pinjwpfix": "secondary injector wall plug power (MW)", "pinnerzoneradmw": "radiation power from inner zone (MW)", "pitch": "pitch of first wall cooling channels (m)", - "plascur": "plasma current (A)", + "plasma_current": "plasma current (A)", "plasipf": "plasma driven current fraction (Bootstrap + Diamagnetic + PS)", "plasma_res_factor": "plasma resistivity pre-factor", "plhthresh": "L-H mode power threshold (MW) (chosen via ilhthresh, and enforced if\n constraint equation 15 is on)", @@ -19168,7 +19168,7 @@ "phiint", "photon_wall", "piepv", - "plascur", + "plasma_current", "plinepv", "pneutmw", "pneutpv", diff --git a/tests/integration/test_pfcoil_int.py b/tests/integration/test_pfcoil_int.py index 4cbe1e612e..a9bb842a92 100644 --- a/tests/integration/test_pfcoil_int.py +++ b/tests/integration/test_pfcoil_int.py @@ -120,7 +120,7 @@ def test_pfcoil(monkeypatch, pfcoil): monkeypatch.setattr(pv, "rli", 1.693) monkeypatch.setattr(pv, "itartpf", 0) monkeypatch.setattr(pv, "vsres", 6.151e1) - monkeypatch.setattr(pv, "plascur", 1.8254e7) + monkeypatch.setattr(pv, "plasma_current", 1.8254e7) monkeypatch.setattr(pv, "triang", 0.413) monkeypatch.setattr(pv, "rminor", 2.883) monkeypatch.setattr(pv, "rmajor", 8.938) @@ -253,7 +253,7 @@ def test_ohcalc(monkeypatch, reinitialise_error_module, pfcoil): monkeypatch.setattr(pfv, "curpff", np.full(22, 0.0)) monkeypatch.setattr(pfv, "curpfs", np.full(22, -175.84911993600002)) monkeypatch.setattr(pv, "rmajor", 8.938) - monkeypatch.setattr(pv, "plascur", 1.8254e7) + monkeypatch.setattr(pv, "plasma_current", 1.8254e7) # Mocks for hoop_stress() monkeypatch.setattr(tfv, "poisson_steel", 3.0e-1) @@ -2609,7 +2609,7 @@ def test_peakb(monkeypatch: pytest.MonkeyPatch, pfcoil: PFCoil): ), ) monkeypatch.setattr(pv, "rmajor", 8.8901000000000003) - monkeypatch.setattr(pv, "plascur", 17721306.969367817) + monkeypatch.setattr(pv, "plasma_current", 17721306.969367817) i = 1 ii = 1 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index b7f16a306c..431beec114 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -329,7 +329,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plascur/1D6)_________________ 1.6521E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6521E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 2.0295E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2402E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4379E-01 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index fc7701537b..3114984853 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -158,7 +158,7 @@ class CudrivParam(NamedTuple): tbeta: Any = None - plascur: Any = None + plasma_current: Any = None ipedestal: Any = None @@ -271,7 +271,7 @@ class CudrivParam(NamedTuple): bt=5.7000000000000002, rminor=2.6666666666666665, tbeta=2, - plascur=18398455.678867526, + plasma_current=18398455.678867526, ipedestal=1, aux_current_fraction=0.12364081253383186, ignite=0, @@ -361,7 +361,7 @@ class CudrivParam(NamedTuple): bt=5.7000000000000002, rminor=2.6666666666666665, tbeta=2, - plascur=18398455.678867526, + plasma_current=18398455.678867526, ipedestal=1, aux_current_fraction=0.12364081253383186, ignite=0, @@ -551,7 +551,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(physics_variables, "tbeta", cudrivparam.tbeta) - monkeypatch.setattr(physics_variables, "plascur", cudrivparam.plascur) + monkeypatch.setattr(physics_variables, "plasma_current", cudrivparam.plasma_current) monkeypatch.setattr(physics_variables, "ipedestal", cudrivparam.ipedestal) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index b368820f48..ed58be79ff 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -67,7 +67,7 @@ class BootstrapFractionIter89Param(NamedTuple): bt: Any = None - plascur: Any = None + plasma_current: Any = None q95: Any = None @@ -87,7 +87,7 @@ class BootstrapFractionIter89Param(NamedTuple): aspect=3, beta=0.030000000000000006, bt=5.7802910787445487, - plascur=18398455.678867526, + plasma_current=18398455.678867526, q95=3.5, q0=1, rmajor=8, @@ -113,7 +113,7 @@ def test_bootstrap_fraction_iter89(bootstrapfractioniter89param, physics): aspect=bootstrapfractioniter89param.aspect, beta=bootstrapfractioniter89param.beta, bt=bootstrapfractioniter89param.bt, - plascur=bootstrapfractioniter89param.plascur, + plasma_current=bootstrapfractioniter89param.plasma_current, q95=bootstrapfractioniter89param.q95, q0=bootstrapfractioniter89param.q0, rmajor=bootstrapfractioniter89param.rmajor, @@ -138,7 +138,7 @@ class BootstrapFractionNevinsParam(NamedTuple): dene: Any = None - plascur: Any = None + plasma_current: Any = None q0: Any = None @@ -167,7 +167,7 @@ class BootstrapFractionNevinsParam(NamedTuple): betat=0.03, bt=5.7, dene=18398455.678867526, - plascur=18398455.678867526, + plasma_current=18398455.678867526, q0=1, q95=3.5, alphat=1.45, @@ -202,7 +202,7 @@ def test_bootstrap_fraction_nevins(bootstrapfractionnevinsparam, monkeypatch, ph betat=bootstrapfractionnevinsparam.betat, bt=bootstrapfractionnevinsparam.bt, dene=bootstrapfractionnevinsparam.dene, - plascur=bootstrapfractionnevinsparam.plascur, + plasma_current=bootstrapfractionnevinsparam.plasma_current, q0=bootstrapfractionnevinsparam.q0, q95=bootstrapfractionnevinsparam.q95, rmajor=bootstrapfractionnevinsparam.rmajor, @@ -309,7 +309,7 @@ class BootstrapFractionSauterParam(NamedTuple): bt: Any = None - plascur: Any = None + plasma_current: Any = None xarea: Any = None @@ -358,7 +358,7 @@ class BootstrapFractionSauterParam(NamedTuple): zeff=2.5211399464385624, rhopedn=0.9400000000000001, bt=5.326133750416047, - plascur=16528278.760008096, + plasma_current=16528278.760008096, xarea=38.39822223637151, fhe3=0, teped=5.5, @@ -420,7 +420,7 @@ def test_bootstrap_fraction_sauter(bootstrapfractionsauterparam, monkeypatch, ph monkeypatch.setattr(physics_variables, "bt", bootstrapfractionsauterparam.bt) monkeypatch.setattr( - physics_variables, "plascur", bootstrapfractionsauterparam.plascur + physics_variables, "plasma_current", bootstrapfractionsauterparam.plasma_current ) monkeypatch.setattr(physics_variables, "xarea", bootstrapfractionsauterparam.xarea) @@ -601,7 +601,7 @@ class PlasmaCurrentParam(NamedTuple): expected_qstar: Any = None - expected_plascur: Any = None + expected_plasma_current: Any = None @pytest.mark.parametrize( @@ -633,7 +633,7 @@ class PlasmaCurrentParam(NamedTuple): expected_rli=1.2064840230894305, expected_bp=0.96008591022564971, expected_qstar=3.869423496255382, - expected_plascur=18398455.678867526, + expected_plasma_current=18398455.678867526, ), PlasmaCurrentParam( normalised_total_beta=2.4784688886891844, @@ -661,7 +661,7 @@ class PlasmaCurrentParam(NamedTuple): expected_rli=1.2064840230894305, expected_bp=0.96008591022564971, expected_qstar=3.869423496255382, - expected_plascur=18398455.678867526, + expected_plasma_current=18398455.678867526, ), ), ) @@ -686,7 +686,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): monkeypatch.setattr(physics_variables, "beta", plasmacurrentparam.beta) - _, _, bp, qstar, plascur = physics.calculate_plasma_current( + _, _, bp, qstar, plasma_current = physics.calculate_plasma_current( i_plasma_current=plasmacurrentparam.i_plasma_current, iprofile=plasmacurrentparam.iprofile, alphaj=plasmacurrentparam.alphaj, @@ -715,7 +715,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): assert qstar == pytest.approx(plasmacurrentparam.expected_qstar) - assert plascur == pytest.approx(plasmacurrentparam.expected_plascur) + assert plasma_current == pytest.approx(plasmacurrentparam.expected_plasma_current) @pytest.mark.parametrize( @@ -1384,7 +1384,7 @@ class VscalcParam(NamedTuple): kappa: Any = None - plascur: Any = None + plasma_current: Any = None rli: Any = None @@ -1418,7 +1418,7 @@ class VscalcParam(NamedTuple): inductive_current_fraction=0.59999999999999998, gamma=0.30000000000000004, kappa=1.8500000000000001, - plascur=18398455.678867526, + plasma_current=18398455.678867526, rli=1.2064840230894305, rmajor=8, rplas=3.7767895536275952e-09, @@ -1437,7 +1437,7 @@ class VscalcParam(NamedTuple): inductive_current_fraction=0.59999999999999998, gamma=0.30000000000000004, kappa=1.8500000000000001, - plascur=18398455.678867526, + plasma_current=18398455.678867526, rli=1.2064840230894305, rmajor=8, rplas=3.7767895536275952e-09, @@ -1468,7 +1468,7 @@ def test_vscalc(vscalcparam): inductive_current_fraction=vscalcparam.inductive_current_fraction, gamma=vscalcparam.gamma, kappa=vscalcparam.kappa, - plascur=vscalcparam.plascur, + plasma_current=vscalcparam.plasma_current, rli=vscalcparam.rli, rmajor=vscalcparam.rmajor, rplas=vscalcparam.rplas, @@ -1507,7 +1507,7 @@ class PhyauxParam(NamedTuple): alpharate: Any = None - plascur: Any = None + plasma_current: Any = None sbar: Any = None @@ -1542,7 +1542,7 @@ class PhyauxParam(NamedTuple): dnalp=7.5e18, fusionrate=1.9852091609123786e17, alpharate=1.973996644759543e17, - plascur=18398455.678867526, + plasma_current=18398455.678867526, sbar=1, taueff=3.401323521525641, vol=1888.1711539956691, @@ -1563,7 +1563,7 @@ class PhyauxParam(NamedTuple): dnalp=7.5e18, fusionrate=1.9843269653375773e17, alpharate=1.9731194318497056e17, - plascur=18398455.678867526, + plasma_current=18398455.678867526, sbar=1, taueff=3.402116961408892, vol=1888.1711539956691, @@ -1601,7 +1601,7 @@ def test_phyaux(phyauxparam, monkeypatch, physics): dnalp=phyauxparam.dnalp, fusionrate=phyauxparam.fusionrate, alpharate=phyauxparam.alpharate, - plascur=phyauxparam.plascur, + plasma_current=phyauxparam.plasma_current, sbar=phyauxparam.sbar, taueff=phyauxparam.taueff, vol=phyauxparam.vol, @@ -1637,7 +1637,7 @@ class PohmParam(NamedTuple): kappa95: Any = None - plascur: Any = None + plasma_current: Any = None rmajor: Any = None @@ -1666,7 +1666,7 @@ class PohmParam(NamedTuple): plasma_res_factor=0.70000000000000007, inductive_current_fraction=0.59999999999999998, kappa95=1.6517857142857142, - plascur=18398455.678867526, + plasma_current=18398455.678867526, rmajor=8, rminor=2.6666666666666665, ten=12.626131115905864, @@ -1701,7 +1701,7 @@ def test_pohm(pohmparam, monkeypatch, physics): pohmpv, pohmmw, rpfac, rplas = physics.pohm( inductive_current_fraction=pohmparam.inductive_current_fraction, kappa95=pohmparam.kappa95, - plascur=pohmparam.plascur, + plasma_current=pohmparam.plasma_current, rmajor=pohmparam.rmajor, rminor=pohmparam.rminor, ten=pohmparam.ten, @@ -1725,7 +1725,7 @@ class CuldlmParam(NamedTuple): pdivt: Any = None - plascur: Any = None + plasma_current: Any = None prn1: Any = None @@ -1753,7 +1753,7 @@ class CuldlmParam(NamedTuple): idensl=7, bt=5.7000000000000002, pdivt=169.86588182297265, - plascur=18398455.678867526, + plasma_current=18398455.678867526, prn1=0.54903846872792261, q95=3.5, qcyl=2.9008029008029004, @@ -1791,7 +1791,7 @@ def test_culdlm(culdlmparam, physics): idensl=culdlmparam.idensl, bt=culdlmparam.bt, pdivt=culdlmparam.pdivt, - plascur=culdlmparam.plascur, + plasma_current=culdlmparam.plasma_current, prn1=culdlmparam.prn1, q95=culdlmparam.q95, qcyl=culdlmparam.qcyl, @@ -1851,7 +1851,7 @@ class PcondParam(NamedTuple): pinjmw: Any = None - plascur: Any = None + plasma_current: Any = None pcoreradpv: Any = None @@ -1918,7 +1918,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -1962,7 +1962,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2006,7 +2006,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2050,7 +2050,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2094,7 +2094,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2138,7 +2138,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2182,7 +2182,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2226,7 +2226,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2270,7 +2270,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2314,7 +2314,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2358,7 +2358,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2402,7 +2402,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2446,7 +2446,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2490,7 +2490,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2534,7 +2534,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2578,7 +2578,7 @@ class PcondParam(NamedTuple): kappa95=1.6517857142857142, pchargemw=1.2453296074483358, pinjmw=75.397788712812741, - plascur=16616203.759182997, + plasma_current=16616203.759182997, pcoreradpv=0.047757569353246924, q=3.5610139569387185, qstar=2.9513713188821282, @@ -2643,7 +2643,7 @@ def test_pcond(pcondparam, monkeypatch, physics): kappa95=pcondparam.kappa95, pchargemw=pcondparam.pchargemw, pinjmw=pcondparam.pinjmw, - plascur=pcondparam.plascur, + plasma_current=pcondparam.plasma_current, pcoreradpv=pcondparam.pcoreradpv, q=pcondparam.q, qstar=pcondparam.qstar, diff --git a/tests/unit/test_pulse.py b/tests/unit/test_pulse.py index 4b99c86b52..fb37c20759 100755 --- a/tests/unit/test_pulse.py +++ b/tests/unit/test_pulse.py @@ -54,7 +54,7 @@ class TohswgParam(NamedTuple): cptdin: Any = None - plascur: Any = None + plasma_current: Any = None rmajor: Any = None @@ -81,7 +81,7 @@ class BurnParam(NamedTuple): vstot: Any = None - plascur: Any = None + plasma_current: Any = None inductive_current_fraction: Any = None @@ -560,7 +560,7 @@ class BurnParam(NamedTuple): ), order="F", ).transpose(), - plascur=17721306.969367817, + plasma_current=17721306.969367817, rmajor=8.8901000000000003, active_constraints=( True, @@ -1117,7 +1117,7 @@ class BurnParam(NamedTuple): ), order="F", ).transpose(), - plascur=17721306.969367817, + plasma_current=17721306.969367817, rmajor=8.8901000000000003, active_constraints=( True, @@ -1254,7 +1254,7 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): monkeypatch.setattr(pfcoil_variables, "cptdin", tohswgparam.cptdin) - monkeypatch.setattr(physics_variables, "plascur", tohswgparam.plascur) + monkeypatch.setattr(physics_variables, "plasma_current", tohswgparam.plasma_current) monkeypatch.setattr(physics_variables, "rmajor", tohswgparam.rmajor) @@ -1276,7 +1276,7 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): vsind=284.23601098215397, vsbn=0, vstot=-718.91787876294552, - plascur=17721306.969367817, + plasma_current=17721306.969367817, inductive_current_fraction=0.60433999999999999, csawth=1, lpulse=1, @@ -1292,7 +1292,7 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): vsind=284.23601098215397, vstot=-718.9849676846776, vsbn=-354.76231817639609, - plascur=17721306.969367817, + plasma_current=17721306.969367817, inductive_current_fraction=0.60433999999999999, csawth=1, lpulse=1, @@ -1327,7 +1327,7 @@ def test_burn(burnparam, monkeypatch, initialise_error_module, pulse): monkeypatch.setattr(pfcoil_variables, "vsbn", burnparam.vsbn) - monkeypatch.setattr(physics_variables, "plascur", burnparam.plascur) + monkeypatch.setattr(physics_variables, "plasma_current", burnparam.plasma_current) monkeypatch.setattr(physics_variables, "inductive_current_fraction", burnparam.inductive_current_fraction) From bac2836adca5fbb08590fa15826acab4684c5fff Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 16:51:16 +0100 Subject: [PATCH 091/108] Refactor variable name plasma_current/1D6 to plasma_current_MA in multiple files This should prevent parsing problems due to / no longer present. Variable name change is technically not PEP8 complinat but is a stand in to make the code explicit --- .../data/csv_output_large_tokamak_MFILE.DAT | 2 +- examples/data/large_tokamak_1_MFILE.DAT | 2 +- examples/data/large_tokamak_2_MFILE.DAT | 2 +- examples/data/large_tokamak_3_MFILE.DAT | 2 +- examples/data/large_tokamak_4_MFILE.DAT | 2 +- examples/data/scan_MFILE.DAT | 18 +++++------ process/io/mfile_comparison.py | 6 ++-- process/io/plot_proc.py | 2 +- process/io/plot_scans.py | 2 +- process/io/variable_metadata.py | 2 +- process/physics.py | 2 +- .../data/large_tokamak_1_MFILE.DAT | 2 +- .../data/large_tokamak_2_MFILE.DAT | 2 +- .../data/large_tokamak_3_MFILE.DAT | 2 +- .../data/large_tokamak_4_MFILE.DAT | 2 +- .../integration/data/large_tokamak_MFILE.DAT | 2 +- tests/integration/data/scan_2D_MFILE.DAT | 30 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 18 +++++------ tests/unit/data/large_tokamak_MFILE.DAT | 2 +- 19 files changed, 51 insertions(+), 51 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 415c158c49..ac73645d0c 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -332,7 +332,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6699E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6699E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8387E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1898E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3601E-01 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 3827e64511..b27363afbd 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 3d5eef2b23..422e223a73 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 8ff8edbef6..53207efed5 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index a8820c9c79..c2cb109cf9 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index e6c62079a1..830c8a4d60 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -188,7 +188,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -1183,7 +1183,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -2178,7 +2178,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -3173,7 +3173,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -4168,7 +4168,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -5163,7 +5163,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -6158,7 +6158,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -7153,7 +7153,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -8148,7 +8148,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index a16d094b64..26469b0042 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -57,7 +57,7 @@ "blnkith", "blnkoth", "powfmw", - "plasma_current/1d6", + "plasma_current_MA", "bt", "q95", "betap", @@ -110,7 +110,7 @@ "vol", "n_tf", "powfmw", - "plasma_current/1d6", + "plasma_current_MA", "bt", "q95", "beta", @@ -216,7 +216,7 @@ "triang", "triang95", "powfmw", - "plasma_current/1d6", + "plasma_current_MA", "bt", "q95", "beta", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 491ecc74fb..f590de3f5b 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2393,7 +2393,7 @@ def plot_physics_info(axis, mfile_data, scan): data = [ ("powfmw", "Fusion power", "MW"), ("bigq", "$Q_{p}$", ""), - ("plasma_current/1d6", "$I_p$", "MA"), + ("plasma_current_MA", "$I_p$", "MA"), ("bt", "Vacuum $B_T$ at $R_0$", "T"), ("q95", r"$q_{\mathrm{95}}$", ""), ("normalised_thermal_beta", r"$\beta_N$, thermal", "% m T MA$^{-1}$"), diff --git a/process/io/plot_scans.py b/process/io/plot_scans.py index 3df2a3ef50..67e57d1f2e 100644 --- a/process/io/plot_scans.py +++ b/process/io/plot_scans.py @@ -632,7 +632,7 @@ def main(args=None): plt.tight_layout() # Output file naming - if output_name == "plasma_current/1d6": + if output_name == "plasma_current_MA": plt.savefig( f"{args.outputdir}/scan_{scan_var_name}_vs_plasma_current" + f"_vs_{output_name2}" diff --git a/process/io/variable_metadata.py b/process/io/variable_metadata.py index 2a710f47cc..116ffbf93a 100644 --- a/process/io/variable_metadata.py +++ b/process/io/variable_metadata.py @@ -161,7 +161,7 @@ class VariableMetadata: "f_tf_steel": VariableMetadata( latex=r"f_\mathrm{steel}^\mathrm{TF}", description="TF steel fraction", units="" ), - "plasma_current/1d6": VariableMetadata( + "plasma_current_MA": VariableMetadata( latex=r"$I_{\mathrm{p}}$[$MA$]", description="Plasma current", units="MA" ), "n_cycle": VariableMetadata( diff --git a/process/physics.py b/process/physics.py index 2808ad2e1e..60981464a8 100644 --- a/process/physics.py +++ b/process/physics.py @@ -3256,7 +3256,7 @@ def outplas(self): po.ovarrf( self.outfile, "Plasma current (MA)", - "(plasma_current/1D6)", + "(plasma_current_MA)", physics_variables.plasma_current / 1.0e6, "OP ", ) diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 65d2a4153c..074933658d 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index efbc6e4b93..ba1009d38b 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index c18aebc479..4e2a187e1b 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 4c08eb7a0f..8b4facccf5 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -333,7 +333,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6631E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6631E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9805E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2275E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4373E-01 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 431beec114..f991f86eb2 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -329,7 +329,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6521E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6521E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 2.0295E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2402E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4379E-01 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index cae6878cfd..3c952ebbce 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -334,7 +334,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6569E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6569E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9385E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2165E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3401E-01 @@ -1497,7 +1497,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6633E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6633E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8709E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1985E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3404E-01 @@ -2660,7 +2660,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6683E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6683E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8062E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1810E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3354E-01 @@ -3823,7 +3823,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6609E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6609E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8186E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1844E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3410E-01 @@ -4986,7 +4986,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6604E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6604E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8760E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1999E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3571E-01 @@ -6149,7 +6149,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6548E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6548E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9423E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2175E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3617E-01 @@ -7312,7 +7312,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6479E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6479E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9545E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2207E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3684E-01 @@ -8475,7 +8475,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6497E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6497E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8947E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2048E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3564E-01 @@ -9638,7 +9638,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6468E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6468E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8429E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1909E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3335E-01 @@ -10801,7 +10801,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6447E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6447E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8466E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1919E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3508E-01 @@ -11964,7 +11964,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6498E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6498E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8944E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2048E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3786E-01 @@ -13127,7 +13127,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6485E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6485E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9535E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2204E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.3919E-01 @@ -14290,7 +14290,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6455E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6455E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9590E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2219E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4071E-01 @@ -15453,7 +15453,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6516E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6516E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8912E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2039E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4046E-01 @@ -16616,7 +16616,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6581E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6581E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.8235E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.1857E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4025E-01 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 24f9e5bb6a..c1deb45c45 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -188,7 +188,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -1183,7 +1183,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -2178,7 +2178,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -3173,7 +3173,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -4168,7 +4168,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -5163,7 +5163,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -6158,7 +6158,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -7153,7 +7153,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 @@ -8148,7 +8148,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.8078E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.8078E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 1.9256E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2131E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -6.9441E-01 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 431beec114..f991f86eb2 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -329,7 +329,7 @@ Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 - Plasma_current_(MA)_____________________________________________________ (plasma_current/1D6)_________________ 1.6521E+01 + Plasma_current_(MA)_____________________________________________________ (plasma_current_MA)_________________ 1.6521E+01 Current_density_profile_factor__________________________________________ (alphaj)______________________ 2.0295E+00 Plasma_internal_inductance,_li__________________________________________ (rli)_________________________ 1.2402E+00 Vertical_field_at_plasma_(T)____________________________________________ (bvert)_______________________ -7.4379E-01 From 10037ed296d1cdc2e8bcc59cf64d575d0d6e3469 Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 19:04:51 +0100 Subject: [PATCH 092/108] Refactor variable name qpsi to q95 for Wilson bootstrap model in physics.py and test_physics.py --- process/physics.py | 12 ++++++------ tests/unit/test_physics.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/process/physics.py b/process/physics.py index 60981464a8..f8a88ed633 100644 --- a/process/physics.py +++ b/process/physics.py @@ -5140,7 +5140,7 @@ def bootstrap_fraction_wilson( alphat: float, betpth: float, q0: float, - qpsi: float, + q95: float, rmajor: float, rminor: float, ) -> float: @@ -5153,7 +5153,7 @@ def bootstrap_fraction_wilson( alphat (float): Temperature profile index. betpth (float): Thermal component of poloidal beta. q0 (float): Safety factor on axis. - qpsi (float): Edge safety factor. + q95 (float): Edge safety factor. rmajor (float): Major radius (m). rminor (float): Minor radius (m). @@ -5166,15 +5166,15 @@ def bootstrap_fraction_wilson( H. R. Wilson, Nuclear Fusion 32 (1992) 257 """ term1 = np.log(0.5) - term2 = np.log(q0 / qpsi) + term2 = np.log(q0 / q95) termp = 1.0 - 0.5 ** (1.0 / alphap) termt = 1.0 - 0.5 ** (1.0 / alphat) termj = 1.0 - 0.5 ** (1.0 / alphaj) - alfpnw = term1 / np.log(np.log((q0 + (qpsi - q0) * termp) / qpsi) / term2) - alftnw = term1 / np.log(np.log((q0 + (qpsi - q0) * termt) / qpsi) / term2) - aj = term1 / np.log(np.log((q0 + (qpsi - q0) * termj) / qpsi) / term2) + alfpnw = term1 / np.log(np.log((q0 + (q95 - q0) * termp) / q95) / term2) + alftnw = term1 / np.log(np.log((q0 + (q95 - q0) * termt) / q95) / term2) + aj = term1 / np.log(np.log((q0 + (q95 - q0) * termj) / q95) / term2) # Crude check for NaN errors or other illegal values... diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index ed58be79ff..5eb87c5a7a 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -225,7 +225,7 @@ class BootstrapFractionWilsonParam(NamedTuple): q0: Any = None - qpsi: Any = None + q95: Any = None rmajor: Any = None @@ -243,7 +243,7 @@ class BootstrapFractionWilsonParam(NamedTuple): alphat=1.45, betpth=1.0874279209664601, q0=1, - qpsi=3.5, + q95=3.5, rmajor=8, rminor=2.6666666666666665, expected_bfw=0.42321339288758714, @@ -254,7 +254,7 @@ class BootstrapFractionWilsonParam(NamedTuple): alphat=1.45, betpth=0.99075943086768326, q0=1, - qpsi=3.5, + q95=3.5, rmajor=8, rminor=2.6666666666666665, expected_bfw=0.38559122143951252, @@ -280,7 +280,7 @@ def test_bootstrap_fraction_wilson(bootstrapfractionwilsonparam, physics): alphat=bootstrapfractionwilsonparam.alphat, betpth=bootstrapfractionwilsonparam.betpth, q0=bootstrapfractionwilsonparam.q0, - qpsi=bootstrapfractionwilsonparam.qpsi, + q95=bootstrapfractionwilsonparam.q95, rmajor=bootstrapfractionwilsonparam.rmajor, rminor=bootstrapfractionwilsonparam.rminor, ) From 1142ce1fba5b319a0de6d122bd1579ad741fe90b Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sat, 28 Sep 2024 20:19:15 +0100 Subject: [PATCH 093/108] Refactor navigation menu in mkdocs.yml to include Composition, Impurities & Radiation section --- mkdocs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 82fd2cedb7..a24eb7d3e4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -52,8 +52,7 @@ nav: - Beta Limit: physics-models/plasma_beta.md - Fast Alpha: physics-models/plasma_alpha.md - Density Limit: physics-models/plasma_density.md - - Composition & Impurities: physics-models/plasma_radiation_impurities.md - - Radiation: physics-models/plasma_radiation_impurities.md + - Composition, Impurities & Radiation: physics-models/plasma_radiation_impurities.md - Plasma Current: - Overview: physics-models/plasma_current/plasma_current.md - Bootstrap Current: physics-models/plasma_current/bootstrap_current.md From af89f107916751fc957b7ca93291d21ca0eb2329 Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sun, 29 Sep 2024 12:17:40 +0100 Subject: [PATCH 094/108] Format YAML files --- mkdocs.yml | 44 ++++++++++++++++---------------- process/current_drive.py | 32 ++++++++++++++++++----- process/physics.py | 19 +++++++++++--- tests/unit/test_current_drive.py | 14 +++++++--- tests/unit/test_pulse.py | 6 ++++- 5 files changed, 79 insertions(+), 36 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index a24eb7d3e4..fc28ada2be 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,28 +40,28 @@ nav: # - Versioning: development/versioning.md - Reference: - Physics Models: - - Plasma: - - Overview: physics-models/plasma_overview.md - - Geometry: physics-models/plasma_geometry.md - - Profiles: - - Overview: physics-models/profiles/plasma_profiles.md - - Density Profile: physics-models/profiles/plasma_density_profile.md - - Temperature Profile: physics-models/profiles/plasma_temperature_profile.md - - Profile Base Class: physics-models/profiles/plasma_profiles_abstract_class.md - - Fusion Reactions: physics-models/plasma_reactions.md - - Beta Limit: physics-models/plasma_beta.md - - Fast Alpha: physics-models/plasma_alpha.md - - Density Limit: physics-models/plasma_density.md - - Composition, Impurities & Radiation: physics-models/plasma_radiation_impurities.md - - Plasma Current: - - Overview: physics-models/plasma_current/plasma_current.md - - Bootstrap Current: physics-models/plasma_current/bootstrap_current.md - - Diamagnetic Current: physics-models/plasma_current/diamagnetic_current.md - - Pfirsch-Schlüter Current: physics-models/plasma_current/pfirsch_schlüter_current_drive.md - - Inductive Current: physics-models/plasma_current/inductive_plasma_current.md - - External Current Drive: physics-models/plasma_current/external_current_drive.md - - Confinement time: physics-models/plasma_confinement.md - - Plasma Core Power Balance: physics-models/plasma_power_balance.md + - Plasma: + - Overview: physics-models/plasma_overview.md + - Geometry: physics-models/plasma_geometry.md + - Profiles: + - Overview: physics-models/profiles/plasma_profiles.md + - Density Profile: physics-models/profiles/plasma_density_profile.md + - Temperature Profile: physics-models/profiles/plasma_temperature_profile.md + - Profile Base Class: physics-models/profiles/plasma_profiles_abstract_class.md + - Fusion Reactions: physics-models/plasma_reactions.md + - Beta Limit: physics-models/plasma_beta.md + - Fast Alpha: physics-models/plasma_alpha.md + - Density Limit: physics-models/plasma_density.md + - Composition, Impurities & Radiation: physics-models/plasma_radiation_impurities.md + - Plasma Current: + - Overview: physics-models/plasma_current/plasma_current.md + - Bootstrap Current: physics-models/plasma_current/bootstrap_current.md + - Diamagnetic Current: physics-models/plasma_current/diamagnetic_current.md + - Pfirsch-Schlüter Current: physics-models/plasma_current/pfirsch_schlüter_current_drive.md + - Inductive Current: physics-models/plasma_current/inductive_plasma_current.md + - External Current Drive: physics-models/plasma_current/external_current_drive.md + - Confinement time: physics-models/plasma_confinement.md + - Plasma Core Power Balance: physics-models/plasma_power_balance.md - Pulsed Plant Operation: physics-models/pulsed-plant.md - Engineering Models: - Machine Build: eng-models/machine-build.md diff --git a/process/current_drive.py b/process/current_drive.py index 9663277058..87d6e12b67 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -284,7 +284,9 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plasma_current + aux_current_fraction_fix = ( + auxiliary_cdfix / physics_variables.plasma_current + ) elif current_drive_variables.iefrffix in [3, 7, 10, 12, 13]: # Injected power pinjemwfix = current_drive_variables.pinjfixmw @@ -306,7 +308,9 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plasma_current + aux_current_fraction_fix = ( + auxiliary_cdfix / physics_variables.plasma_current + ) elif current_drive_variables.iefrffix in [5, 8]: # Account for first orbit losses # (power due to particles that are ionised but not thermalised) [MW]: @@ -353,7 +357,9 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - aux_current_fraction_fix = auxiliary_cdfix / physics_variables.plasma_current + aux_current_fraction_fix = ( + auxiliary_cdfix / physics_variables.plasma_current + ) # Fenstermacher Lower Hybrid model if current_drive_variables.iefrf == 1: @@ -553,14 +559,20 @@ def cudriv(self, output: bool): ) # Compute current drive wall plug and injected powers (MW) and efficiencies - auxiliary_cd = physics_variables.aux_current_fraction * physics_variables.plasma_current + auxiliary_cd = ( + physics_variables.aux_current_fraction + * physics_variables.plasma_current + ) # LHCD or ICCD if current_drive_variables.iefrf in [1, 2, 4, 6]: # Injected power current_drive_variables.plhybd = ( 1.0e-6 - * (physics_variables.aux_current_fraction - aux_current_fraction_fix) + * ( + physics_variables.aux_current_fraction + - aux_current_fraction_fix + ) * physics_variables.plasma_current / effrfss + current_drive_variables.pheat @@ -585,7 +597,10 @@ def cudriv(self, output: bool): # Injected power (set to close to close the Steady-state current equilibrium) current_drive_variables.echpwr = ( 1.0e-6 - * (physics_variables.aux_current_fraction - aux_current_fraction_fix) + * ( + physics_variables.aux_current_fraction + - aux_current_fraction_fix + ) * physics_variables.plasma_current / effrfss + current_drive_variables.pheat @@ -604,7 +619,10 @@ def cudriv(self, output: bool): # MDK. See Gitlab issue #248, and scanned note. power1 = ( 1.0e-6 - * (physics_variables.aux_current_fraction - aux_current_fraction_fix) + * ( + physics_variables.aux_current_fraction + - aux_current_fraction_fix + ) * physics_variables.plasma_current / effnbss + current_drive_variables.pheat diff --git a/process/physics.py b/process/physics.py index f8a88ed633..3d27d1429b 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1631,7 +1631,9 @@ def physics(self): current_drive_variables.pscf_scene = ps_fraction_scene(physics_variables.beta) if physics_variables.i_pfirsch_schluter_current == 1: - current_drive_variables.ps_current_fraction = current_drive_variables.pscf_scene + current_drive_variables.ps_current_fraction = ( + current_drive_variables.pscf_scene + ) # ***************************** # # BOOTSTRAP CURRENT # @@ -1780,7 +1782,9 @@ def physics(self): physics_module.err243 = 1 # Fraction of plasma current produced by inductive means - physics_variables.inductive_current_fraction = max(1.0e-10, (1.0e0 - physics_variables.fvsbrnni)) + physics_variables.inductive_current_fraction = max( + 1.0e-10, (1.0e0 - physics_variables.fvsbrnni) + ) # Fraction of plasma current produced by auxiliary current drive physics_variables.aux_current_fraction = ( physics_variables.fvsbrnni @@ -2700,7 +2704,16 @@ def phyaux( return burnup, dntau, figmer, fusrat, qfuel, rndfuel, taup @staticmethod - def pohm(inductive_current_fraction, kappa95, plasma_current, rmajor, rminor, ten, vol, zeff): + def pohm( + inductive_current_fraction, + kappa95, + plasma_current, + rmajor, + rminor, + ten, + vol, + zeff, + ): # Density weighted electron temperature in 10 keV units t10 = ten / 10.0 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 3114984853..d7b88d011f 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -499,7 +499,9 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): cudrivparam.diamagnetic_current_fraction, ) - monkeypatch.setattr(current_drive_variables, "ps_current_fraction", cudrivparam.ps_current_fraction) + monkeypatch.setattr( + current_drive_variables, "ps_current_fraction", cudrivparam.ps_current_fraction + ) monkeypatch.setattr( current_drive_variables, @@ -555,7 +557,9 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(physics_variables, "ipedestal", cudrivparam.ipedestal) - monkeypatch.setattr(physics_variables, "aux_current_fraction", cudrivparam.aux_current_fraction) + monkeypatch.setattr( + physics_variables, "aux_current_fraction", cudrivparam.aux_current_fraction + ) monkeypatch.setattr(physics_variables, "ignite", cudrivparam.ignite) @@ -563,7 +567,11 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(physics_variables, "powfmw", cudrivparam.powfmw) - monkeypatch.setattr(physics_variables, "inductive_current_fraction", cudrivparam.inductive_current_fraction) + monkeypatch.setattr( + physics_variables, + "inductive_current_fraction", + cudrivparam.inductive_current_fraction, + ) monkeypatch.setattr(physics_variables, "fvsbrnni", cudrivparam.fvsbrnni) diff --git a/tests/unit/test_pulse.py b/tests/unit/test_pulse.py index fb37c20759..fe48258fc3 100755 --- a/tests/unit/test_pulse.py +++ b/tests/unit/test_pulse.py @@ -1329,7 +1329,11 @@ def test_burn(burnparam, monkeypatch, initialise_error_module, pulse): monkeypatch.setattr(physics_variables, "plasma_current", burnparam.plasma_current) - monkeypatch.setattr(physics_variables, "inductive_current_fraction", burnparam.inductive_current_fraction) + monkeypatch.setattr( + physics_variables, + "inductive_current_fraction", + burnparam.inductive_current_fraction, + ) monkeypatch.setattr(physics_variables, "csawth", burnparam.csawth) From 3d6f10b6a5ef4f145a98b298aedf9e8ffb1fac9a Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sun, 29 Sep 2024 16:50:41 +0100 Subject: [PATCH 095/108] Refactor the ipdg89 bootstrap function to be concurrent with the formatting shown in the source document. Added additional context in the docs also --- .../plasma_current/bootstrap_current.md | 6 ++-- process/physics.py | 31 ++++++++++++------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md index 7559bbae6d..6ba4c0c69c 100644 --- a/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/bootstrap_current.md @@ -7,7 +7,7 @@ Some more info can be found [here](https://wiki.fusion.ciemat.es/wiki/Bootstrap_ The fraction of the plasma current provided by the bootstrap effect can be either input into the code directly, or calculated using one of five -methods, as summarised here. Note that methods `i_bootstrap_current = 1-3` do not take into account the +methods, as summarised here. Note that methods `i_bootstrap_current = 1-3 & 5` do not take into account the existence of pedestals, whereas the Sauter et al. scaling (`i_bootstrap_current = 4`) allows general profiles to be used. @@ -39,9 +39,11 @@ B_{\text{pa}} = \frac{I}{5\langle a \rangle} $$ $$ -\langle a \rangle = \left(\frac{V}{2\pi^2 R_0}\right) +\langle a \rangle = \left(\frac{V}{2\pi^2 R_0}\right)^{0.5} $$ +Here, $\beta_{\text{tot}}$ is the average total plasma (toroidal) beta. $I$ is given in $\text{MA}$ and $B_0$ is the on-axis toroidal field in Tesla. + ------------ ### Nevins Scaling | `bootstrap_fraction_nevins()` diff --git a/process/physics.py b/process/physics.py index 3d27d1429b..0ae455edc3 100644 --- a/process/physics.py +++ b/process/physics.py @@ -5130,21 +5130,28 @@ def bootstrap_fraction_iter89( This function performs the original ITER calculation of the plasma current bootstrap fraction. - Reference: ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, - ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 + Reference: + - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, + - ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 """ - xbs = min(10, q95 / q0) - cbs = 1.32 - 0.235 * xbs + 0.0185 * xbs**2 - bpbs = ( - constants.rmu0 - * plasma_current - / (2 * np.pi * np.sqrt(vol / (2 * np.pi**2 * rmajor))) - ) - betapbs = beta * bt**2 / bpbs**2 - if betapbs <= 0.0: # only possible if beta <= 0.0 + # Calculate the bootstrap current coefficient + c_bs = 1.32 - 0.235 * (q95 / q0) + 0.0185 * (q95 / q0) ** 2 + + # Calculate the average minor radius + average_a = np.sqrt(vol / (2 * np.pi ** 2 * rmajor)) + + b_pa = (plasma_current / 1e6) / (5 * average_a) + + # Calculate the poloidal beta for bootstrap current + betapbs = beta * (bt / b_pa) ** 2 + + # Ensure betapbs is positive + if betapbs <= 0.0: return 0.0 - return cbs * (betapbs / np.sqrt(aspect)) ** 1.3 + + # Calculate and return the bootstrap current fraction + return c_bs * (betapbs / np.sqrt(aspect)) ** 1.3 @staticmethod def bootstrap_fraction_wilson( From 1cfe274fd011bdf6e5a6848b1dd2868b1b62c8eb Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sun, 29 Sep 2024 17:17:42 +0100 Subject: [PATCH 096/108] Refactor test_calculate_plasma_current function to use more descriptive name --- tests/unit/test_physics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 5eb87c5a7a..5644d3bc33 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -747,7 +747,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): ), ), ) -def test_plasc(arguments, expected): +def test_calculate_plasma_current_peng(arguments, expected): assert calculate_plasma_current_peng(**arguments) == pytest.approx(expected) From 38cc7af07a045e4a91ba58fa1e5872b4d298fa40 Mon Sep 17 00:00:00 2001 From: chris-ashe Date: Sun, 29 Sep 2024 18:47:19 +0100 Subject: [PATCH 097/108] Fix html script id to make Bokeh plot show for Connor-Hastie current profiles, ensured used of Bokeh 2.4.0 --- .../plasma_current/plasma_current.md | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md index d020d39372..32183a798f 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -350,6 +350,10 @@ The parameters $\lambda$ and $\nu$ characterise the current profile $J_{\phi} = Since $\lambda$ in this case is treated as the current profile index `alphaj` within PROCESS will use its assumed standard [parabolic profile](../profiles/plasma_profiles.md`). Even though the profile given above by Connor-Hastie is different. The differenc between these two assumed current profiles can be experimented with below. + + +------------------- + @@ -380,17 +384,17 @@ The parameters $\lambda$ and $\nu$ characterise the current profile $J_{\phi} = - - - -
    - - - - - -