From cb45ef5a2a4cc30b71676bf41a436e52508aa718 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 16 Jan 2025 15:42:40 +0000 Subject: [PATCH 01/38] :art: Refactor sauter_geometry method for improved parameter clarity and documentation --- process/plasma_geometry.py | 54 +++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 4ffae6d940..7c05a4932c 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -533,39 +533,61 @@ def xsect0(self, a, kap, tri): return xsect0 - def sauter_geometry(self, a, r0, kap, tri): + def sauter_geometry( + self, a: float, r0: float, kappa: float, triang: float + ) -> tuple[float, float, float, float, float]: """ - Plasma geometry based on equations (36) in O. Sauter, Fusion Engineering and Design 112 (2016) 633–645 - 'Geometric formulas for system codes including the effect of negative triangularity' - Author: Michael Kovari, issue #392 - a : input real : plasma minor radius (m) - r0 : input real : plasma major radius (m) - kap : input real : plasma separatrix elongation - tri : input real : plasma separatrix triangularity + Calculate the plasma geometry parameters using the Sauter geometry model. + + Parameters: + a (float): Plasma minor radius (m) + r0 (float): Plasma major radius (m) + kappa (float): Plasma separatrix elongation + triang (float): Plasma separatrix triangularity + + Returns: + tuple: A tuple containing: + - pperim (float): Poloidal perimeter + - sf (float): Geometric factor + - sarea (float): Surface area + - xarea (float): Cross-section area + - plasma_volume (float): Plasma volume + + Notes: + + Refrences: + - O. Sauter, “Geometric formulas for system codes including the effect of negative triangularity,” + Fusion Engineering and Design, vol. 112, pp. 633–645, Nov. 2016, + doi: https://doi.org/10.1016/j.fusengdes.2016.04.033. + """ + + # Calculate w07 parameter from paper w07 = 1 + + # Inverse aspect ratio eps = a / r0 # Poloidal perimeter (named Lp in Sauter) - pperim = ( + len_plasma_poloidal = ( 2.0e0 * np.pi * a - * (1 + 0.55 * (kap - 1)) - * (1 + 0.08 * tri**2) + * (1 + 0.55 * (kappa - 1)) + * (1 + 0.08 * triang**2) * (1 + 0.2 * (w07 - 1)) ) # A geometric factor - sf = pperim / (2.0e0 * np.pi * a) + sf = len_plasma_poloidal / (2.0e0 * np.pi * a) # Surface area (named Ap in Sauter) - sarea = 2.0e0 * np.pi * r0 * (1 - 0.32 * tri * eps) * pperim + sarea = 2.0e0 * np.pi * r0 * (1 - 0.32 * triang * eps) * len_plasma_poloidal # Cross-section area (named S_phi in Sauter) - xarea = np.pi * a**2 * kap * (1 + 0.52 * (w07 - 1)) + xarea = np.pi * a**2 * kappa * (1 + 0.52 * (w07 - 1)) # Volume - plasma_volume = 2.0e0 * np.pi * r0 * (1 - 0.25 * tri * eps) * xarea + plasma_volume = 2.0e0 * np.pi * r0 * (1 - 0.25 * triang * eps) * xarea - return pperim, sf, sarea, xarea, plasma_volume + return len_plasma_poloidal, sf, sarea, xarea, plasma_volume From 69a9d8cd4b18c7f34bb98555fa7ffe098295f4b4 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 16 Jan 2025 15:47:00 +0000 Subject: [PATCH 02/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'iscrp'=20to=20'i?= =?UTF-8?q?=5Fplasma=5Fwall=5Fgap'=20for=20improved=20clarity=20in=20plasm?= =?UTF-8?q?a=20wall=20gap=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documentation/proc-pages/physics-models/error.txt | 6 +++--- .../proc-pages/physics-models/plasma_geometry.md | 6 +++--- process/plasma_geometry.py | 2 +- source/fortran/build_variables.f90 | 4 ++-- source/fortran/input.f90 | 8 ++++---- source/fortran/physics_variables.f90 | 10 +++++----- tests/integration/ref_dicts.json | 14 +++++++------- .../input_files/large_tokamak_once_through.IN.DAT | 4 ++-- tests/regression/input_files/st_regression.IN.DAT | 2 +- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/documentation/proc-pages/physics-models/error.txt b/documentation/proc-pages/physics-models/error.txt index 8c122a973b..93270b1c57 100644 --- a/documentation/proc-pages/physics-models/error.txt +++ b/documentation/proc-pages/physics-models/error.txt @@ -1387,10 +1387,10 @@ The region directly outside the last closed flux surface of the core plasma is known as the scrape-off layer, and contains no structural material. Plasma entering this region is not confined and is removed by the divertor. PROCESS treats the scrape-off layer merely as a gap. -Switch \texttt{iscrp} determines whether the inboard and outboard gaps +Switch \texttt{i_plasma_wall_gap} determines whether the inboard and outboard gaps should be calculated as 10\% of the plasma minor radius -(\texttt{iscrp\ =\ 0}), or set equal to the input values -\texttt{scrapli} and \texttt{scraplo} (\texttt{iscrp\ =\ 1}). +(\texttt{i_plasma_wall_gap\ =\ 0}), or set equal to the input values +\texttt{scrapli} and \texttt{scraplo} (\texttt{i_plasma_wall_gap\ =\ 1}). \end{document} diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 158fb6e015..3ccaa384cb 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -197,10 +197,10 @@ known as the scrape-off layer, and contains no structural material. Plasma entering this region is not confined and is removed by the divertor. PROCESS treats the scrape-off layer merely as a gap. -The plasma and first wall clearance can be calculated or input by setting the `iscrp` switch. +The plasma and first wall clearance can be calculated or input by setting the `i_plasma_wall_gap` switch. -- `iscrp` == 0, then the inboard and outboard plasma wall gaps are set to be 10% of the plasma minor radius ($a$). -- `iscrp` == 1, then the inboard and outboard plasma wall gaps are set by defining `scrapli` and `scraplo` respectively. +- `i_plasma_wall_gap` == 0, then the inboard and outboard plasma wall gaps are set to be 10% of the plasma minor radius ($a$). +- `i_plasma_wall_gap` == 1, then the inboard and outboard plasma wall gaps are set by defining `scrapli` and `scraplo` respectively. ### Geometrical properties | `xparam()` diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 7c05a4932c..140f9c0bd2 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -199,7 +199,7 @@ def geomty(self): physics_variables.triang95 = physics_variables.triang / 1.50e0 # Scrape-off layer thicknesses - if physics_variables.iscrp == 0: + if physics_variables.i_plasma_wall_gap == 0: build_variables.scraplo = 0.1e0 * physics_variables.rminor build_variables.scrapli = 0.1e0 * physics_variables.rminor diff --git a/source/fortran/build_variables.f90 b/source/fortran/build_variables.f90 index 843ad5f61e..fd40058398 100644 --- a/source/fortran/build_variables.f90 +++ b/source/fortran/build_variables.f90 @@ -207,12 +207,12 @@ module build_variables !! TF coil vertical inner bore (m) real(dp) :: scrapli - !! Gap between plasma and first wall, inboard side (m) (if `iscrp=1`) + !! Gap between plasma and first wall, inboard side (m) (if `i_plasma_wall_gap=1`) !! Iteration variable: ixc = 73 !! Scan variable: nsweep = 58 real(dp) :: scraplo - !! Gap between plasma and first wall, outboard side (m) (if `iscrp=1`) + !! Gap between plasma and first wall, outboard side (m) (if `i_plasma_wall_gap=1`) !! Iteration variable: ixc = 74 !! Scan variable: nsweep = 59 diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index d226caa9ce..d945f621d4 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) itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & teped, f_helium3, iwalld, gamma, f_alpha_plasma, fgwped, tbeta, i_bootstrap_current, & iradloss, te, alphan, rmajor, kappa, iinvqd, fkzohm, beamfus0, & - tauratio, i_density_limit, bt, iscrp, ipnlaws, beta_max, beta_min, & + tauratio, i_density_limit, bt, i_plasma_wall_gap, ipnlaws, beta_max, beta_min, & 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 @@ -663,9 +663,9 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('isc') call parse_int_variable('isc', isc, 1, ipnlaws, & 'Switch for confinement scaling law') - case ('iscrp') - call parse_int_variable('iscrp', iscrp, 0, 1, & - 'Switch for scrapeoff width') + case ('i_plasma_wall_gap') + call parse_int_variable('i_plasma_wall_gap', i_plasma_wall_gap, 0, 1, & + 'Switch for midplane gap between plasma and wall') case ('ishape') call parse_int_variable('ishape', ishape, 0, 11, & 'Switch for plasma shape vs. aspect') diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index b5fc336f8a..50542032b2 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -523,11 +523,11 @@ module physics_variables !!
  • (48) NSTX gyro-Bohm (Buxton) (H-mode; Spherical tokamak) !!
  • (49) Use input tauee_in - integer :: iscrp - !! switch for plasma-first wall clearances: + integer :: i_plasma_wall_gap + !! Switch for plasma-first wall clearances at the mid-plane: !! - !! - =0 use 10% of rminor - !! - =1 use input (scrapli and scraplo) + !! - =0 use 10% of plasma minor radius + !! - =1 use input (`scrapli` and `scraplo`) integer :: ishape !! switch for plasma cross-sectional shape calculation: @@ -1045,7 +1045,7 @@ subroutine init_physics_variables iprofile = 1 iradloss = 1 isc = 34 - iscrp = 1 + i_plasma_wall_gap = 1 ishape = 0 itart = 0 itartpf = 0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 703a4291a2..891fbb06f9 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -2668,7 +2668,7 @@ "isc": 34.0, "iscan_global": 0.0, "iscenr": 2.0, - "iscrp": 1.0, + "i_plasma_wall_gap": 1.0, "iscz": 0.0, "ishape": 0.0, "istell": 0.0, @@ -9909,7 +9909,7 @@ "isc": "switch for energy confinement time scaling law (see description in `tauscl`)", "iscan_global": "Makes iscan available globally.", "iscenr": "Switch for PF coil energy storage option:\n
      \n
    • =1 all power from MGF (motor-generator flywheel) units
    • \n
    • =2 all pulsed power from line
    • \n
    • =3 PF power from MGF, heating from line
    • \n
    ", - "iscrp": "switch for plasma-first wall clearances:\n
      \n
    • =0 use 10% of rminor
    • \n
    • =1 use input (scrapli and scraplo)
    • \n
    ", + "i_plasma_wall_gap": "switch for plasma-first wall clearances:\n
      \n
    • =0 use 10% of rminor
    • \n
    • =1 use input (scrapli and scraplo)
    • \n
    ", "iscz": "", "ishape": "switch for plasma cross-sectional shape calculation:\n
      \n
    • =0 use input kappa, triang to calculate 95% values
    • \n
    • =1 scale qlim, kappa, triang with aspect ratio (ST)
    • \n
    • =2 set kappa to the natural elongation value (Zohm ITER scaling), triang input
    • \n
    • =3 set kappa to the natural elongation value (Zohm ITER scaling), triang95 input
    • \n
    • =4 use input kappa95, triang95 to calculate separatrix values
    • \n
    • =5 use input kappa95, triang95 to calculate separatrix values based on MAST scaling (ST)
    • \n
    • =6 use input kappa, triang to calculate 95% values based on MAST scaling (ST)
    • \n
    • =7 use input kappa95, triang95 to calculate separatrix values based on fit to FIESTA (ST)
    • \n
    • =8 use input kappa, triang to calculate 95% values based on fit to FIESTA (ST)
    • \n
    • =9 set kappa to the natural elongation value, triang input
    • \n
    • =10 set kappa to maximum stable value at a given aspect ratio (2.6\n
    • =11 set kappa Menard 2016 aspect-ratio-dependent scaling, triang input (#1439)
    • \n
    ", "istell": "Switch for stellarator option (set via `device.dat`):\n
      \n
    • =0 use tokamak model
    • \n
    • =1 use stellarator model: Helias5-b
    • \n
    • =2 use stellarator model: Helias4-b
    • \n
    • =3 use stellarator model: Helias3-b
    • \n
    ", @@ -10600,8 +10600,8 @@ "scafc": "", "scale": "", "scan_dim": "1-D or 2-D scan switch (1=1D, 2=2D)", - "scrapli": "Gap between plasma and first wall, inboard side (m) (if `iscrp=1`)\n Iteration variable: ixc = 73\n Scan variable: nsweep = 58", - "scraplo": "Gap between plasma and first wall, outboard side (m) (if `iscrp=1`)\n Iteration variable: ixc = 74\n Scan variable: nsweep = 59", + "scrapli": "Gap between plasma and first wall, inboard side (m) (if `i_plasma_wall_gap=1`)\n Iteration variable: ixc = 73\n Scan variable: nsweep = 58", + "scraplo": "Gap between plasma and first wall, outboard side (m) (if `i_plasma_wall_gap=1`)\n Iteration variable: ixc = 74\n Scan variable: nsweep = 59", "sec_buildings_h": "security & safety buildings length, width, height (m)", "sec_buildings_l": "security & safety buildings length, width, height (m)", "sec_buildings_w": "security & safety buildings length, width, height (m)", @@ -13501,7 +13501,7 @@ "lb": 1, "ub": 3 }, - "iscrp": { + "i_plasma_wall_gap": { "lb": 0, "ub": 1 }, @@ -19163,7 +19163,7 @@ "iradloss", "isc", "tauscl", - "iscrp", + "i_plasma_wall_gap", "ishape", "itart", "itartpf", @@ -20507,7 +20507,7 @@ "irfcd": "int_variable", "isc": "int_variable", "iscenr": "int_variable", - "iscrp": "int_variable", + "i_plasma_wall_gap": "int_variable", "ishape": "int_variable", "istell": "int_variable", "isthtr": "int_variable", 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 cf7aa5ec9b..6a135e9dbb 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -103,8 +103,8 @@ d_vv_top = 0.3 * vacuum vessel topside thickness (TF coil / shield) (m) (= d_vv_ d_vv_bot = 0.3 * vacuum vessel underside thickness (TF coil / shield) (m) gapds = 0.02 * gap between inboard vacuum vessel and thermal shield (m) (`iteration variable 61`) ohcth = 0.546816593988753 * Central solenoid thickness (m) (`iteration variable 16`) -scrapli = 0.25 * Gap between plasma and first wall; inboard side (m) (if `iscrp=1`) -scraplo = 0.25 * Gap between plasma and first wall; outboard side (m) (if `iscrp=1`) +scrapli = 0.25 * Gap between plasma and first wall; inboard side (m) (if `i_plasma_wall_gap=1`) +scraplo = 0.25 * Gap between plasma and first wall; outboard side (m) (if `i_plasma_wall_gap=1`) shldith = 0.3 * inboard shield thickness (m) (`iteration variable 93`) shldoth = 0.800 * outboard shield thickness (m) (`iteration variable 94`) tfcth = 1.2 * inboard TF coil thickness; (centrepost for ST) (m) diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index b352a1b38b..b379f55ced 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -2079,7 +2079,7 @@ blnkith = 0.0 * DESCRIPTION: Inboard blanket breeding unit thickness (m) (blktmodel>0) * JUSTIFICATION: Design choice, no inboard blanket -*iscrp = +*i_plasma_wall_gap = * DESCRIPTION: Switch for scrapeoff width (default = 1) * =0 use 10% of rminor * =1 use input (scrapli and scraplo) From cd784b58c650d308e67eb93f5b8a345bd5cd1ae7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 16 Jan 2025 15:50:14 +0000 Subject: [PATCH 03/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'geomty'=20to=20'?= =?UTF-8?q?plasma=5Fgeometry'=20for=20consistency=20and=20clarity=20in=20p?= =?UTF-8?q?lasma=20geometry=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proc-pages/physics-models/plasma_current/plasma_current.md | 2 +- documentation/proc-pages/physics-models/plasma_geometry.md | 2 +- process/caller.py | 2 +- process/plasma_geometry.py | 2 +- 4 files changed, 4 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 9e284b1d8f..767622fc8c 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -481,7 +481,7 @@ 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. +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--plasma_geometry) relation. $$ diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 3ccaa384cb..103d80c744 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -11,7 +11,7 @@ elongation of the last closed flux surface (LCFS) $\kappa$ (`kappa`) and the tri $\delta$ (`triang`), which can be scaled automatically with the aspect ratio if required using certain switch conditions of `ishape`: -## Plasma Geometry Parameters | `geomty()` +## Plasma Geometry Parameters | `plasma_geometry()` This subroutine calculates the plasma geometry parameters based on the given input values. The plasma geometry parameters include the shaping terms, plasma aspect ratio, elongation, and triangularity. diff --git a/process/caller.py b/process/caller.py index bc619dc50d..e88c3dfbde 100644 --- a/process/caller.py +++ b/process/caller.py @@ -246,7 +246,7 @@ def _call_models_once(self, xc: np.ndarray) -> None: # Tokamak calls # Plasma geometry model - self.models.plasma_geom.geomty() + self.models.plasma_geom.plasma_geometry() # Machine Build Model # Radial build diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 140f9c0bd2..5627e8ad9f 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -11,7 +11,7 @@ class PlasmaGeom: def __init__(self): self.outfile = constants.nout - def geomty(self): + def plasma_geometry(self): """ Plasma geometry parameters author: P J Knight, CCFE, Culham Science Centre From d07279d2bc8ac2532c42fcc2969f4248dca36e52 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 16 Jan 2025 15:51:23 +0000 Subject: [PATCH 04/38] :bug: Sauter geometry function was not being properly called due to capitalization --- process/plasma_geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 5627e8ad9f..71a4780b32 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -229,7 +229,7 @@ def plasma_geometry(self): physics_variables.sarea, physics_variables.xarea, physics_variables.plasma_volume, - ) = self.Sauter_geometry( + ) = self.sauter_geometry( physics_variables.rminor, physics_variables.rmajor, physics_variables.kappa, From 8f655e1ff97929e7e12e3e55aa119294af23f87b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 16 Jan 2025 16:02:23 +0000 Subject: [PATCH 05/38] =?UTF-8?q?=F0=9F=93=9DRefactor=20plasma=20geometry?= =?UTF-8?q?=20calculations=20for=20improved=20clarity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/plasma_geometry.py | 459 ++++++++++++++++++++++--------------- 1 file changed, 273 insertions(+), 186 deletions(-) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 71a4780b32..bc00ac44ce 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -11,17 +11,22 @@ class PlasmaGeom: def __init__(self): self.outfile = constants.nout - def plasma_geometry(self): + def plasma_geometry(self) -> None: """ Plasma geometry parameters author: P J Knight, CCFE, Culham Science Centre + + This method calculates the plasma geometry parameters based on various shaping terms and input values. + It updates the `physics_variables` with calculated values for kappa, triangularity, surface area, volume, etc. + + References: + - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, + unpublished internal Oak Ridge document + - H. Zohm et al, On the Physics Guidelines for a Tokamak DEMO, + FTP/3-3, Proc. IAEA Fusion Energy Conference, October 2012, San Diego + + Returns: None - This subroutine calculates the plasma geometry parameters. - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, - unpublished internal Oak Ridge document - F/MI/PJK/LOGBOOK14, pp.41-43 - H. Zohm et al, On the Physics Guidelines for a Tokamak DEMO, - FTP/3-3, Proc. IAEA Fusion Energy Conference, October 2012, San Diego """ xsi = 0.0e0 @@ -31,10 +36,13 @@ def plasma_geometry(self): xi = 0.0e0 xo = 0.0e0 + # Define plasma minor radius from major radius and aspect ratio physics_variables.rminor = physics_variables.rmajor / physics_variables.aspect + + # Define the inverse aspect ratio physics_variables.eps = 1.0e0 / physics_variables.aspect - # Calculate shaping terms, rather than use input values + # ====================================================================== if ( physics_variables.ishape == 0 @@ -47,6 +55,8 @@ def plasma_geometry(self): physics_variables.kappa95 = physics_variables.kappa / 1.12e0 physics_variables.triang95 = physics_variables.triang / 1.50e0 + # ====================================================================== + if ( physics_variables.ishape == 1 ): # ST scaling with physics_variables.aspect ratio [STAR Code] @@ -69,6 +79,8 @@ def plasma_geometry(self): physics_variables.triang - 0.048306e0 ) / 1.3799e0 + # ====================================================================== + if ( physics_variables.ishape == 2 ): # Zohm et al. ITER scaling for elongation, input physics_variables.triang @@ -80,6 +92,8 @@ def plasma_geometry(self): physics_variables.kappa95 = physics_variables.kappa / 1.12e0 physics_variables.triang95 = physics_variables.triang / 1.50e0 + # ====================================================================== + if ( physics_variables.ishape == 3 ): # Zohm et al. ITER scaling for elongation, input physics_variables.triang95 @@ -92,6 +106,8 @@ def plasma_geometry(self): physics_variables.kappa95 = physics_variables.kappa / 1.12e0 + # ====================================================================== + if ( physics_variables.ishape == 4 ): # Use input kappa95, physics_variables.triang95 values @@ -99,6 +115,8 @@ def plasma_geometry(self): physics_variables.kappa = 1.12e0 * physics_variables.kappa95 physics_variables.triang = 1.5e0 * physics_variables.triang95 + # ====================================================================== + if ( physics_variables.ishape == 5 ): # Use input kappa95, physics_variables.triang95 values @@ -108,6 +126,8 @@ def plasma_geometry(self): 0.77394e0 * physics_variables.triang95 + 0.18515e0 ) + # ====================================================================== + if ( physics_variables.ishape == 6 ): # Use input kappa, physics_variables.triang values @@ -119,6 +139,8 @@ def plasma_geometry(self): physics_variables.triang - 0.18515e0 ) / 0.77394e0 + # ====================================================================== + if ( physics_variables.ishape == 7 ): # Use input kappa95, physics_variables.triang95 values @@ -128,6 +150,8 @@ def plasma_geometry(self): 1.3799e0 * physics_variables.triang95 + 0.048306e0 ) + # ====================================================================== + if ( physics_variables.ishape == 8 ): # Use input kappa, physics_variables.triang values @@ -139,6 +163,8 @@ def plasma_geometry(self): physics_variables.triang - 0.048306e0 ) / 1.3799e0 + # ====================================================================== + if ( physics_variables.ishape == 9 ): # Use input triang, physics_variables.rli values @@ -150,6 +176,8 @@ def plasma_geometry(self): physics_variables.kappa95 = physics_variables.kappa / 1.12e0 physics_variables.triang95 = physics_variables.triang / 1.50e0 + # ====================================================================== + if physics_variables.ishape == 10: # physics_variables.kappa95 found from physics_variables.aspect ratio and stabilty margin # Based on fit to CREATE data. ref Issue #1399 @@ -184,6 +212,8 @@ def plasma_geometry(self): physics_variables.kappa = 1.12e0 * physics_variables.kappa95 physics_variables.triang95 = physics_variables.triang / 1.50e0 + # ====================================================================== + if physics_variables.ishape == 11: # See Issue #1439 # physics_variables.triang is an input @@ -198,17 +228,24 @@ def plasma_geometry(self): physics_variables.kappa95 = physics_variables.kappa / 1.12e0 physics_variables.triang95 = physics_variables.triang / 1.50e0 + # ====================================================================== + # Scrape-off layer thicknesses if physics_variables.i_plasma_wall_gap == 0: build_variables.scraplo = 0.1e0 * physics_variables.rminor build_variables.scrapli = 0.1e0 * physics_variables.rminor + # ====================================================================== + # Find parameters of arcs describing plasma surfaces xi, thetai, xo, thetao = self.xparam( physics_variables.rminor, physics_variables.kappa, physics_variables.triang, ) + + # ====================================================================== + # Surface area - inboard and outboard. These are not given by Sauter but # the outboard area is required by DCLL and divertor xsi, xso = self.xsurf( @@ -221,6 +258,8 @@ def plasma_geometry(self): ) physics_variables.sareao = xso + # ====================================================================== + # i_plasma_current = 8 specifies use of the Sauter geometry as well as plasma current. if physics_variables.i_plasma_current == 8: ( @@ -259,23 +298,35 @@ def plasma_geometry(self): # Surface area - sum of inboard and outboard. physics_variables.sarea = xsi + xso - def xparam(self, a, kap, tri): + # ====================================================================== + + @staticmethod + def xparam(a: float, kap: float, tri: float) -> tuple[float, float, float, float]: """ Routine to find parameters used for calculating geometrical - properties for double-null plasmas - author: P J Knight, CCFE, Culham Science Centre - a : input real : plasma minor radius (m) - kap : input real : plasma separatrix elongation - tri : input real : plasma separatrix triangularity - xi : output real : radius of arc describing inboard surface (m) - thetai : output real : half-angle of arc describing inboard surface - xo : output real : radius of arc describing outboard surface (m) - thetao : output real : half-angle of arc describing outboard surface + properties for double-null plasmas. + + Author: P J Knight, CCFE, Culham Science Centre + + Parameters: + a (float): Plasma minor radius (m) + kap (float): Plasma separatrix elongation + tri (float): Plasma separatrix triangularity + + Returns: + tuple: A tuple containing: + - xi (float): Radius of arc describing inboard surface (m) + - thetai (float): Half-angle of arc describing inboard surface + - xo (float): Radius of arc describing outboard surface (m) + - thetao (float): Half-angle of arc describing outboard surface + This function finds plasma geometrical parameters, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - F/MI/PJK/LOGBOOK14, p.42 - F/PL/PJK/PROCESS/CODE/047 + + References: + - F/MI/PJK/LOGBOOK14, p.42 + - F/PL/PJK/PROCESS/CODE/047 """ t = 1.0e0 - tri denomi = (kap**2 - t**2) / (2.0e0 * t) @@ -291,54 +342,33 @@ def xparam(self, a, kap, tri): return xi, thetai, xo, thetao - def surfa(self, a, r, k, d): + @staticmethod + def xsurf( + rmajor: float, rminor: float, xi: float, thetai: float, xo: float, thetao: float + ) -> tuple[float, float]: """ Plasma surface area calculation author: P J Knight, CCFE, Culham Science Centre - a : input real : plasma minor radius (m) - r : input real : plasma major radius (m) - k : input real : plasma separatrix elongation - d : input real : plasma separatrix triangularity - sa : output real : plasma total surface area (m2) - so : output real : plasma outboard surface area (m2) - This function finds the plasma surface area, using the - revolution of two intersecting arcs around the device centreline. - This calculation is appropriate for plasmas with a separatrix. - It was the original method in PROCESS. - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, - unpublished internal Oak Ridge document - """ - radco = a * (1.0e0 + (k**2 + d**2 - 1.0e0) / (2.0e0 * (1.0e0 + d))) - b = k * a - thto = np.arcsin(b / radco) - so = 4.0e0 * np.pi * radco * ((r + a - radco) * thto + b) - - # Inboard side - - radci = a * (1.0e0 + (k**2 + d**2 - 1.0e0) / (2.0e0 * (1.0e0 - d))) - thti = np.arcsin(b / radci) - si = 4.0e0 * np.pi * radci * ((r - a + radci) * thti - b) - sa = so + si + Parameters: + rmajor (float): Plasma major radius (m) + rminor (float): Plasma minor radius (m) + xi (float): Radius of arc describing inboard surface (m) + thetai (float): Half-angle of arc describing inboard surface + xo (float): Radius of arc describing outboard surface (m) + thetao (float): Half-angle of arc describing outboard surface - return sa, so + Returns: + tuple: A tuple containing: + - xsi (float): Inboard surface area (m^2) + - xso (float): Outboard surface area (m^2) - def xsurf(self, rmajor, rminor, xi, thetai, xo, thetao): - """ - Plasma surface area calculation - author: P J Knight, CCFE, Culham Science Centre - rmajor : input real : plasma major radius (m) - rminor : input real : plasma minor radius (m) - xi : input real : radius of arc describing inboard surface (m) - thetai : input real : half-angle of arc describing inboard surface - xo : input real : radius of arc describing outboard surface (m) - thetao : input real : half-angle of arc describing outboard surface - xsi : output real : inboard surface area (m2) - xso : output real : outboard surface area (m2) This function finds the plasma surface area, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - F/MI/PJK/LOGBOOK14, p.43 + + References: + - F/MI/PJK/LOGBOOK14, p.43 """ fourpi = 4.0e0 * np.pi @@ -350,51 +380,30 @@ def xsurf(self, rmajor, rminor, xi, thetai, xo, thetao): return xsi, xso - def perim(self, a, kap, tri): + @staticmethod + def xvol(rmajor, rminor, xi, thetai, xo, thetao): """ - Plasma poloidal perimeter calculation + Plasma volume calculation author: P J Knight, CCFE, Culham Science Centre - a : input real : plasma minor radius (m) - kap : input real : plasma separatrix elongation - tri : input real : plasma separatrix triangularity - This function finds the plasma poloidal perimeter, using the - revolution of two intersecting arcs around the device centreline. - This calculation is appropriate for plasmas with a separatrix. - F/PL/PJK/PROCESS/CODE/047 - """ - - # Inboard arc - denomi = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 - tri)) + tri - thetai = np.arctan(kap / denomi) - xli = a * (denomi + 1.0e0 - tri) - - # Outboard arc - - denomo = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 + tri)) - tri - thetao = np.arctan(kap / denomo) - xlo = a * (denomo + 1.0e0 + tri) - - perim = 2.0e0 * (xlo * thetao + xli * thetai) + Parameters: + rmajor (float): Plasma major radius (m) + rminor (float): Plasma minor radius (m) + xi (float): Radius of arc describing inboard surface (m) + thetai (float): Half-angle of arc describing inboard surface + xo (float): Radius of arc describing outboard surface (m) + thetao (float): Half-angle of arc describing outboard surface - return perim + Returns: + float: Plasma volume (m^3) - def xvol(self, rmajor, rminor, xi, thetai, xo, thetao): - """ - Plasma volume calculation - author: P J Knight, CCFE, Culham Science Centre - rmajor : input real : plasma major radius (m) - rminor : input real : plasma minor radius (m) - xi : input real : radius of arc describing inboard surface (m) - thetai : input real : half-angle of arc describing inboard surface - xo : input real : radius of arc describing outboard surface (m) - thetao : input real : half-angle of arc describing outboard surface This function finds the plasma volume, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - F/MI/PJK/LOGBOOK14, p.43 + + References: + - F/MI/PJK/LOGBOOK14, p.43 """ - # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! third = 1.0e0 / 3.0e0 @@ -429,18 +438,27 @@ def xvol(self, rmajor, rminor, xi, thetai, xo, thetao): return xvol - def xsecta(self, xi, thetai, xo, thetao): + @staticmethod + def xsecta(xi: float, thetai: float, xo: float, thetao: float) -> float: """ Plasma cross-sectional area calculation author: P J Knight, CCFE, Culham Science Centre - xi : input real : radius of arc describing inboard surface (m) - thetai : input real : half-angle of arc describing inboard surface - xo : input real : radius of arc describing outboard surface (m) - thetao : input real : half-angle of arc describing outboard surface + + Parameters: + xi (float): Radius of arc describing inboard surface (m) + thetai (float): Half-angle of arc describing inboard surface + xo (float): Radius of arc describing outboard surface (m) + thetao (float): Half-angle of arc describing outboard surface + + Returns: + float: Plasma cross-sectional area (m^2) + This function finds the plasma cross-sectional area, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - F/MI/PJK/LOGBOOK14, p.41 + + References: + - F/MI/PJK/LOGBOOK14, p.41 """ xsecta = xo**2 * (thetao - np.cos(thetao) * np.sin(thetao)) + xi**2 * ( @@ -449,92 +467,9 @@ def xsecta(self, xi, thetai, xo, thetao): return xsecta - def fvol(self, r, a, kap, tri): - """ - Plasma volume calculation - author: P J Knight, CCFE, Culham Science Centre - r : input real : plasma major radius (m) - a : input real : plasma minor radius (m) - kap : input real : plasma separatrix elongation - tri : input real : plasma separatrix triangularity - This function finds the plasma volume, using the - revolution of two intersecting arcs around the device centreline. - This calculation is appropriate for plasmas with a separatrix. - F/MI/PJK/LOGBOOK14, p.41 - F/PL/PJK/PROCESS/CODE/047 - """ - - zn = kap * a - - c1 = ((r + a) ** 2 - (r - tri * a) ** 2 - zn**2) / (2.0e0 * (1.0e0 + tri) * a) - rc1 = r + a - c1 - vout = ( - -0.66666666e0 * np.pi * zn**3 - + 2.0e0 * np.pi * zn * (c1**2 + rc1**2) - + 2.0e0 - * np.pi - * c1 - * (zn * np.sqrt(rc1**2 - zn**2) + rc1**2 * np.arcsin(zn / rc1)) - ) - - c2 = (-((r - a) ** 2) + (r - tri * a) ** 2 + zn**2) / ( - 2.0e0 * (1.0e0 - tri) * a - ) - rc2 = c2 - r + a - vin = ( - -0.66666e0 * np.pi * zn**3 - + 2.0e0 * np.pi * zn * (rc2**2 + c2**2) - - 2.0e0 - * np.pi - * c2 - * (zn * np.sqrt(rc2**2 - zn**2) + rc2**2 * np.arcsin(zn / rc2)) - ) - - fvol = vout - vin - - return fvol - - def xsect0(self, a, kap, tri): - """ - Plasma cross-sectional area calculation - author: P J Knight, CCFE, Culham Science Centre - a : input real : plasma minor radius (m) - kap : input real : plasma separatrix elongation - tri : input real : plasma separatrix triangularity - This function finds the plasma cross-sectional area, using the - revolution of two intersecting arcs around the device centreline. - This calculation is appropriate for plasmas with a separatrix. - The method for finding the arc radii and angles are copied from - routine PERIM, and are thought to be - by Peng. - F/MI/PJK/LOGBOOK14, p.41 - F/PL/PJK/PROCESS/CODE/047 - """ - - denomi = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 - tri)) + tri - thetai = np.arctan(kap / denomi) - xli = a * (denomi + 1.0e0 - tri) - - cti = np.cos(thetai) - sti = np.sin(thetai) - - # Find radius and half-angle of outboard arc - - denomo = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 + tri)) - tri - thetao = np.arctan(kap / denomo) - xlo = a * (denomo + 1.0e0 + tri) - - cto = np.cos(thetao) - sto = np.sin(thetao) - - # Find cross-sectional area - - xsect0 = xlo**2 * (thetao - cto * sto) + xli**2 * (thetai - cti * sti) - - return xsect0 - + @staticmethod def sauter_geometry( - self, a: float, r0: float, kappa: float, triang: float + a: float, r0: float, kappa: float, triang: float ) -> tuple[float, float, float, float, float]: """ Calculate the plasma geometry parameters using the Sauter geometry model. @@ -591,3 +526,155 @@ def sauter_geometry( plasma_volume = 2.0e0 * np.pi * r0 * (1 - 0.25 * triang * eps) * xarea return len_plasma_poloidal, sf, sarea, xarea, plasma_volume + + +# -------------------------------- +# Obsolete legacy calculations +# -------------------------------- + + +def surfa(a, r, k, d): + """ + Plasma surface area calculation + author: P J Knight, CCFE, Culham Science Centre + a : input real : plasma minor radius (m) + r : input real : plasma major radius (m) + k : input real : plasma separatrix elongation + d : input real : plasma separatrix triangularity + sa : output real : plasma total surface area (m2) + so : output real : plasma outboard surface area (m2) + This function finds the plasma surface area, using the + revolution of two intersecting arcs around the device centreline. + This calculation is appropriate for plasmas with a separatrix. + It was the original method in PROCESS. + J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, + unpublished internal Oak Ridge document + """ + radco = a * (1.0e0 + (k**2 + d**2 - 1.0e0) / (2.0e0 * (1.0e0 + d))) + b = k * a + thto = np.arcsin(b / radco) + so = 4.0e0 * np.pi * radco * ((r + a - radco) * thto + b) + + # Inboard side + + radci = a * (1.0e0 + (k**2 + d**2 - 1.0e0) / (2.0e0 * (1.0e0 - d))) + thti = np.arcsin(b / radci) + si = 4.0e0 * np.pi * radci * ((r - a + radci) * thti - b) + + sa = so + si + + return sa, so + + +def perim(a, kap, tri): + """ + Plasma poloidal perimeter calculation + author: P J Knight, CCFE, Culham Science Centre + a : input real : plasma minor radius (m) + kap : input real : plasma separatrix elongation + tri : input real : plasma separatrix triangularity + This function finds the plasma poloidal perimeter, using the + revolution of two intersecting arcs around the device centreline. + This calculation is appropriate for plasmas with a separatrix. + F/PL/PJK/PROCESS/CODE/047 + """ + + # Inboard arc + + denomi = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 - tri)) + tri + thetai = np.arctan(kap / denomi) + xli = a * (denomi + 1.0e0 - tri) + + # Outboard arc + + denomo = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 + tri)) - tri + thetao = np.arctan(kap / denomo) + xlo = a * (denomo + 1.0e0 + tri) + + perim = 2.0e0 * (xlo * thetao + xli * thetai) + + return perim + + +def fvol(r, a, kap, tri): + """ + Plasma volume calculation + author: P J Knight, CCFE, Culham Science Centre + r : input real : plasma major radius (m) + a : input real : plasma minor radius (m) + kap : input real : plasma separatrix elongation + tri : input real : plasma separatrix triangularity + This function finds the plasma volume, using the + revolution of two intersecting arcs around the device centreline. + This calculation is appropriate for plasmas with a separatrix. + F/MI/PJK/LOGBOOK14, p.41 + F/PL/PJK/PROCESS/CODE/047 + """ + + zn = kap * a + + c1 = ((r + a) ** 2 - (r - tri * a) ** 2 - zn**2) / (2.0e0 * (1.0e0 + tri) * a) + rc1 = r + a - c1 + vout = ( + -0.66666666e0 * np.pi * zn**3 + + 2.0e0 * np.pi * zn * (c1**2 + rc1**2) + + 2.0e0 + * np.pi + * c1 + * (zn * np.sqrt(rc1**2 - zn**2) + rc1**2 * np.arcsin(zn / rc1)) + ) + + c2 = (-((r - a) ** 2) + (r - tri * a) ** 2 + zn**2) / (2.0e0 * (1.0e0 - tri) * a) + rc2 = c2 - r + a + vin = ( + -0.66666e0 * np.pi * zn**3 + + 2.0e0 * np.pi * zn * (rc2**2 + c2**2) + - 2.0e0 + * np.pi + * c2 + * (zn * np.sqrt(rc2**2 - zn**2) + rc2**2 * np.arcsin(zn / rc2)) + ) + + fvol = vout - vin + + return fvol + + +def xsect0(a, kap, tri): + """ + Plasma cross-sectional area calculation + author: P J Knight, CCFE, Culham Science Centre + a : input real : plasma minor radius (m) + kap : input real : plasma separatrix elongation + tri : input real : plasma separatrix triangularity + This function finds the plasma cross-sectional area, using the + revolution of two intersecting arcs around the device centreline. + This calculation is appropriate for plasmas with a separatrix. + The method for finding the arc radii and angles are copied from + routine PERIM, and are thought to be + by Peng. + F/MI/PJK/LOGBOOK14, p.41 + F/PL/PJK/PROCESS/CODE/047 + """ + + denomi = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 - tri)) + tri + thetai = np.arctan(kap / denomi) + xli = a * (denomi + 1.0e0 - tri) + + cti = np.cos(thetai) + sti = np.sin(thetai) + + # Find radius and half-angle of outboard arc + + denomo = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 + tri)) - tri + thetao = np.arctan(kap / denomo) + xlo = a * (denomo + 1.0e0 + tri) + + cto = np.cos(thetao) + sto = np.sin(thetao) + + # Find cross-sectional area + + xsect0 = xlo**2 * (thetao - cto * sto) + xli**2 * (thetai - cti * sti) + + return xsect0 From f4aca40905532070b04cbebd691b887c916fe3a8 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 13:52:56 +0000 Subject: [PATCH 06/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'qlim'=20to=20'q9?= =?UTF-8?q?5=5Fmin'=20for=20consistency=20in=20edge=20safety=20factor=20ca?= =?UTF-8?q?lculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proc-pages/physics-models/plasma_geometry.md | 2 +- process/physics.py | 4 ++-- process/plasma_geometry.py | 2 +- source/fortran/constraint_equations.f90 | 12 ++++++------ source/fortran/physics_variables.f90 | 6 +++--- source/fortran/scan.f90 | 8 ++++---- tests/integration/ref_dicts.json | 8 ++++---- tests/regression/input_files/st_regression.IN.DAT | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 103d80c744..c507bb4374 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -44,7 +44,7 @@ The function uses various scaling laws and formulas to calculate these parameter \delta = 0.53 \, \left(1 + 0.77 \, \epsilon^3\right) $$ - The lower limit for the edge safety factor `qlim` is also set here + The lower limit for the edge safety factor `q95_min` is also set here $$ q_{\text{lim}} = 3 \, \left(1 + 2.6 \, \epsilon^{2.8}\right) $$ diff --git a/process/physics.py b/process/physics.py index a85aa519a8..8432bbabd0 100644 --- a/process/physics.py +++ b/process/physics.py @@ -3631,8 +3631,8 @@ def outplas(self): po.ovarrf( self.outfile, "Lower limit for edge safety factor q", - "(qlim)", - physics_variables.qlim, + "(q95_min)", + physics_variables.q95_min, "OP ", ) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index bc00ac44ce..3ee2f39604 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -60,7 +60,7 @@ def plasma_geometry(self) -> None: if ( physics_variables.ishape == 1 ): # ST scaling with physics_variables.aspect ratio [STAR Code] - physics_variables.qlim = 3.0e0 * ( + physics_variables.q95_min = 3.0e0 * ( 1.0e0 + 2.6e0 * physics_variables.eps**2.8e0 ) diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index 109b499d0a..e11f26792f 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -1980,18 +1980,18 @@ subroutine constraint_eqn_045(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! residual error in physical units; output string; units string !! Equation for edge safety factor lower limit (TART) !! #=# tfcoil - !! #=#=# fq, qlim + !! #=#=# fq, q95_min !! and hence also optional here. !! 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 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 + !! q95_min : input real : lower limit for edge safety factor !! itart : input integer : switch for spherical tokamak (ST) models:
      !!
    • = 0 use conventional aspect ratio models; !!
    • = 1 use spherical tokamak models
    use constraint_variables, only: fq - use physics_variables, only: q, qlim, itart + use physics_variables, only: q, q95_min, itart implicit none real(dp), intent(out) :: tmp_cc real(dp), intent(out) :: tmp_con @@ -2001,9 +2001,9 @@ subroutine constraint_eqn_045(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(9) - tmp_cc = 1.0D0 - fq * q/qlim - tmp_con = qlim * (1.0D0 - tmp_cc) - tmp_err = qlim * tmp_cc + tmp_cc = 1.0D0 - fq * q/q95_min + tmp_con = q95_min * (1.0D0 - tmp_cc) + tmp_err = q95_min * tmp_cc tmp_symbol = '<' tmp_units = '' diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 50542032b2..e0a948ea22 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -533,7 +533,7 @@ module physics_variables !! switch for plasma cross-sectional shape calculation: !! !! - =0 use input kappa, triang to calculate 95% values - !! - =1 scale qlim, kappa, triang with aspect ratio (ST) + !! - =1 scale q95_min, kappa, triang with aspect ratio (ST) !! - =2 set kappa to the natural elongation value (Zohm ITER scaling), triang input !! - =3 set kappa to the natural elongation value (Zohm ITER scaling), triang95 input !! - =4 use input kappa95, triang95 to calculate separatrix values @@ -788,7 +788,7 @@ module physics_variables real(dp) :: tauratio !! tauratio /1.0/ : ratio of He and pellet particle confinement times - real(dp) :: qlim + real(dp) :: q95_min !! lower limit for edge safety factor real(dp) :: qstar @@ -1116,7 +1116,7 @@ subroutine init_physics_variables q95 = 0.0D0 qfuel = 0.0D0 tauratio = 1.0D0 - qlim = 0.0D0 + q95_min = 0.0D0 qstar = 0.0D0 rad_fraction_sol = 0.8D0 rad_fraction_total = 0.0D0 diff --git a/source/fortran/scan.f90 b/source/fortran/scan.f90 index 397b168e13..3e3449e1e1 100644 --- a/source/fortran/scan.f90 +++ b/source/fortran/scan.f90 @@ -196,7 +196,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) dr_tf_wp, b_crit_upper_nbti use fwbs_variables, only: tpeak use physics_variables, only: q, aspect, pradmw, dene, fusion_power, btot, tesep, & - pdivt, ralpne, ten, beta_poloidal, hfac, teped, alpha_power_beams, qlim, rmajor, wallmw, & + pdivt, ralpne, ten, beta_poloidal, hfac, teped, alpha_power_beams, q95_min, rmajor, wallmw, & beta, beta_max, bt, plasma_current use global_variables, only: verbose, maxcal, runtitle, run_tests use constants, only: nout @@ -227,7 +227,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) outvar(13,iscan) = bt outvar(14,iscan) = btot outvar(15,iscan) = q - outvar(16,iscan) = qlim + outvar(16,iscan) = q95_min outvar(17,iscan) = beta outvar(18,iscan) = beta_max outvar(19,iscan) = beta_poloidal / aspect @@ -326,7 +326,7 @@ subroutine scan_1d_write_plot(iscan, outvar) plabel(13) = 'B_Toroidal_Axis_(T)______' plabel(14) = 'B_total_on_axis_(T)______' plabel(15) = 'Safety_Factor____________' - plabel(16) = 'qlim_(zero_if_ishape=0)__' + plabel(16) = 'q95_min_(zero_if_ishape=0)__' plabel(17) = 'Beta_____________________' plabel(18) = 'Beta_Limit_______________' plabel(19) = 'Epsilon_Beta_Poloidal____' @@ -514,7 +514,7 @@ subroutine scan_2d_write_plot(iscan, outvar, sweep_1_vals, sweep_2_vals) plabel(13) = 'B_Toroidal_Axis_(T)______' plabel(14) = 'B_total_on_axis_(T)______' plabel(15) = 'Safety_Factor____________' - plabel(16) = 'qlim_(zero_if_ishape=0)__' + plabel(16) = 'q95_min_(zero_if_ishape=0)__' plabel(17) = 'Beta_____________________' plabel(18) = 'Beta_Limit_______________' plabel(19) = 'Epsilon_Beta_Poloidal____' diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 891fbb06f9..99a5a96c5a 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -3714,7 +3714,7 @@ "qb2": null, "qcl": 0.0, "qfuel": 0.0, - "qlim": 0.0, + "q95_min": 0.0, "qmisc": 0.0, "qnty_sfty_fac": 2.0, "qnuc": 0.0, @@ -9911,7 +9911,7 @@ "iscenr": "Switch for PF coil energy storage option:\n
      \n
    • =1 all power from MGF (motor-generator flywheel) units
    • \n
    • =2 all pulsed power from line
    • \n
    • =3 PF power from MGF, heating from line
    • \n
    ", "i_plasma_wall_gap": "switch for plasma-first wall clearances:\n
      \n
    • =0 use 10% of rminor
    • \n
    • =1 use input (scrapli and scraplo)
    • \n
    ", "iscz": "", - "ishape": "switch for plasma cross-sectional shape calculation:\n
      \n
    • =0 use input kappa, triang to calculate 95% values
    • \n
    • =1 scale qlim, kappa, triang with aspect ratio (ST)
    • \n
    • =2 set kappa to the natural elongation value (Zohm ITER scaling), triang input
    • \n
    • =3 set kappa to the natural elongation value (Zohm ITER scaling), triang95 input
    • \n
    • =4 use input kappa95, triang95 to calculate separatrix values
    • \n
    • =5 use input kappa95, triang95 to calculate separatrix values based on MAST scaling (ST)
    • \n
    • =6 use input kappa, triang to calculate 95% values based on MAST scaling (ST)
    • \n
    • =7 use input kappa95, triang95 to calculate separatrix values based on fit to FIESTA (ST)
    • \n
    • =8 use input kappa, triang to calculate 95% values based on fit to FIESTA (ST)
    • \n
    • =9 set kappa to the natural elongation value, triang input
    • \n
    • =10 set kappa to maximum stable value at a given aspect ratio (2.6\n
    • =11 set kappa Menard 2016 aspect-ratio-dependent scaling, triang input (#1439)
    • \n
    ", + "ishape": "switch for plasma cross-sectional shape calculation:\n
      \n
    • =0 use input kappa, triang to calculate 95% values
    • \n
    • =1 scale q95_min, kappa, triang with aspect ratio (ST)
    • \n
    • =2 set kappa to the natural elongation value (Zohm ITER scaling), triang input
    • \n
    • =3 set kappa to the natural elongation value (Zohm ITER scaling), triang95 input
    • \n
    • =4 use input kappa95, triang95 to calculate separatrix values
    • \n
    • =5 use input kappa95, triang95 to calculate separatrix values based on MAST scaling (ST)
    • \n
    • =6 use input kappa, triang to calculate 95% values based on MAST scaling (ST)
    • \n
    • =7 use input kappa95, triang95 to calculate separatrix values based on fit to FIESTA (ST)
    • \n
    • =8 use input kappa, triang to calculate 95% values based on fit to FIESTA (ST)
    • \n
    • =9 set kappa to the natural elongation value, triang input
    • \n
    • =10 set kappa to maximum stable value at a given aspect ratio (2.6\n
    • =11 set kappa Menard 2016 aspect-ratio-dependent scaling, triang input (#1439)
    • \n
    ", "istell": "Switch for stellarator option (set via `device.dat`):\n
      \n
    • =0 use tokamak model
    • \n
    • =1 use stellarator model: Helias5-b
    • \n
    • =2 use stellarator model: Helias4-b
    • \n
    • =3 use stellarator model: Helias3-b
    • \n
    ", "isthtr": "Switch for stellarator auxiliary heating method:\n
      \n
    • = 1electron cyclotron resonance heating
    • \n
    • = 2lower hybrid heating
    • \n
    • = 3neutral beam injection
    • \n
    ", "istore": "Switch for thermal storage method:\n
      \n
    • =1 option 1 of Electrowatt report, AEA FUS 205
    • \n
    • =2 option 2 of Electrowatt report, AEA FUS 205
    • \n
    • =3 stainless steel block
    • \n
    ", @@ -10448,7 +10448,7 @@ "qb2": "", "qcl": "", "qfuel": "plasma fuelling rate (nucleus-pairs/s)", - "qlim": "lower limit for edge safety factor", + "q95_min": "lower limit for edge safety factor", "qmisc": "", "qnty_sfty_fac": "quantity safety factor for component use during plant lifetime", "qnuc": "nuclear heating in the coils (W) (`inuclear=1`)", @@ -19233,7 +19233,7 @@ "q95", "qfuel", "tauratio", - "qlim", + "q95_min", "qstar", "rad_fraction_sol", "rad_fraction_total", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index b379f55ced..2cb9464720 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -179,7 +179,7 @@ aspect = 1.8 ishape = 0 * DESCRIPTION: Switch for plasma shape vs. aspect (default = 0) * =0 use input kappa, triang to calculate 95% values -* =1 scale qlim, kappa, triang with aspect ratio (ST) +* =1 scale q95_min, kappa, triang with aspect ratio (ST) * =2 set kappa to the natural elongation value (Zohm ITER scaling), triang input * =3 set kappa to the natural elongation value (Zohm ITER scaling), triang95 input * =4 use input kappa95, triang95 to calculate separatrix values @@ -392,7 +392,7 @@ q0 = 2.0 * icc = 45 * DESCRIPTION: Constraint equation for edge safety factor lower limit (TART) (ishape = 1) * JUSTIFICATION: Not used, dont care about q at edge lower limit -* VARIABLES: itart, qlim (lower limit for edge safety factor). q calculated in-situ +* VARIABLES: itart, q95_min (lower limit for edge safety factor). q calculated in-situ *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ H-mode & Confinement ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ From 1302ad13a4f59c490835587b4d23e0bea53f8a48 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 13:57:33 +0000 Subject: [PATCH 07/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'pperim'=20to=20'?= =?UTF-8?q?len=5Fplasma=5Fpoloidal'=20for=20improved=20clarity=20in=20plas?= =?UTF-8?q?ma=20perimeter=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plasma_current/plasma_current.md | 4 +-- .../physics-models/plasma_geometry.md | 14 ++++----- .../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/physics.py | 12 ++++---- process/plasma_geometry.py | 8 ++--- source/fortran/physics_variables.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 | 6 ++-- tests/unit/data/large_tokamak_MFILE.DAT | 2 +- tests/unit/test_physics.py | 8 ++--- 21 files changed, 72 insertions(+), 72 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 767622fc8c..af9877cb28 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -539,10 +539,10 @@ $$ 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 be used. In this case the poloidal field is simply returned as: $$ -B_{\text{p}} = \frac{\mu_0 I_{\text{p}}}{\mathtt{pperim}} +B_{\text{p}} = \frac{\mu_0 I_{\text{p}}}{\mathtt{len_plasma_poloidal}} $$ -Where `pperim` is the plasma poloidal perimeter calculated [here](../plasma_geometry.md#poloidal-perimeter). +Where `len_plasma_poloidal` is the plasma poloidal perimeter calculated [here](../plasma_geometry.md#poloidal-perimeter). 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: diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index c507bb4374..af66216a7d 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -327,7 +327,7 @@ Plasma geometry based on equations (36) in O. Sauter, Fusion Engineering and Des | Output Variable | Description | |----------|--------------------------------------| -| `pperim` | Plasma Poloidal perimeter length [$\text{m}$] | +| `len_plasma_poloidal` | Plasma Poloidal perimeter length [$\text{m}$] | | `sarea` | Plasma surface area [$\text{m}^2$] | | `xarea` | Plasma cross-sectional area [$\text{m}^2$] | | `plasma_volume` | Plasma volume [$\text{m}^3$] | @@ -343,19 +343,19 @@ $$ Poloidal perimeter (named Lp in Sauter) $$ -\mathtt{pperim} = 2.0\pi a (1 + 0.55 (\kappa - 1))(1 + 0.08 \delta^2)(1 + 0.2 (\mathtt{w07} - 1)) +\mathtt{len_plasma_poloidal} = 2.0\pi a (1 + 0.55 (\kappa - 1))(1 + 0.08 \delta^2)(1 + 0.2 (\mathtt{w07} - 1)) $$ A geometric factor $$ -\mathtt{sf} = \frac{\mathtt{pperim}}{2.0\pi a} +\mathtt{sf} = \frac{\mathtt{len_plasma_poloidal}}{2.0\pi a} $$ Surface area (named Ap in Sauter) $$ -\mathtt{sarea} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{pperim} +\mathtt{sarea} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{len_plasma_poloidal} $$ Cross-section area (named S_phi in Sauter) @@ -372,14 +372,14 @@ $$ ### Poloidal perimeter -The poloidal plasma perimtere length `pperim` is calculated as follows: +The poloidal plasma perimtere length `len_plasma_poloidal` is calculated as follows: $$ -\mathtt{pperim} = 2.0 \times (\mathtt{xo} \times \mathtt{thetao} + \mathtt{xi} \times \mathtt{thetai}) +\mathtt{len_plasma_poloidal} = 2.0 \times (\mathtt{xo} \times \mathtt{thetao} + \mathtt{xi} \times \mathtt{thetai}) $$ The shaping factor for `i_plasma_current = 1` is also calculated here: $$ -\mathtt{sf} = \frac{\mathtt{pperim}}{ +\mathtt{sf} = \frac{\mathtt{len_plasma_poloidal}}{ 2.0\pi a} $$ diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 22e0aa4094..d810826f4c 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -327,7 +327,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index b349fc60a5..0a703fa777 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -328,7 +328,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 7f1e036438..230367340f 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -328,7 +328,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 18cfa7ccf7..06e383e5c3 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -328,7 +328,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index 422a338b7b..cc6906f037 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -328,7 +328,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index c3be39f2a2..7bb31060bd 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -183,7 +183,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -1178,7 +1178,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -2173,7 +2173,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -3168,7 +3168,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -4163,7 +4163,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -5158,7 +5158,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -6153,7 +6153,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -7148,7 +7148,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -8143,7 +8143,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 diff --git a/process/physics.py b/process/physics.py index 8432bbabd0..2e3460fade 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1510,7 +1510,7 @@ def physics(self): physics_variables.kappa, physics_variables.kappa95, physics_variables.p0, - physics_variables.pperim, + physics_variables.len_plasma_poloidal, physics_variables.q0, physics_variables.q, physics_variables.rli, @@ -3033,7 +3033,7 @@ def calculate_plasma_current( kappa: float, kappa95: float, p0: float, - pperim: float, + len_plasma_poloidal: float, q0: float, q95: float, rli: float, @@ -3070,7 +3070,7 @@ def calculate_plasma_current( kappa (float): Plasma elongation. kappa95 (float): Plasma elongation at 95% surface. p0 (float): Central plasma pressure (Pa). - pperim (float): Plasma perimeter length (m). + len_plasma_poloidal (float): Plasma perimeter length (m). q0 (float): Plasma safety factor on axis. q95 (float): Plasma safety factor at 95% flux (= q-bar for i_plasma_current=2). rli (float): Plasma normalised internal inductance. @@ -3194,7 +3194,7 @@ def calculate_plasma_current( bt, kappa, triang, - pperim, + len_plasma_poloidal, constants.rmu0, ) @@ -3486,8 +3486,8 @@ def outplas(self): po.ovarrf( self.outfile, "Plasma poloidal perimeter (m)", - "(pperim)", - physics_variables.pperim, + "(len_plasma_poloidal)", + physics_variables.len_plasma_poloidal, "OP ", ) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 3ee2f39604..ee42e0bcc7 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -263,7 +263,7 @@ def plasma_geometry(self) -> None: # 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.len_plasma_poloidal, physics_variables.sf, physics_variables.sarea, physics_variables.xarea, @@ -277,8 +277,8 @@ def plasma_geometry(self) -> None: else: # Poloidal perimeter - physics_variables.pperim = 2.0e0 * (xo * thetao + xi * thetai) - physics_variables.sf = physics_variables.pperim / ( + physics_variables.len_plasma_poloidal = 2.0e0 * (xo * thetao + xi * thetai) + physics_variables.sf = physics_variables.len_plasma_poloidal / ( 2.0e0 * np.pi * physics_variables.rminor ) @@ -482,7 +482,7 @@ def sauter_geometry( Returns: tuple: A tuple containing: - - pperim (float): Poloidal perimeter + - len_plasma_poloidal (float): Poloidal perimeter - sf (float): Geometric factor - sarea (float): Surface area - xarea (float): Cross-section area diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index e0a948ea22..1cee7f3f18 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -704,7 +704,7 @@ module physics_variables real(dp) :: fusion_power !! fusion power (MW) - real(dp) :: pperim + real(dp) :: len_plasma_poloidal !! plasma poloidal perimeter (m) real(dp) :: pradmw @@ -1096,7 +1096,7 @@ subroutine init_physics_variables pden_plasma_ohmic_mw = 0.0D0 powerht = 0.0D0 fusion_power = 0.0D0 - pperim = 0.0D0 + len_plasma_poloidal = 0.0D0 pradmw = 0.0D0 pradpv = 0.0D0 pradsolmw = 0.0D0 diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 7c23dd5a5b..507672f4d5 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -327,7 +327,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 6c875d0183..0c0cd27d14 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -328,7 +328,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 2b7b736262..fc5d5abc96 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -328,7 +328,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 7a8900d003..ca12de1feb 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -328,7 +328,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index eb6e95fbc4..e5bcd496c3 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -324,7 +324,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 6d55532d08..0fb3933235 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -329,7 +329,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -1492,7 +1492,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -2655,7 +2655,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -3818,7 +3818,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -4981,7 +4981,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -6144,7 +6144,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -7307,7 +7307,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -8470,7 +8470,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -9633,7 +9633,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -10796,7 +10796,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -11959,7 +11959,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -13122,7 +13122,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -14285,7 +14285,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -15448,7 +15448,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 @@ -16611,7 +16611,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 8904bf7445..832858cdfa 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -183,7 +183,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -1178,7 +1178,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -2173,7 +2173,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -3168,7 +3168,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -4163,7 +4163,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -5158,7 +5158,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -6153,7 +6153,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -7148,7 +7148,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 @@ -8143,7 +8143,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7172E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.6717E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 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 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 99a5a96c5a..320672d7ca 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -3604,7 +3604,7 @@ "powohres": 0.0, "powpfres": 0.0, "ppdivr": 0.0, - "pperim": 0.0, + "len_plasma_poloidal": 0.0, "ppump": 0.0, "ppumpmw": 0.0, "praddiv": 0.0, @@ -10360,7 +10360,7 @@ "powohres": "central solenoid resistive power during flattop (W)", "powpfres": "total PF coil resistive losses during flattop (W)", "ppdivr": "peak heat load at plate (with radiation) (MW/m2)", - "pperim": "plasma poloidal perimeter (m)", + "len_plasma_poloidal": "plasma poloidal perimeter (m)", "ppump": "centrepost coolant pump power (W)", "ppumpmw": "", "praddiv": "Radiation power incident on the divertor (MW)", @@ -19213,7 +19213,7 @@ "pden_plasma_ohmic_mw", "powerht", "fusion_power", - "pperim", + "len_plasma_poloidal", "pradmw", "pradpv", "pradsolmw", diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index bf20a8bbca..99f5ab17bc 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -324,7 +324,7 @@ Elongation,_area_ratio_calc.____________________________________________ (kappaa)______________________ 1.7188E+00 Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 - Plasma_poloidal_perimeter_(m)___________________________________________ (pperim)______________________ 2.4081E+01 + Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 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 diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index ba2cc9af35..d0e3f2c238 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -883,7 +883,7 @@ class PlasmaCurrentParam(NamedTuple): p0: Any = None - pperim: Any = None + len_plasma_poloidal: Any = None q0: Any = None @@ -928,7 +928,7 @@ class PlasmaCurrentParam(NamedTuple): kappa=1.8500000000000001, kappa95=1.6517857142857142, p0=0, - pperim=24.081367139525412, + len_plasma_poloidal=24.081367139525412, q0=1, q95=3.5, rmajor=8, @@ -956,7 +956,7 @@ class PlasmaCurrentParam(NamedTuple): kappa=1.8500000000000001, kappa95=1.6517857142857142, p0=626431.90482713911, - pperim=24.081367139525412, + len_plasma_poloidal=24.081367139525412, q0=1, q95=3.5, rmajor=8, @@ -1005,7 +1005,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): kappa=plasmacurrentparam.kappa, kappa95=plasmacurrentparam.kappa95, p0=plasmacurrentparam.p0, - pperim=plasmacurrentparam.pperim, + len_plasma_poloidal=plasmacurrentparam.len_plasma_poloidal, q0=plasmacurrentparam.q0, q95=plasmacurrentparam.q95, rmajor=plasmacurrentparam.rmajor, From 94b1cceb54a3e6ead79c06e5226a1676082ba466 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 14:01:42 +0000 Subject: [PATCH 08/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'sarea'=20to=20'a?= =?UTF-8?q?=5Fplasma=5Fsurface'=20for=20consistency=20in=20plasma=20surfac?= =?UTF-8?q?e=20area=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../physics-models/plasma_geometry.md | 4 +- .../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/dcll.py | 4 +- process/divertor.py | 6 +-- process/hcpb.py | 2 +- process/io/mfile_comparison.py | 4 +- process/io/plot_proc.py | 2 +- process/physics.py | 39 +++++++++++------- process/plasma_geometry.py | 12 +++--- process/stellarator.py | 30 +++++++------- process/vacuum.py | 6 +-- source/fortran/physics_variables.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 | 6 +-- tests/unit/data/large_tokamak_MFILE.DAT | 2 +- tests/unit/test_ccfe_hcpb.py | 8 ++-- tests/unit/test_dcll.py | 10 +++-- tests/unit/test_physics.py | 6 +-- tests/unit/test_stellarator.py | 40 +++++++++++-------- tests/unit/test_vacuum.py | 6 +-- tracking/tracking_data.py | 2 +- 32 files changed, 153 insertions(+), 126 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index af66216a7d..390b7263d4 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -328,7 +328,7 @@ Plasma geometry based on equations (36) in O. Sauter, Fusion Engineering and Des | Output Variable | Description | |----------|--------------------------------------| | `len_plasma_poloidal` | Plasma Poloidal perimeter length [$\text{m}$] | -| `sarea` | Plasma surface area [$\text{m}^2$] | +| `a_plasma_surface` | Plasma surface area [$\text{m}^2$] | | `xarea` | Plasma cross-sectional area [$\text{m}^2$] | | `plasma_volume` | Plasma volume [$\text{m}^3$] | @@ -355,7 +355,7 @@ $$ Surface area (named Ap in Sauter) $$ -\mathtt{sarea} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{len_plasma_poloidal} +\mathtt{a_plasma_surface} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{len_plasma_poloidal} $$ Cross-section area (named S_phi in Sauter) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index d810826f4c..f96213b8d4 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6699E+01 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 0a703fa777..53f4d02ed0 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -330,7 +330,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6631E+01 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 230367340f..accaf479c3 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -330,7 +330,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6631E+01 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 06e383e5c3..248bc5e028 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -330,7 +330,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6631E+01 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index cc6906f037..e5da37d33f 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -330,7 +330,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6631E+01 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 7bb31060bd..9ce0a19105 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -185,7 +185,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -1180,7 +1180,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -2175,7 +2175,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -3170,7 +3170,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -4165,7 +4165,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -5160,7 +5160,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -6155,7 +6155,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -7150,7 +7150,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -8145,7 +8145,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 diff --git a/process/dcll.py b/process/dcll.py index 7d2bf91df3..8a11a04303 100644 --- a/process/dcll.py +++ b/process/dcll.py @@ -668,7 +668,7 @@ def dcll_masses(self, output: bool): fwbs_variables.fwmass = dcll_module.fwmass_stl + dcll_module.fwmass_cool # First wall armour volume (m^3) fwbs_variables.fw_armour_vol = ( - physics_variables.sarea * fwbs_variables.fw_armour_thickness + physics_variables.a_plasma_surface * fwbs_variables.fw_armour_thickness ) # First wall armour mass (kg) fwbs_variables.fw_armour_mass = ( @@ -708,7 +708,7 @@ def dcll_masses(self, output: bool): ) + fwbs_variables.fw_armour_mass * ( - (physics_variables.sarea - physics_variables.sareao) + (physics_variables.a_plasma_surface - physics_variables.sareao) * fwbs_variables.fw_armour_thickness / fwbs_variables.fw_armour_vol ) diff --git a/process/divertor.py b/process/divertor.py index 63b311e46f..467fa438b9 100644 --- a/process/divertor.py +++ b/process/divertor.py @@ -103,16 +103,16 @@ def run(self, output: bool) -> None: rsrd = (rnull + pv.rmajor + pv.rminor) / (rnull + bv.rspo) diva = constants.pi * (rnull + bv.rspo) * plsep - adas = diva / pv.sarea + adas = diva / pv.a_plasma_surface # Main plasma separatrix area to divertor (and power fraction) # +PJK Is the 2 related to 2 divertors (i.e. double-null assumed)? - frgd = (pv.sareao) / (2.0e0 * pv.sarea) + frgd = (pv.sareao) / (2.0e0 * pv.a_plasma_surface) # -PJK # Power flow to divertor pdiv = pwr * dv.ksic / 2.0e0 - qdiv = pdiv / (pv.sarea * frgd) + qdiv = pdiv / (pv.a_plasma_surface * frgd) # Connection length scalings # (2.5 factor comes from normalization to ITER 1990) diff --git a/process/hcpb.py b/process/hcpb.py index 4360a5ebb5..943822f2cc 100644 --- a/process/hcpb.py +++ b/process/hcpb.py @@ -295,7 +295,7 @@ def component_masses(self): # First wall armour volume (m^3) fwbs_variables.fw_armour_vol = ( - physics_variables.sarea * fwbs_variables.fw_armour_thickness + physics_variables.a_plasma_surface * fwbs_variables.fw_armour_thickness ) # First wall armour mass (kg) diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index c6b32c32c4..bdccfc6897 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -51,7 +51,7 @@ "fimp(12", "fimp(13", "fimp(14", - "sarea", + "a_plasma_surface", "plasma_volume", "n_tf", "shldith", @@ -108,7 +108,7 @@ "kappa95", "triang", "triang95", - "sarea", + "a_plasma_surface", "plasma_volume", "n_tf", "fusion_power", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index c25cd9c4c5..758db64429 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2346,7 +2346,7 @@ def plot_geometry_info(axis, mfile_data, scan): ("aspect", "A", ""), ("kappa95", r"$\kappa_{95}$", ""), ("triang95", r"$\delta_{95}$", ""), - ("sarea", "Plasma surface area", "m$^2$"), + ("a_plasma_surface", "Plasma surface area", "m$^2$"), ("xarea", "Plasma cross-sectional area", "m$^2$"), ("plasma_volume", "Plasma volume", "m$^3$"), ("n_tf", "No. of TF coils", ""), diff --git a/process/physics.py b/process/physics.py index 2e3460fade..d24a5b6280 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2078,7 +2078,7 @@ def physics(self): physics_variables.wallmw = ( physics_variables.ffwal * physics_variables.neutron_power_total - / physics_variables.sarea + / physics_variables.a_plasma_surface ) else: if physics_variables.idivrt == 2: @@ -2151,7 +2151,7 @@ def physics(self): physics_variables.rmajor, physics_variables.rminor, physics_variables.kappa, - physics_variables.sarea, + physics_variables.a_plasma_surface, physics_variables.aion, physics_variables.aspect, physics_variables.plasma_current, @@ -2221,7 +2221,7 @@ def physics(self): physics_variables.q95, physics_variables.rmajor, physics_variables.rminor, - physics_variables.sarea, + physics_variables.a_plasma_surface, physics_variables.zeff, ) @@ -2378,7 +2378,7 @@ def physics(self): physics_variables.photon_wall = ( physics_variables.ffwal * physics_variables.pradmw - / physics_variables.sarea + / physics_variables.a_plasma_surface ) else: if physics_variables.idivrt == 2: @@ -2532,7 +2532,7 @@ def calculate_density_limit( q95: float, rmajor: float, rminor: float, - sarea: float, + a_plasma_surface: float, zeff: float, ) -> tuple[np.ndarray, float]: """ @@ -2549,7 +2549,7 @@ def calculate_density_limit( q95 (float): Safety factor at 95% surface. rmajor (float): Plasma major radius (m). rminor (float): Plasma minor radius (m). - sarea (float): Plasma surface area (m^2). + a_plasma_surface (float): Plasma surface area (m^2). zeff (float): Plasma effective charge. Returns: @@ -2582,7 +2582,7 @@ def calculate_density_limit( # Power per unit area crossing the plasma edge # (excludes radiation and neutrons) - p_perp = pdivt / sarea + p_perp = pdivt / a_plasma_surface # Old ASDEX density limit formula # This applies to the density at the plasma edge, so must be scaled @@ -3501,8 +3501,8 @@ def outplas(self): po.ovarre( self.outfile, "Plasma surface area (m2)", - "(sarea)", - physics_variables.sarea, + "(a_plasma_surface)", + physics_variables.a_plasma_surface, "OP ", ) po.ovarre( @@ -7439,7 +7439,18 @@ def res_diff_time(rmajor, res_plasma, kappa95): return 2 * constants.rmu0 * rmajor / (res_plasma * kappa95) -def pthresh(dene, dnla, bt, rmajor, rminor, kappa, sarea, aion, aspect, plasma_current): +def pthresh( + dene, + dnla, + bt, + rmajor, + rminor, + kappa, + a_plasma_surface, + aion, + aspect, + plasma_current, +): """L-mode to H-mode power threshold calculation Author: P J Knight, CCFE, Culham Science Centre @@ -7459,7 +7470,7 @@ def pthresh(dene, dnla, bt, rmajor, rminor, kappa, sarea, aion, aspect, plasma_c :param rmajor: plasma major radius (m) :param rminor: plasma minor radius (m) :param kappa: plasma elongation - :param sarea: plasma surface area (m2) + :param a_plasma_surface: plasma surface area (m2) :param aion: average mass of all ions (amu) :param aspect: aspect ratio :param plasma_current: plasma current (A) @@ -7489,13 +7500,13 @@ def pthresh(dene, dnla, bt, rmajor, rminor, kappa, sarea, aion, aspect, plasma_c # Martin et al (2008) for recent ITER scaling, with mass correction # and 95% confidence limits - martin = 0.0488 * dnla20**0.717 * bt**0.803 * sarea**0.941 * (2.0 / aion) + martin = 0.0488 * dnla20**0.717 * bt**0.803 * a_plasma_surface**0.941 * (2.0 / aion) martin_error = ( np.sqrt( 0.057**2 + (0.035 * np.log(dnla20)) ** 2 + (0.032 * np.log(bt)) ** 2 - + (0.019 * np.log(sarea)) ** 2 + + (0.019 * np.log(a_plasma_surface)) ** 2 ) * martin ) @@ -7525,7 +7536,7 @@ def pthresh(dene, dnla, bt, rmajor, rminor, kappa, sarea, aion, aspect, plasma_c hubbard_2012_ub = 2.11 * (plasma_current / 1e6) ** 1.18 * dnla20**0.83 # Hubbard et al. 2017 L-I threshold scaling - hubbard_2017 = 0.162 * dnla20 * sarea * (bt) ** 0.26 + hubbard_2017 = 0.162 * dnla20 * a_plasma_surface * (bt) ** 0.26 pthrmw = [ iterdd, diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index ee42e0bcc7..26dace8ca6 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -265,7 +265,7 @@ def plasma_geometry(self) -> None: ( physics_variables.len_plasma_poloidal, physics_variables.sf, - physics_variables.sarea, + physics_variables.a_plasma_surface, physics_variables.xarea, physics_variables.plasma_volume, ) = self.sauter_geometry( @@ -296,7 +296,7 @@ def plasma_geometry(self) -> None: physics_variables.xarea = self.xsecta(xi, thetai, xo, thetao) # Surface area - sum of inboard and outboard. - physics_variables.sarea = xsi + xso + physics_variables.a_plasma_surface = xsi + xso # ====================================================================== @@ -484,7 +484,7 @@ def sauter_geometry( tuple: A tuple containing: - len_plasma_poloidal (float): Poloidal perimeter - sf (float): Geometric factor - - sarea (float): Surface area + - a_plasma_surface (float): Surface area - xarea (float): Cross-section area - plasma_volume (float): Plasma volume @@ -517,7 +517,9 @@ def sauter_geometry( sf = len_plasma_poloidal / (2.0e0 * np.pi * a) # Surface area (named Ap in Sauter) - sarea = 2.0e0 * np.pi * r0 * (1 - 0.32 * triang * eps) * len_plasma_poloidal + a_plasma_surface = ( + 2.0e0 * np.pi * r0 * (1 - 0.32 * triang * eps) * len_plasma_poloidal + ) # Cross-section area (named S_phi in Sauter) xarea = np.pi * a**2 * kappa * (1 + 0.52 * (w07 - 1)) @@ -525,7 +527,7 @@ def sauter_geometry( # Volume plasma_volume = 2.0e0 * np.pi * r0 * (1 - 0.25 * triang * eps) * xarea - return len_plasma_poloidal, sf, sarea, xarea, plasma_volume + return len_plasma_poloidal, sf, a_plasma_surface, xarea, plasma_volume # -------------------------------- diff --git a/process/stellarator.py b/process/stellarator.py index a189d2df56..e9c07e3b4b 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -329,7 +329,7 @@ def stgeom(self): ) # Plasma surface scaled from effective parameter: - physics_variables.sarea = ( + physics_variables.a_plasma_surface = ( st.f_r * st.f_a * stellarator_configuration.stella_config_plasma_surface ) @@ -342,7 +342,7 @@ def stgeom(self): # Cross-sectional area, averaged over toroidal angle physics_variables.sareao = ( - 0.5e0 * physics_variables.sarea + 0.5e0 * physics_variables.a_plasma_surface ) # Used only in the divertor model; approximate as for tokamaks def stopt(self, output: bool): @@ -533,7 +533,7 @@ def stbild(self, output: bool): build_variables.scrapli + build_variables.scraplo ) build_variables.fwarea = ( - physics_variables.sarea * awall / physics_variables.rminor + physics_variables.a_plasma_surface * awall / physics_variables.rminor ) if heat_transport_variables.ipowerflow == 0: @@ -1165,14 +1165,14 @@ def stfwbs(self, output: bool): ) if heat_transport_variables.ipowerflow == 0: build_variables.blarea = ( - physics_variables.sarea + physics_variables.a_plasma_surface * r1 / physics_variables.rminor * (1.0e0 - fwbs_variables.fhole) ) else: build_variables.blarea = ( - physics_variables.sarea + physics_variables.a_plasma_surface * r1 / physics_variables.rminor * ( @@ -1194,7 +1194,9 @@ def stfwbs(self, output: bool): # Uses fvolsi, fwbs_variables.fvolso as area coverage factors r1 = r1 + 0.5e0 * (build_variables.blnkith + build_variables.blnkoth) - build_variables.sharea = physics_variables.sarea * r1 / physics_variables.rminor + build_variables.sharea = ( + physics_variables.a_plasma_surface * r1 / physics_variables.rminor + ) build_variables.shareaib = ( 0.5e0 * build_variables.sharea * fwbs_variables.fvolsi ) @@ -1860,7 +1862,7 @@ def stfwbs(self, output: bool): fwbs_variables.vdewin = ( (build_variables.d_vv_in + build_variables.d_vv_out) / 2.0e0 - * physics_variables.sarea + * physics_variables.a_plasma_surface * r1 / physics_variables.rminor * fwbs_variables.fvoldw @@ -4256,7 +4258,7 @@ def stphys(self, output): physics_variables.wallmw = ( physics_variables.ffwal * physics_variables.neutron_power_total - / physics_variables.sarea + / physics_variables.a_plasma_surface ) else: if heat_transport_variables.ipowerflow == 0: @@ -4361,7 +4363,7 @@ def stphys(self, output): physics_variables.photon_wall = ( physics_variables.ffwal * physics_variables.pradmw - / physics_variables.sarea + / physics_variables.a_plasma_surface ) else: if heat_transport_variables.ipowerflow == 0: @@ -4683,7 +4685,7 @@ def calc_neoclassics(self): - physics_variables.pcoreradpv ) * physics_variables.plasma_volume - / physics_variables.sarea + / physics_variables.a_plasma_surface * impurity_radiation_module.coreradius ) q_PROCESS_r1 = ( @@ -4693,7 +4695,7 @@ def calc_neoclassics(self): - physics_variables.pcoreradpv ) * physics_variables.plasma_volume - / physics_variables.sarea + / physics_variables.a_plasma_surface ) q_neo = sum(neoclassics_module.q_flux * 1e-6) @@ -4742,7 +4744,7 @@ def calc_neoclassics(self): dndt_neo_fuel = ( (dndt_neo_D + dndt_neo_T) - * physics_variables.sarea + * physics_variables.a_plasma_surface * impurity_radiation_module.coreradius ) dmdt_neo_fuel = ( @@ -4751,7 +4753,7 @@ def calc_neoclassics(self): dmdt_neo_fuel_from_e = ( 4 * dndt_neo_e - * physics_variables.sarea + * physics_variables.a_plasma_surface * impurity_radiation_module.coreradius * physics_variables.afuel * constants.proton_mass @@ -4815,7 +4817,7 @@ def st_calc_eff_chi(self): ** 2 ) surfacescaling = ( - physics_variables.sarea + physics_variables.a_plasma_surface * st.f_r * ( impurity_radiation_module.coreradius diff --git a/process/vacuum.py b/process/vacuum.py index 01678fd92c..ac1cb6f262 100644 --- a/process/vacuum.py +++ b/process/vacuum.py @@ -56,7 +56,7 @@ def run(self, output: bool) -> None: pv.rmajor, pv.rminor, 0.5e0 * (buv.scrapli + buv.scraplo), - pv.sarea, + pv.a_plasma_surface, pv.plasma_volume, buv.shldoth, buv.shldith, @@ -103,11 +103,11 @@ def vacuum_simple(self, output) -> float: vacv.pumpspeedmax * vacv.pumpareafraction * vacv.pumpspeedfactor - * pv.sarea + * pv.a_plasma_surface / tfv.n_tf ) - wallarea = (pv.sarea / 1084.0e0) * 2000.0e0 + wallarea = (pv.a_plasma_surface / 1084.0e0) * 2000.0e0 # Required pumping speed for pump-down pumpdownspeed = ( vacv.outgasfactor * wallarea / vacv.pbase diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 1cee7f3f18..08df686b06 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -842,7 +842,7 @@ module physics_variables real(dp) :: res_time !! plasma current resistive diffusion time (s) - real(dp) :: sarea + real(dp) :: a_plasma_surface !! plasma surface area real(dp) :: sareao @@ -1134,7 +1134,7 @@ subroutine init_physics_variables rpfac = 0.0D0 res_plasma = 0.0D0 res_time = 0.0D0 - sarea = 0.0D0 + a_plasma_surface = 0.0D0 sareao = 0.0D0 sf = 0.0D0 i_single_null = 1 diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 507672f4d5..7f1af6db4a 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6631E+01 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 0c0cd27d14..4317e1bf1a 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -330,7 +330,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6631E+01 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index fc5d5abc96..68a34900e0 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -330,7 +330,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6631E+01 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index ca12de1feb..45fbbf1b9b 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -330,7 +330,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6631E+01 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index e5bcd496c3..2e0006bb68 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -326,7 +326,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6521E+01 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 0fb3933235..0ced3884a7 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -331,7 +331,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6569E+01 @@ -1494,7 +1494,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6633E+01 @@ -2657,7 +2657,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6683E+01 @@ -3820,7 +3820,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6609E+01 @@ -4983,7 +4983,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6604E+01 @@ -6146,7 +6146,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6548E+01 @@ -7309,7 +7309,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6479E+01 @@ -8472,7 +8472,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6497E+01 @@ -9635,7 +9635,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6468E+01 @@ -10798,7 +10798,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6447E+01 @@ -11961,7 +11961,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6498E+01 @@ -13124,7 +13124,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6485E+01 @@ -14287,7 +14287,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6455E+01 @@ -15450,7 +15450,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6516E+01 @@ -16613,7 +16613,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6581E+01 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 832858cdfa..0cfc10fa4e 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -185,7 +185,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -1180,7 +1180,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -2175,7 +2175,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -3170,7 +3170,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -4165,7 +4165,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -5160,7 +5160,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -6155,7 +6155,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -7150,7 +7150,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 @@ -8145,7 +8145,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.4956E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.8078E+01 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 320672d7ca..46ddd787f3 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -4901,7 +4901,7 @@ "'not used'" ], "s_tresca_oh": 0.0, - "sarea": 0.0, + "a_plasma_surface": 0.0, "sareao": 0.0, "scafc": [ 0.0, @@ -10595,7 +10595,7 @@ "s_kref": "", "s_label": "", "s_tresca_oh": "Maximum shear stress (Tresca criterion) coils/central solenoid [MPa]", - "sarea": "plasma surface area", + "a_plasma_surface": "plasma surface area", "sareao": "outboard plasma surface area", "scafc": "", "scale": "", @@ -19251,7 +19251,7 @@ "rpfac", "res_plasma", "res_time", - "sarea", + "a_plasma_surface", "sareao", "sf", "i_single_null", diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 99f5ab17bc..8680daeabc 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -326,7 +326,7 @@ Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 - Plasma_surface_area_(m2)________________________________________________ (sarea)_______________________ 1.1738E+03 OP + Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 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_MA)_________________ 1.6521E+01 diff --git a/tests/unit/test_ccfe_hcpb.py b/tests/unit/test_ccfe_hcpb.py index 1986077b06..e396918426 100644 --- a/tests/unit/test_ccfe_hcpb.py +++ b/tests/unit/test_ccfe_hcpb.py @@ -1369,7 +1369,7 @@ class ComponentMassesParam(NamedTuple): rminor: Any = None rmajor: Any = None idivrt: Any = None - sarea: Any = None + a_plasma_surface: Any = None blnkith: Any = None blbuith: Any = None blbmith: Any = None @@ -1461,7 +1461,7 @@ class ComponentMassesParam(NamedTuple): rminor=2.6666666666666665, rmajor=8, idivrt=1, - sarea=1173.8427771245592, + a_plasma_surface=1173.8427771245592, blnkith=0.70000000000000007, blbuith=0.36499999999999999, blbmith=0.17000000000000001, @@ -1562,7 +1562,9 @@ def test_component_masses(componentmassesparam, monkeypatch, ccfe_hcpb): monkeypatch.setattr(physics_variables, "rminor", componentmassesparam.rminor) monkeypatch.setattr(physics_variables, "rmajor", componentmassesparam.rmajor) monkeypatch.setattr(physics_variables, "idivrt", componentmassesparam.idivrt) - monkeypatch.setattr(physics_variables, "sarea", componentmassesparam.sarea) + monkeypatch.setattr( + physics_variables, "a_plasma_surface", componentmassesparam.a_plasma_surface + ) monkeypatch.setattr(build_variables, "blnkith", componentmassesparam.blnkith) monkeypatch.setattr(build_variables, "blbuith", componentmassesparam.blbuith) monkeypatch.setattr(build_variables, "blbmith", componentmassesparam.blbmith) diff --git a/tests/unit/test_dcll.py b/tests/unit/test_dcll.py index f363bd1c81..03dcebc028 100644 --- a/tests/unit/test_dcll.py +++ b/tests/unit/test_dcll.py @@ -292,7 +292,7 @@ class DcllMassesParam(NamedTuple): blbmoth: Any = None - sarea: Any = None + a_plasma_surface: Any = None sareao: Any = None @@ -523,7 +523,7 @@ class DcllMassesParam(NamedTuple): blnkoth=0.98199999999999998, blbuoth=0.46500000000000002, blbmoth=0.27000000000000002, - sarea=1403.2719775669307, + a_plasma_surface=1403.2719775669307, sareao=949.22962703393853, iblnkith=1, volblkt=1397.9003011502937, @@ -643,7 +643,7 @@ class DcllMassesParam(NamedTuple): blnkoth=0.98199999999999998, blbuoth=0.46500000000000002, blbmoth=0.49699999999999994, - sarea=1403.2719775669307, + a_plasma_surface=1403.2719775669307, sareao=949.22962703393853, iblnkith=1, volblkt=1400.4860764869636, @@ -787,7 +787,9 @@ def test_dcll_masses(dcllmassesparam, monkeypatch, dcll): monkeypatch.setattr(build_variables, "blbmoth", dcllmassesparam.blbmoth) - monkeypatch.setattr(physics_variables, "sarea", dcllmassesparam.sarea) + monkeypatch.setattr( + physics_variables, "a_plasma_surface", dcllmassesparam.a_plasma_surface + ) monkeypatch.setattr(physics_variables, "sareao", dcllmassesparam.sareao) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index d0e3f2c238..dd050da216 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -2066,7 +2066,7 @@ class CalculateDensityLimitParam(NamedTuple): rminor: Any = None - sarea: Any = None + a_plasma_surface: Any = None zeff: Any = None @@ -2089,7 +2089,7 @@ class CalculateDensityLimitParam(NamedTuple): qcyl=3.8769445264202052, rmajor=8, rminor=2.6666666666666665, - sarea=1173.8427771245592, + a_plasma_surface=1173.8427771245592, zeff=2.5668755115791471, expected_dnelimt=7.4765470107450917e19, expected_dlimit=( @@ -2129,7 +2129,7 @@ def test_calculate_density_limit(calculatedensitylimitparam, physics): qcyl=calculatedensitylimitparam.qcyl, rmajor=calculatedensitylimitparam.rmajor, rminor=calculatedensitylimitparam.rminor, - sarea=calculatedensitylimitparam.sarea, + a_plasma_surface=calculatedensitylimitparam.a_plasma_surface, zeff=calculatedensitylimitparam.zeff, ) diff --git a/tests/unit/test_stellarator.py b/tests/unit/test_stellarator.py index e9ec039622..2cb0fd418a 100644 --- a/tests/unit/test_stellarator.py +++ b/tests/unit/test_stellarator.py @@ -57,7 +57,7 @@ class StgeomParam(NamedTuple): rminor: Any = None - sarea: Any = None + a_plasma_surface: Any = None sareao: Any = None @@ -75,7 +75,7 @@ class StgeomParam(NamedTuple): f_a: Any = None - expected_sarea: Any = None + expected_a_plasma_surface: Any = None expected_sareao: Any = None @@ -91,7 +91,7 @@ class StgeomParam(NamedTuple): aspect=12.33, rmajor=22, rminor=1.7842660178426601, - sarea=0, + a_plasma_surface=0, sareao=0, plasma_volume=0, xarea=0, @@ -100,7 +100,7 @@ class StgeomParam(NamedTuple): stella_config_plasma_surface=1960, f_r=0.99099099099099097, f_a=0.99125889880147788, - expected_sarea=1925.3641313657533, + expected_a_plasma_surface=1925.3641313657533, expected_sareao=962.68206568287667, expected_vol=1385.2745877380669, expected_xarea=10.001590778710231, @@ -109,7 +109,7 @@ class StgeomParam(NamedTuple): aspect=12.33, rmajor=22, rminor=1.7842660178426601, - sarea=1925.3641313657533, + a_plasma_surface=1925.3641313657533, sareao=962.68206568287667, plasma_volume=1385.2745877380669, xarea=10.001590778710231, @@ -118,7 +118,7 @@ class StgeomParam(NamedTuple): stella_config_plasma_surface=1960, f_r=0.99099099099099097, f_a=0.99125889880147788, - expected_sarea=1925.3641313657533, + expected_a_plasma_surface=1925.3641313657533, expected_sareao=962.68206568287667, expected_vol=1385.2745877380669, expected_xarea=10.001590778710231, @@ -144,7 +144,9 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): monkeypatch.setattr(physics_variables, "rminor", stgeomparam.rminor) - monkeypatch.setattr(physics_variables, "sarea", stgeomparam.sarea) + monkeypatch.setattr( + physics_variables, "a_plasma_surface", stgeomparam.a_plasma_surface + ) monkeypatch.setattr(physics_variables, "sareao", stgeomparam.sareao) @@ -172,7 +174,9 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): stellarator.stgeom() - assert physics_variables.sarea == pytest.approx(stgeomparam.expected_sarea) + assert physics_variables.a_plasma_surface == pytest.approx( + stgeomparam.expected_sarea + ) assert physics_variables.sareao == pytest.approx(stgeomparam.expected_sareao) @@ -272,7 +276,7 @@ class StbildParam(NamedTuple): rminor: Any = None - sarea: Any = None + a_plasma_surface: Any = None stella_config_derivative_min_lcfs_coils_dist: Any = None @@ -368,7 +372,7 @@ class StbildParam(NamedTuple): ipowerflow=1, rmajor=22, rminor=1.7842660178426601, - sarea=1925.3641313657533, + a_plasma_surface=1925.3641313657533, stella_config_derivative_min_lcfs_coils_dist=-1, stella_config_rminor_ref=1.8, stella_config_min_plasma_coil_distance=1.8999999999999999, @@ -438,7 +442,7 @@ class StbildParam(NamedTuple): ipowerflow=1, rmajor=22, rminor=1.7842660178426601, - sarea=1925.3641313657533, + a_plasma_surface=1925.3641313657533, stella_config_derivative_min_lcfs_coils_dist=-1, stella_config_rminor_ref=1.8, stella_config_min_plasma_coil_distance=1.8999999999999999, @@ -573,7 +577,9 @@ def test_stbild(stbildparam, monkeypatch, stellarator): monkeypatch.setattr(physics_variables, "rminor", stbildparam.rminor) - monkeypatch.setattr(physics_variables, "sarea", stbildparam.sarea) + monkeypatch.setattr( + physics_variables, "a_plasma_surface", stbildparam.a_plasma_surface + ) monkeypatch.setattr( stellarator_configuration, @@ -2672,7 +2678,7 @@ class StCalcEffChiParam(NamedTuple): plasma_volume: Any = None - sarea: Any = None + a_plasma_surface: Any = None rminor: Any = None @@ -2697,7 +2703,7 @@ class StCalcEffChiParam(NamedTuple): alphan=0.35000000000000003, alphat=1.2, plasma_volume=1385.8142655379029, - sarea=1926.0551116585129, + a_plasma_surface=1926.0551116585129, rminor=1.7863900994187722, coreradius=0.60000000000000009, stella_config_rminor_ref=1.80206932, @@ -2714,7 +2720,7 @@ class StCalcEffChiParam(NamedTuple): alphan=0.35000000000000003, alphat=1.2, plasma_volume=1385.8142655379029, - sarea=1926.0551116585129, + a_plasma_surface=1926.0551116585129, rminor=1.7863900994187722, coreradius=0.60000000000000009, stella_config_rminor_ref=1.80206932, @@ -2761,7 +2767,9 @@ def test_st_calc_eff_chi(stcalceffchiparam, monkeypatch, stellarator): physics_variables, "plasma_volume", stcalceffchiparam.plasma_volume ) - monkeypatch.setattr(physics_variables, "sarea", stcalceffchiparam.sarea) + monkeypatch.setattr( + physics_variables, "a_plasma_surface", stcalceffchiparam.a_plasma_surface + ) monkeypatch.setattr(physics_variables, "rminor", stcalceffchiparam.rminor) diff --git a/tests/unit/test_vacuum.py b/tests/unit/test_vacuum.py index 85ed4475aa..cc07394bac 100644 --- a/tests/unit/test_vacuum.py +++ b/tests/unit/test_vacuum.py @@ -30,7 +30,7 @@ def test_simple_model(self, monkeypatch, vacuum): :type tfcoil: tests.unit.test_tfcoil.tfcoil (functional fixture) """ monkeypatch.setattr(pv, "qfuel", 7.5745668997694112e22) - monkeypatch.setattr(pv, "sarea", 1500.3146527709359) + monkeypatch.setattr(pv, "a_plasma_surface", 1500.3146527709359) monkeypatch.setattr(tfv, "n_tf", 18) monkeypatch.setattr(tv, "t_between_pulse", 500) monkeypatch.setattr(vacv, "outgasfactor", 0.0235) @@ -65,7 +65,7 @@ def test_old_model(self, monkeypatch, vacuum): r0 = 8.1386000000000003 aw = 3.2664151549205331 dsol = 0.22500000000000003 - plasma_sarea = 1468.3151179059994 + plasma_a_plasma_surface = 1468.3151179059994 plasma_vol = 2907.2299918381777 thshldo = 0.40000000000000002 thshldi = 0.12000000000000001 @@ -87,7 +87,7 @@ def test_old_model(self, monkeypatch, vacuum): r0, aw, dsol, - plasma_sarea, + plasma_a_plasma_surface, plasma_vol, thshldo, thshldi, diff --git a/tracking/tracking_data.py b/tracking/tracking_data.py index 8ba50b5199..de8b9e3c33 100644 --- a/tracking/tracking_data.py +++ b/tracking/tracking_data.py @@ -145,7 +145,7 @@ class ProcessTracker: "pdivt", "nesep", "plasma_volume", - "sarea", + "a_plasma_surface", "pnetelmw", "etath", "pgrossmw", From 49259b4d7f3301adf3a157246a086badec927dd2 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 14:04:55 +0000 Subject: [PATCH 09/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'xarea'=20to=20'a?= =?UTF-8?q?=5Fplasma=5Fpoloidal'=20for=20consistency=20in=20plasma=20cross?= =?UTF-8?q?-sectional=20area=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../physics-models/plasma_geometry.md | 6 +-- .../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/plot_proc.py | 6 +-- process/physics.py | 18 ++++---- process/plasma_geometry.py | 20 +++++--- process/plasma_profiles.py | 2 +- process/stellarator.py | 6 +-- source/fortran/physics_variables.f90 | 8 ++-- .../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/unit/data/large_tokamak_MFILE.DAT | 2 +- tests/unit/test_physics.py | 46 ++++++++++--------- tests/unit/test_stellarator.py | 20 ++++---- 24 files changed, 122 insertions(+), 106 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 390b7263d4..54a62ee864 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -329,7 +329,7 @@ Plasma geometry based on equations (36) in O. Sauter, Fusion Engineering and Des |----------|--------------------------------------| | `len_plasma_poloidal` | Plasma Poloidal perimeter length [$\text{m}$] | | `a_plasma_surface` | Plasma surface area [$\text{m}^2$] | -| `xarea` | Plasma cross-sectional area [$\text{m}^2$] | +| `a_plasma_poloidal` | Plasma cross-sectional area [$\text{m}^2$] | | `plasma_volume` | Plasma volume [$\text{m}^3$] | $$ @@ -360,12 +360,12 @@ $$ Cross-section area (named S_phi in Sauter) $$ -\mathtt{xarea} = \pi a^2 \kappa (1 + 0.52 (\mathtt{w07} - 1)) +\mathtt{a_plasma_poloidal} = \pi a^2 \kappa (1 + 0.52 (\mathtt{w07} - 1)) $$ Volume $$ -\mathtt{plasma_volume} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{xarea} +\mathtt{plasma_volume} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{a_plasma_poloidal} $$ diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index f96213b8d4..acef9761a1 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -328,7 +328,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 53f4d02ed0..3201ef5940 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index accaf479c3..44eed1adb8 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 248bc5e028..5d2441dff3 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index e5da37d33f..459f9e3105 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 9ce0a19105..b88c7ec8af 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -184,7 +184,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -1179,7 +1179,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -2174,7 +2174,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -3169,7 +3169,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -4164,7 +4164,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -5159,7 +5159,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -6154,7 +6154,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -7149,7 +7149,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -8144,7 +8144,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 758db64429..c3aad32efe 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2347,7 +2347,7 @@ def plot_geometry_info(axis, mfile_data, scan): ("kappa95", r"$\kappa_{95}$", ""), ("triang95", r"$\delta_{95}$", ""), ("a_plasma_surface", "Plasma surface area", "m$^2$"), - ("xarea", "Plasma cross-sectional area", "m$^2$"), + ("a_plasma_poloidal", "Plasma cross-sectional area", "m$^2$"), ("plasma_volume", "Plasma volume", "m$^3$"), ("n_tf", "No. of TF coils", ""), (in_blanket_thk, "Inboard blanket+shield", "m"), @@ -3486,14 +3486,14 @@ def main(args=None): global q0 global q95 global plasma_current_MA - global xarea + global a_plasma_poloidal triang = m_file.data["triang95"].get_scan(scan) alphaj = m_file.data["alphaj"].get_scan(scan) q0 = m_file.data["q0"].get_scan(scan) q95 = m_file.data["q95"].get_scan(scan) plasma_current_MA = m_file.data["plasma_current_ma"].get_scan(scan) - xarea = m_file.data["xarea"].get_scan(scan) + a_plasma_poloidal = m_file.data["a_plasma_poloidal"].get_scan(scan) # Radial position -- 0 # Electron density -- 1 diff --git a/process/physics.py b/process/physics.py index d24a5b6280..32c380446c 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2262,7 +2262,7 @@ def physics(self): physics_variables.q95, physics_variables.qstar, physics_variables.plasma_volume, - physics_variables.xarea, + physics_variables.a_plasma_poloidal, physics_variables.zeff, ) @@ -3494,8 +3494,8 @@ def outplas(self): po.ovarre( self.outfile, "Plasma cross-sectional area (m2)", - "(xarea)", - physics_variables.xarea, + "(a_plasma_poloidal)", + physics_variables.a_plasma_poloidal, "OP ", ) po.ovarre( @@ -5629,7 +5629,7 @@ def igmarcal(self): physics_variables.q, physics_variables.qstar, physics_variables.plasma_volume, - physics_variables.xarea, + physics_variables.a_plasma_poloidal, physics_variables.zeff, ) @@ -5920,7 +5920,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: roa = plasma_profile.neprofile.profile_x # Local circularised minor radius - rho = np.sqrt(physics_variables.xarea / np.pi) * roa + rho = np.sqrt(physics_variables.a_plasma_poloidal / np.pi) * roa # Square root of local aspect ratio sqeps = np.sqrt(roa * (physics_variables.rminor / physics_variables.rmajor)) @@ -6421,7 +6421,7 @@ def fhz(self, hhh): physics_variables.q, physics_variables.qstar, physics_variables.plasma_volume, - physics_variables.xarea, + physics_variables.a_plasma_poloidal, physics_variables.zeff, ) @@ -6479,7 +6479,7 @@ def pcond( q, qstar, plasma_volume, - xarea, + a_plasma_poloidal, zeff, ): """Routine to calculate the confinement times and @@ -6513,7 +6513,7 @@ def pcond( ten : input real : density weighted average electron temp. (keV) tin : input real : density weighted average ion temperature (keV) plasma_volume : input real : plasma volume (m3) - xarea : input real : plasma cross-sectional area (m2) + a_plasma_poloidal : input real : plasma cross-sectional area (m2) zeff : input real : plasma effective charge ptrepv : output real : electron transport power (MW/m3) ptripv : output real : ion transport power (MW/m3) @@ -6588,7 +6588,7 @@ def pcond( pcur = plasma_current / 1.0e6 # Separatrix kappa defined with X-section for general use - kappaa = xarea / (np.pi * rminor * rminor) + kappaa = a_plasma_poloidal / (np.pi * rminor * rminor) # Separatrix kappa defined with plasma volume for IPB scalings physics_variables.kappaa_ipb = plasma_volume / ( diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 26dace8ca6..5fcf0d8014 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -266,7 +266,7 @@ def plasma_geometry(self) -> None: physics_variables.len_plasma_poloidal, physics_variables.sf, physics_variables.a_plasma_surface, - physics_variables.xarea, + physics_variables.a_plasma_poloidal, physics_variables.plasma_volume, ) = self.sauter_geometry( physics_variables.rminor, @@ -293,7 +293,7 @@ def plasma_geometry(self) -> None: ) # Cross-sectional area - physics_variables.xarea = self.xsecta(xi, thetai, xo, thetao) + physics_variables.a_plasma_poloidal = self.xsecta(xi, thetai, xo, thetao) # Surface area - sum of inboard and outboard. physics_variables.a_plasma_surface = xsi + xso @@ -485,7 +485,7 @@ def sauter_geometry( - len_plasma_poloidal (float): Poloidal perimeter - sf (float): Geometric factor - a_plasma_surface (float): Surface area - - xarea (float): Cross-section area + - a_plasma_poloidal (float): Cross-section area - plasma_volume (float): Plasma volume Notes: @@ -522,12 +522,20 @@ def sauter_geometry( ) # Cross-section area (named S_phi in Sauter) - xarea = np.pi * a**2 * kappa * (1 + 0.52 * (w07 - 1)) + a_plasma_poloidal = np.pi * a**2 * kappa * (1 + 0.52 * (w07 - 1)) # Volume - plasma_volume = 2.0e0 * np.pi * r0 * (1 - 0.25 * triang * eps) * xarea + plasma_volume = ( + 2.0e0 * np.pi * r0 * (1 - 0.25 * triang * eps) * a_plasma_poloidal + ) - return len_plasma_poloidal, sf, a_plasma_surface, xarea, plasma_volume + return ( + len_plasma_poloidal, + sf, + a_plasma_surface, + a_plasma_poloidal, + plasma_volume, + ) # -------------------------------- diff --git a/process/plasma_profiles.py b/process/plasma_profiles.py index f97d8eb0f2..34ae3e3cdd 100644 --- a/process/plasma_profiles.py +++ b/process/plasma_profiles.py @@ -278,7 +278,7 @@ def calculate_profile_factors(self) -> None: * 2 / ( sp.special.beta(0.5, physics_variables.alphaj + 1) - * physics_variables.xarea + * physics_variables.a_plasma_poloidal ) ) diff --git a/process/stellarator.py b/process/stellarator.py index e9c07e3b4b..dd6bcbd88a 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -247,7 +247,7 @@ def stigma(self): physics_variables.q, physics_variables.qstar, physics_variables.plasma_volume, - physics_variables.xarea, + physics_variables.a_plasma_poloidal, physics_variables.zeff, ) @@ -334,7 +334,7 @@ def stgeom(self): ) # Plasma cross section area. Approximated - physics_variables.xarea = ( + physics_variables.a_plasma_poloidal = ( np.pi * physics_variables.rminor * physics_variables.rminor ) # average, could be calculated for every toroidal angle if desired @@ -4434,7 +4434,7 @@ def stphys(self, output): stellarator_variables.iotabar, physics_variables.qstar, physics_variables.plasma_volume, - physics_variables.xarea, + physics_variables.a_plasma_poloidal, physics_variables.zeff, ) diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 08df686b06..cfd82c913b 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -570,7 +570,7 @@ module physics_variables !! plasma elongation at 95% surface (calculated if `ishape = 0-3, 6, or 8-10`) real(dp) :: kappaa - !! plasma elongation calculated as xarea/(pi.a^2) + !! plasma elongation calculated as a_plasma_poloidal/(pi.a^2) real(dp) :: kappaa_IPB !! Volume measure of plasma elongation @@ -926,8 +926,8 @@ module physics_variables real(dp) :: wtgpd !! mass of fuel used per day (g) - real(dp) :: xarea - !! plasma cross-sectional area (m2) + real(dp) :: a_plasma_poloidal + !! plasma poloidal cross-sectional area [m^2] real(dp) :: zeff !! plasma effective charge @@ -1161,7 +1161,7 @@ subroutine init_physics_variables vsstt = 0.0D0 wallmw = 0.0D0 wtgpd = 0.0D0 - xarea = 0.0D0 + a_plasma_poloidal = 0.0D0 zeff = 0.0D0 zeffai = 0.0D0 end subroutine init_physics_variables diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 7f1af6db4a..5e42e9952b 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -328,7 +328,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 4317e1bf1a..296cf30e8c 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 68a34900e0..11a8d4966a 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 45fbbf1b9b..95e68a29c8 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -329,7 +329,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 2e0006bb68..3919d2f756 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -325,7 +325,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 0ced3884a7..4d3f34b84c 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -330,7 +330,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -1493,7 +1493,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -2656,7 +2656,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -3819,7 +3819,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -4982,7 +4982,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -6145,7 +6145,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -7308,7 +7308,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -8471,7 +8471,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -9634,7 +9634,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -10797,7 +10797,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -11960,7 +11960,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -13123,7 +13123,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -14286,7 +14286,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -15449,7 +15449,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -16612,7 +16612,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 0cfc10fa4e..ad0794d941 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -184,7 +184,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -1179,7 +1179,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -2174,7 +2174,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -3169,7 +3169,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -4164,7 +4164,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -5159,7 +5159,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -6154,7 +6154,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -7149,7 +7149,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 @@ -8144,7 +8144,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.6717E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 4.7287E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 4.7287E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.4956E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 2.6696E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 46ddd787f3..8a2fba71d7 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -8131,7 +8131,7 @@ 0.0, 0.0 ], - "xarea": 0.0, + "a_plasma_poloidal": 0.0, "xcm": [ 0.0, 0.0, @@ -9954,7 +9954,7 @@ "kappa": "plasma separatrix elongation (calculated if `ishape = 1-5, 7 or 9-10`)", "kappa0": "", "kappa95": "plasma elongation at 95% surface (calculated if `ishape = 0-3, 6, or 8-10`)", - "kappaa": "plasma elongation calculated as xarea/(pi.a^2)", + "kappaa": "plasma elongation calculated as a_plasma_poloidal/(pi.a^2)", "kappaa_IPB": "Volume measure of plasma elongation", "keV_": "", "kh2o": "thermal conductivity of water (W/m/K)", @@ -11214,7 +11214,7 @@ "x_shield": "Shield exponent (tonne/m2)", "xa": "", "xarc": "x location of arc point i on surface (m)", - "xarea": "plasma cross-sectional area (m2)", + "a_plasma_poloidal": "plasma cross-sectional area (m2)", "xcm": "", "xcs": "", "xctfc": "x location of arc centre i (m)", @@ -19278,7 +19278,7 @@ "vsstt", "wallmw", "wtgpd", - "xarea", + "a_plasma_poloidal", "zeff", "zeffai" ], diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 8680daeabc..b4c0187b25 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -325,7 +325,7 @@ Triangularity,_X-point_(input_value_used)_______________________________ (triang)______________________ 5.0000E-01 Triangularity,_95%_surface_(calculated_from_triang)_____________________ (triang95)____________________ 3.3333E-01 Plasma_poloidal_perimeter_(m)___________________________________________ (len_plasma_poloidal)______________________ 2.4081E+01 - Plasma_cross-sectional_area_(m2)________________________________________ (xarea)_______________________ 3.8398E+01 + Plasma_cross-sectional_area_(m2)________________________________________ (a_plasma_poloidal)_______________________ 3.8398E+01 Plasma_surface_area_(m2)________________________________________________ (a_plasma_surface)_______________________ 1.1738E+03 OP Plasma_volume_(m3)______________________________________________________ (vol)_________________________ 1.8882E+03 OP Plasma_current_scaling_law_used_________________________________________ (i_plasma_current)_______________________ 4 diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index dd050da216..cd4ed84c7e 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -327,7 +327,7 @@ class BootstrapFractionSauterParam(NamedTuple): plasma_current: Any = None - xarea: Any = None + a_plasma_poloidal: Any = None f_helium3: Any = None @@ -375,7 +375,7 @@ class BootstrapFractionSauterParam(NamedTuple): rhopedn=0.9400000000000001, bt=5.326133750416047, plasma_current=16528278.760008096, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, f_helium3=0, teped=5.5, dene=8.016748468651018e19, @@ -439,7 +439,11 @@ def test_bootstrap_fraction_sauter(bootstrapfractionsauterparam, monkeypatch, ph physics_variables, "plasma_current", bootstrapfractionsauterparam.plasma_current ) - monkeypatch.setattr(physics_variables, "xarea", bootstrapfractionsauterparam.xarea) + monkeypatch.setattr( + physics_variables, + "a_plasma_poloidal", + bootstrapfractionsauterparam.a_plasma_poloidal, + ) monkeypatch.setattr( physics_variables, "f_helium3", bootstrapfractionsauterparam.f_helium3 @@ -2203,7 +2207,7 @@ class PcondParam(NamedTuple): plasma_volume: Any = None - xarea: Any = None + a_plasma_poloidal: Any = None zeff: Any = None @@ -2260,7 +2264,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2304,7 +2308,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2348,7 +2352,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2392,7 +2396,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2436,7 +2440,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2480,7 +2484,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2524,7 +2528,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2568,7 +2572,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2612,7 +2616,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2656,7 +2660,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2700,7 +2704,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2744,7 +2748,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2788,7 +2792,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2832,7 +2836,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2876,7 +2880,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2920,7 +2924,7 @@ class PcondParam(NamedTuple): ten=13.745148298980761, tin=13.745148298980761, plasma_volume=1888.1711539956691, - xarea=38.39822223637151, + a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, expected_kappaa=1.7187938085542791, @@ -2987,7 +2991,7 @@ def test_pcond(pcondparam, monkeypatch, physics): ten=pcondparam.ten, tin=pcondparam.tin, plasma_volume=pcondparam.plasma_volume, - xarea=pcondparam.xarea, + a_plasma_poloidal=pcondparam.a_plasma_poloidal, zeff=pcondparam.zeff, ) diff --git a/tests/unit/test_stellarator.py b/tests/unit/test_stellarator.py index 2cb0fd418a..7739d2eabf 100644 --- a/tests/unit/test_stellarator.py +++ b/tests/unit/test_stellarator.py @@ -63,7 +63,7 @@ class StgeomParam(NamedTuple): plasma_volume: Any = None - xarea: Any = None + a_plasma_poloidal: Any = None bt: Any = None @@ -81,7 +81,7 @@ class StgeomParam(NamedTuple): expected_vol: Any = None - expected_xarea: Any = None + expected_a_plasma_poloidal: Any = None @pytest.mark.parametrize( @@ -94,7 +94,7 @@ class StgeomParam(NamedTuple): a_plasma_surface=0, sareao=0, plasma_volume=0, - xarea=0, + a_plasma_poloidal=0, bt=5.5, stella_config_plasma_volume=1422.6300000000001, stella_config_plasma_surface=1960, @@ -103,7 +103,7 @@ class StgeomParam(NamedTuple): expected_a_plasma_surface=1925.3641313657533, expected_sareao=962.68206568287667, expected_vol=1385.2745877380669, - expected_xarea=10.001590778710231, + expected_a_plasma_poloidal=10.001590778710231, ), StgeomParam( aspect=12.33, @@ -112,7 +112,7 @@ class StgeomParam(NamedTuple): a_plasma_surface=1925.3641313657533, sareao=962.68206568287667, plasma_volume=1385.2745877380669, - xarea=10.001590778710231, + a_plasma_poloidal=10.001590778710231, bt=5.5, stella_config_plasma_volume=1422.6300000000001, stella_config_plasma_surface=1960, @@ -121,7 +121,7 @@ class StgeomParam(NamedTuple): expected_a_plasma_surface=1925.3641313657533, expected_sareao=962.68206568287667, expected_vol=1385.2745877380669, - expected_xarea=10.001590778710231, + expected_a_plasma_poloidal=10.001590778710231, ), ), ) @@ -152,7 +152,9 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): monkeypatch.setattr(physics_variables, "plasma_volume", stgeomparam.plasma_volume) - monkeypatch.setattr(physics_variables, "xarea", stgeomparam.xarea) + monkeypatch.setattr( + physics_variables, "a_plasma_poloidal", stgeomparam.a_plasma_poloidal + ) monkeypatch.setattr(physics_variables, "bt", stgeomparam.bt) @@ -182,7 +184,9 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): assert physics_variables.plasma_volume == pytest.approx(stgeomparam.expected_vol) - assert physics_variables.xarea == pytest.approx(stgeomparam.expected_xarea) + assert physics_variables.a_plasma_poloidal == pytest.approx( + stgeomparam.expected_a_plasma_poloidal + ) class StbildParam(NamedTuple): From b9b796e3421de0878de43db2161cb1e593f988e7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 14:14:28 +0000 Subject: [PATCH 10/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'plasma=5Fvolume'?= =?UTF-8?q?=20to=20'vol=5Fplasma'=20for=20consistency=20in=20plasma=20volu?= =?UTF-8?q?me=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proc-pages/physics-models/error.txt | 6 +- .../physics-models/plasma_confinement.md | 6 +- .../physics-models/plasma_geometry.md | 4 +- process/io/mfile_comparison.py | 6 +- process/io/plot_proc.py | 6 +- process/physics.py | 94 +++++++++---------- process/physics_functions.py | 52 +++++----- process/plasma_geometry.py | 12 +-- process/stellarator.py | 48 +++++----- process/stellarator_config.py | 10 +- process/vacuum.py | 2 +- source/fortran/constraint_equations.f90 | 30 +++--- source/fortran/physics_variables.f90 | 4 +- source/fortran/stellarator_configuration.f90 | 2 +- tests/integration/ref_dicts.json | 6 +- .../input_files/stellarator.stella_conf.json | 2 +- tests/unit/test_physics.py | 56 +++++------ tests/unit/test_physics_functions.py | 12 +-- tests/unit/test_stellarator.py | 30 +++--- tracking/tracking_data.py | 2 +- 20 files changed, 192 insertions(+), 198 deletions(-) diff --git a/documentation/proc-pages/physics-models/error.txt b/documentation/proc-pages/physics-models/error.txt index 93270b1c57..c92112512a 100644 --- a/documentation/proc-pages/physics-models/error.txt +++ b/documentation/proc-pages/physics-models/error.txt @@ -994,18 +994,18 @@ is derived directly from the energy confinement scaling law. \texttt{iradloss\ =\ 0} -- Total power lost is scaling power plus radiation -\texttt{pscaling\ +\ pradpv\ =\ f_alpha_plasma*alpha_power_density\ +\ charged_power_density\ +\ pden_plasma_ohmic_mw\ +\ pinjmw/plasma_volume} +\texttt{pscaling\ +\ pradpv\ =\ f_alpha_plasma*alpha_power_density\ +\ charged_power_density\ +\ pden_plasma_ohmic_mw\ +\ pinjmw/vol_plasma} \texttt{iradloss\ =\ 1} -- Total power lost is scaling power plus core radiation only -\texttt{pscaling\ +\ pcoreradpv\ =\ f_alpha_plasma*alpha_power_density\ +\ charged_power_density\ +\ pden_plasma_ohmic_mw\ +\ pinjmw/plasma_volume} +\texttt{pscaling\ +\ pcoreradpv\ =\ f_alpha_plasma*alpha_power_density\ +\ charged_power_density\ +\ pden_plasma_ohmic_mw\ +\ pinjmw/vol_plasma} \texttt{iradloss\ =\ 2} -- Total power lost is scaling power only, with no additional allowance for radiation. This is not recommended for power plant models. -\texttt{pscaling\ =\ f_alpha_plasma*alpha_power_density\ +\ charged_power_density\ +\ pden_plasma_ohmic_mw\ +\ pinjmw/plasma_volume} +\texttt{pscaling\ =\ f_alpha_plasma*alpha_power_density\ +\ charged_power_density\ +\ pden_plasma_ohmic_mw\ +\ pinjmw/vol_plasma} \subsection{Plasma Core Power Balance}\label{plasma-core-power-balance} diff --git a/documentation/proc-pages/physics-models/plasma_confinement.md b/documentation/proc-pages/physics-models/plasma_confinement.md index a5762459dd..77b7b44b32 100644 --- a/documentation/proc-pages/physics-models/plasma_confinement.md +++ b/documentation/proc-pages/physics-models/plasma_confinement.md @@ -78,17 +78,17 @@ derived directly from the energy confinement scaling law. `iradloss = 0` -- Total power lost is scaling power plus radiation: -`pscaling + pradpv = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw + pinjmw/plasma_volume` +`pscaling + pradpv = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw + pinjmw/vol_plasma` `iradloss = 1` -- Total power lost is scaling power plus radiation from a region defined as the "core": -`pscaling + pcoreradpv = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw + pinjmw/plasma_volume` +`pscaling + pcoreradpv = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw + pinjmw/vol_plasma` `iradloss = 2` -- Total power lost is scaling power only, with no additional allowance for radiation. This is not recommended for power plant models. -`pscaling = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw + pinjmw/plasma_volume` +`pscaling = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw + pinjmw/vol_plasma` ## L-H Power Threshold Scalings diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 54a62ee864..cb423c589d 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -330,7 +330,7 @@ Plasma geometry based on equations (36) in O. Sauter, Fusion Engineering and Des | `len_plasma_poloidal` | Plasma Poloidal perimeter length [$\text{m}$] | | `a_plasma_surface` | Plasma surface area [$\text{m}^2$] | | `a_plasma_poloidal` | Plasma cross-sectional area [$\text{m}^2$] | -| `plasma_volume` | Plasma volume [$\text{m}^3$] | +| `vol_plasma` | Plasma volume [$\text{m}^3$] | $$ \mathtt{w07} = 1 @@ -365,7 +365,7 @@ $$ Volume $$ -\mathtt{plasma_volume} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{a_plasma_poloidal} +\mathtt{vol_plasma} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{a_plasma_poloidal} $$ diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index bdccfc6897..b773fc9080 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -52,7 +52,7 @@ "fimp(13", "fimp(14", "a_plasma_surface", - "plasma_volume", + "vol_plasma", "n_tf", "shldith", "shldoth", @@ -109,7 +109,7 @@ "triang", "triang95", "a_plasma_surface", - "plasma_volume", + "vol_plasma", "n_tf", "fusion_power", "plasma_current_MA", @@ -137,7 +137,7 @@ "ralpne", "wallmw", "pinnerzoneradmw", - "psyncpv*plasma_volume", + "psyncpv*vol_plasma", "pradmw", "pnucblkt", "pnucshld", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index c3aad32efe..dd0b194bb1 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2348,7 +2348,7 @@ def plot_geometry_info(axis, mfile_data, scan): ("triang95", r"$\delta_{95}$", ""), ("a_plasma_surface", "Plasma surface area", "m$^2$"), ("a_plasma_poloidal", "Plasma cross-sectional area", "m$^2$"), - ("plasma_volume", "Plasma volume", "m$^3$"), + ("vol_plasma", "Plasma volume", "m$^3$"), ("n_tf", "No. of TF coils", ""), (in_blanket_thk, "Inboard blanket+shield", "m"), ("inboard_build", "Inboard build thickness", "m"), @@ -3515,10 +3515,10 @@ def main(args=None): # rad profile global ssync global bt - global plasma_volume + global vol_plasma ssync = m_file.data["ssync"].get_scan(scan) bt = m_file.data["bt"].get_scan(scan) - plasma_volume = m_file.data["plasma_volume"].get_scan(scan) + vol_plasma = m_file.data["vol_plasma"].get_scan(scan) # Build the dictionaries of radial and vertical build values and cumulative values global vertical_upper diff --git a/process/physics.py b/process/physics.py index 32c380446c..adde596c63 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1606,7 +1606,7 @@ def physics(self): * physics_variables.btot * physics_variables.btot / (2.0e0 * constants.rmu0) - * physics_variables.plasma_volume + * physics_variables.vol_plasma ) # Plasma thermal energy derived from the total beta @@ -1616,7 +1616,7 @@ def physics(self): * physics_variables.btot * physics_variables.btot / (2.0e0 * constants.rmu0) - * physics_variables.plasma_volume + * physics_variables.vol_plasma ) # Set PF coil ramp times @@ -1728,7 +1728,7 @@ def physics(self): physics_variables.q95, physics_variables.q0, physics_variables.rmajor, - physics_variables.plasma_volume, + physics_variables.vol_plasma, ) ) @@ -1970,13 +1970,13 @@ def physics(self): # This neglects the power from the beam physics_variables.dt_power_plasma = ( - physics_module.dt_power_density_plasma * physics_variables.plasma_volume + physics_module.dt_power_density_plasma * physics_variables.vol_plasma ) physics_variables.dhe3_power = ( - physics_module.dhe3_power_density * physics_variables.plasma_volume + physics_module.dhe3_power_density * physics_variables.vol_plasma ) physics_variables.dd_power = ( - physics_module.dd_power_density * physics_variables.plasma_volume + physics_module.dd_power_density * physics_variables.vol_plasma ) # Calculate neutral beam slowing down effects @@ -2005,7 +2005,7 @@ def physics(self): physics_module.sigmav_dt_average, physics_variables.ten, physics_variables.tin, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.zeffai, ) physics_variables.fusion_rate_density_total = ( @@ -2013,14 +2013,14 @@ def physics(self): + 1.0e6 * physics_variables.alpha_power_beams / (constants.dt_alpha_energy) - / physics_variables.plasma_volume + / physics_variables.vol_plasma ) physics_variables.alpha_rate_density_total = ( physics_variables.alpha_rate_density_plasma + 1.0e6 * physics_variables.alpha_power_beams / (constants.dt_alpha_energy) - / physics_variables.plasma_volume + / physics_variables.vol_plasma ) physics_variables.dt_power_total = ( physics_variables.dt_power_plasma @@ -2055,7 +2055,7 @@ def physics(self): physics_variables.alpha_power_beams, physics_variables.charged_power_density, physics_variables.neutron_power_density_plasma, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.alpha_power_density_plasma, ) @@ -2117,13 +2117,13 @@ def physics(self): physics_variables.pradpv = radpwrdata.pradpv physics_variables.pinnerzoneradmw = ( - physics_variables.pcoreradpv * physics_variables.plasma_volume + physics_variables.pcoreradpv * physics_variables.vol_plasma ) physics_variables.pouterzoneradmw = ( - physics_variables.pedgeradpv * physics_variables.plasma_volume + physics_variables.pedgeradpv * physics_variables.vol_plasma ) physics_variables.pradmw = ( - physics_variables.pradpv * physics_variables.plasma_volume + physics_variables.pradpv * physics_variables.vol_plasma ) # Calculate ohmic power @@ -2139,7 +2139,7 @@ def physics(self): physics_variables.rmajor, physics_variables.rminor, physics_variables.ten, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.zeff, ) @@ -2261,16 +2261,16 @@ def physics(self): physics_variables.tin, physics_variables.q95, physics_variables.qstar, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.a_plasma_poloidal, physics_variables.zeff, ) physics_variables.ptremw = ( - physics_variables.ptrepv * physics_variables.plasma_volume + physics_variables.ptrepv * physics_variables.vol_plasma ) physics_variables.ptrimw = ( - physics_variables.ptripv * physics_variables.plasma_volume + physics_variables.ptripv * physics_variables.vol_plasma ) # Total transport power from scaling law (MW) # pscalingmw = physics_variables.ptremw + physics_variables.ptrimw #KE - why is this commented? @@ -2318,11 +2318,11 @@ def physics(self): sbar, physics_variables.dnalp, physics_variables.taueff, - physics_variables.plasma_volume, + physics_variables.vol_plasma, ) - # ptremw = physics_variables.ptrepv*physics_variables.plasma_volume - # ptrimw = physics_variables.ptripv*physics_variables.plasma_volume + # ptremw = physics_variables.ptrepv*physics_variables.vol_plasma + # ptrimw = physics_variables.ptripv*physics_variables.vol_plasma # Total transport power from scaling law (MW) physics_variables.pscalingmw = ( physics_variables.ptremw + physics_variables.ptrimw @@ -2878,7 +2878,7 @@ def phyaux( sbar, dnalp, taueff, - plasma_volume, + vol_plasma, ): """Auxiliary physics quantities author: P J Knight, CCFE, Culham Science Centre @@ -2891,7 +2891,7 @@ def phyaux( plasma_current: input real : plasma current (A) sbar : input real : exponent for aspect ratio (normally 1) taueff : input real : global energy confinement time (s) - plasma_volume : input real : plasma volume (m3) + vol_plasma : input real : plasma volume (m3) burnup : output real : fractional plasma burnup dntau : output real : plasma average n-tau (s/m3) figmer : output real : physics figure of merit @@ -2909,7 +2909,7 @@ def phyaux( # Fusion reactions per second - fusrat = fusion_rate_density_total * plasma_volume + fusrat = fusion_rate_density_total * vol_plasma # Alpha particle confinement time (s) # Number of alphas / alpha production rate @@ -2953,7 +2953,7 @@ def plasma_ohmic_heating( rmajor: float, rminor: float, ten: float, - plasma_volume: float, + vol_plasma: float, zeff: float, ) -> tuple[float, float, float, float]: """ @@ -2966,7 +2966,7 @@ def plasma_ohmic_heating( rmajor (float): Major radius (m). rminor (float): Minor radius (m). ten (float): Density weighted average electron temperature (keV). - plasma_volume (float): Plasma volume (m^3). + vol_plasma (float): Plasma volume (m^3). zeff (float): Plasma effective charge. Returns: @@ -3014,11 +3014,11 @@ def plasma_ohmic_heating( * plasma_current**2 * res_plasma * 1.0e-6 - / plasma_volume + / vol_plasma ) # Total ohmic heating power - p_plasma_ohmic_mw = pden_plasma_ohmic_mw * plasma_volume + p_plasma_ohmic_mw = pden_plasma_ohmic_mw * vol_plasma return pden_plasma_ohmic_mw, p_plasma_ohmic_mw, rpfac, res_plasma @@ -3273,7 +3273,7 @@ def outplas(self): / constants.rmu0 * (15.0e0 * constants.electron_charge**4 * physics_variables.dlamie) / (4.0e0 * np.pi**1.5e0 * constants.epsilon0**2) - * physics_variables.plasma_volume**2 + * physics_variables.vol_plasma**2 * physics_variables.rmajor**2 * physics_variables.bt * np.sqrt(physics_variables.eps) @@ -3287,7 +3287,7 @@ def outplas(self): * constants.proton_mass * physics_variables.aion * physics_module.e_plasma_beta - / (3.0e0 * physics_variables.plasma_volume * physics_variables.dnla) + / (3.0e0 * physics_variables.vol_plasma * physics_variables.dnla) ) / ( constants.electron_charge * physics_variables.bt @@ -3300,7 +3300,7 @@ def outplas(self): / 3.0e0 * constants.rmu0 * physics_module.e_plasma_beta - / (physics_variables.plasma_volume * physics_variables.bt**2) + / (physics_variables.vol_plasma * physics_variables.bt**2) ) po.oheadr(self.outfile, "Plasma") @@ -3508,8 +3508,8 @@ def outplas(self): po.ovarre( self.outfile, "Plasma volume (m3)", - "(plasma_volume)", - physics_variables.plasma_volume, + "(vol_plasma)", + physics_variables.vol_plasma, "OP ", ) @@ -4434,8 +4434,8 @@ def outplas(self): po.ovarre( self.outfile, "Synchrotron radiation power (MW)", - "(psyncpv*plasma_volume)", - physics_variables.psyncpv * physics_variables.plasma_volume, + "(psyncpv*vol_plasma)", + physics_variables.psyncpv * physics_variables.vol_plasma, "OP ", ) po.ovarrf( @@ -5140,7 +5140,7 @@ def outplas(self): physics_variables.powerht / ( physics_variables.powerht - + physics_variables.pradpv * physics_variables.plasma_volume + + physics_variables.pradpv * physics_variables.vol_plasma ) ) ** 0.31, @@ -5628,7 +5628,7 @@ def igmarcal(self): physics_variables.tin, physics_variables.q, physics_variables.qstar, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.a_plasma_poloidal, physics_variables.zeff, ) @@ -5650,7 +5650,7 @@ def bootstrap_fraction_iter89( q95: float, q0: float, rmajor: float, - plasma_volume: float, + vol_plasma: float, ) -> float: """ Calculate the bootstrap-driven fraction of the plasma current. @@ -5663,7 +5663,7 @@ def bootstrap_fraction_iter89( q95 (float): Safety factor at 95% surface. q0 (float): Central safety factor. rmajor (float): Plasma major radius (m). - plasma_volume (float): Plasma volume (m3). + vol_plasma (float): Plasma volume (m3). Returns: float: The bootstrap-driven fraction of the plasma current. @@ -5679,7 +5679,7 @@ def bootstrap_fraction_iter89( c_bs = 1.32 - 0.235 * (q95 / q0) + 0.0185 * (q95 / q0) ** 2 # Calculate the average minor radius - average_a = np.sqrt(plasma_volume / (2 * np.pi**2 * rmajor)) + average_a = np.sqrt(vol_plasma / (2 * np.pi**2 * rmajor)) b_pa = (plasma_current / 1e6) / (5 * average_a) @@ -6420,7 +6420,7 @@ def fhz(self, hhh): physics_variables.tin, physics_variables.q, physics_variables.qstar, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.a_plasma_poloidal, physics_variables.zeff, ) @@ -6440,7 +6440,7 @@ def fhz(self, hhh): # calculation (i.e. whether device is ignited) if physics_variables.ignite == 0: - fhz -= current_drive_variables.pinjmw / physics_variables.plasma_volume + fhz -= current_drive_variables.pinjmw / physics_variables.vol_plasma # Include the radiation power if requested @@ -6478,7 +6478,7 @@ def pcond( tin, q, qstar, - plasma_volume, + vol_plasma, a_plasma_poloidal, zeff, ): @@ -6512,7 +6512,7 @@ def pcond( te : input real : average electron temperature (keV) ten : input real : density weighted average electron temp. (keV) tin : input real : density weighted average ion temperature (keV) - plasma_volume : input real : plasma volume (m3) + vol_plasma : input real : plasma volume (m3) a_plasma_poloidal : input real : plasma cross-sectional area (m2) zeff : input real : plasma effective charge ptrepv : output real : electron transport power (MW/m3) @@ -6567,11 +6567,11 @@ def pcond( # Include the radiation as a loss term if requested if physics_variables.iradloss == 0: - powerht = powerht - physics_variables.pradpv * plasma_volume + powerht = powerht - physics_variables.pradpv * vol_plasma elif physics_variables.iradloss == 1: powerht = ( - powerht - pcoreradpv * plasma_volume - ) # shouldn't this be vol_core instead of plasma_volume? + powerht - pcoreradpv * vol_plasma + ) # shouldn't this be vol_core instead of vol_plasma? # else do not adjust powerht for radiation # Ensure heating power is positive (shouldn't be necessary) @@ -6591,7 +6591,7 @@ def pcond( kappaa = a_plasma_poloidal / (np.pi * rminor * rminor) # Separatrix kappa defined with plasma volume for IPB scalings - physics_variables.kappaa_ipb = plasma_volume / ( + physics_variables.kappaa_ipb = vol_plasma / ( 2.0e0 * np.pi**2 * rminor * rminor * rmajor ) diff --git a/process/physics_functions.py b/process/physics_functions.py index dae77111d1..2f80dd325e 100644 --- a/process/physics_functions.py +++ b/process/physics_functions.py @@ -611,7 +611,7 @@ def psync_albajar_fidone(): psync = 0.0 psyncpv = 0.0 - kap = physics_variables.plasma_volume / ( + kap = physics_variables.vol_plasma / ( 2.0e0 * np.pi**2 * physics_variables.rmajor * physics_variables.rminor**2 ) @@ -660,7 +660,7 @@ def psync_albajar_fidone(): # psyncpv should be per unit volume; Albajar gives it as total - psyncpv = psync / physics_variables.plasma_volume + psyncpv = psync / physics_variables.vol_plasma return psyncpv @@ -817,7 +817,7 @@ def set_fusion_powers( alpha_power_beams: float, charged_power_density: float, neutron_power_density_plasma: float, - plasma_volume: float, + vol_plasma: float, alpha_power_density_plasma: float, ) -> tuple: """ @@ -830,7 +830,7 @@ def set_fusion_powers( alpha_power_beams (float): Alpha power from hot neutral beam ions (MW). charged_power_density (float): Other charged particle fusion power per unit volume (MW/m^3). neutron_power_density_plasma (float): Neutron fusion power per unit volume just from plasma (MW/m^3). - plasma_volume (float): Plasma volume (m^3). + vol_plasma (float): Plasma volume (m^3). alpha_power_density_plasma (float): Alpha power per unit volume just from plasma (MW/m^3). Returns: @@ -855,20 +855,20 @@ def set_fusion_powers( # Alpha power # Calculate alpha power produced just by the plasma - alpha_power_plasma = alpha_power_density_plasma * plasma_volume + alpha_power_plasma = alpha_power_density_plasma * vol_plasma # Add neutral beam alpha power / volume alpha_power_density_total = alpha_power_density_plasma + ( - alpha_power_beams / plasma_volume + alpha_power_beams / vol_plasma ) # Total alpha power - alpha_power_total = alpha_power_density_total * plasma_volume + alpha_power_total = alpha_power_density_total * vol_plasma # Neutron Power # Calculate neutron power produced just by the plasma - neutron_power_plasma = neutron_power_density_plasma * plasma_volume + neutron_power_plasma = neutron_power_density_plasma * vol_plasma # Add extra neutron power from beams neutron_power_density_total = neutron_power_density_plasma + ( @@ -879,16 +879,16 @@ def set_fusion_powers( ) * alpha_power_beams ) - / plasma_volume + / vol_plasma ) # Total neutron power - neutron_power_total = neutron_power_density_total * plasma_volume + neutron_power_total = neutron_power_density_total * vol_plasma # Charged particle power # Total non-alpha charged particle power - non_alpha_charged_power = charged_power_density * plasma_volume + non_alpha_charged_power = charged_power_density * vol_plasma # Charged particle fusion power charged_particle_power = alpha_power_total + non_alpha_charged_power @@ -1017,7 +1017,7 @@ def beam_fusion( sigmav_dt_average: float, ten: float, tin: float, - plasma_volume: float, + vol_plasma: float, zeffai: float, ) -> tuple: """ @@ -1042,7 +1042,7 @@ def beam_fusion( sigmav_dt_average (float): Profile averaged for D-T (m^3/s). ten (float): Density-weighted electron temperature (keV). tin (float): Density-weighted ion temperature (keV). - plasma_volume (float): Plasma volume (m^3). + vol_plasma (float): Plasma volume (m^3). zeffai (float): Mass weighted plasma effective charge. Returns: @@ -1116,7 +1116,7 @@ def beam_fusion( f_tritium_beam, beam_current, tin, - plasma_volume, + vol_plasma, sigmav_dt_average, ) @@ -1148,7 +1148,7 @@ def beamcalc( f_tritium_beam: float, beam_current: float, ti: float, - plasma_volume: float, + vol_plasma: float, svdt: float, ) -> tuple[float, float, float, float]: """ @@ -1168,7 +1168,7 @@ def beamcalc( f_tritium_beam (float): Beam tritium fraction (0.0 = deuterium beam). beam_current (float): Beam current (A). ti (float): Thermal ion temperature (keV). - plasma_volume (float): Plasma volume (m^3). + vol_plasma (float): Plasma volume (m^3). svdt (float): Profile averaged for D-T (m^3/s). Returns: @@ -1219,7 +1219,7 @@ def beamcalc( deuterium_beam_density = ( beam_current_deuterium * characteristic_deuterium_beam_slow_time - / (constants.electron_charge * plasma_volume) + / (constants.electron_charge * vol_plasma) ) # Ratio of beam energy to critical energy for tritium @@ -1234,7 +1234,7 @@ def beamcalc( tritium_beam_density = ( beam_current_tritium * characteristic_tritium_beam_slow_time - / (constants.electron_charge * plasma_volume) + / (constants.electron_charge * vol_plasma) ) hot_beam_density = deuterium_beam_density + tritium_beam_density @@ -1261,11 +1261,9 @@ def beamcalc( # D.Baiquan et.al. “Fast ion pressure in fusion plasma,” Nuclear Fusion and Plasma Physics, # vol. 9, no. 3, pp. 136–141, 2022, Available: https://fti.neep.wisc.edu/fti.neep.wisc.edu/pdf/fdm718.pdf - source_deuterium = beam_current_deuterium / ( - constants.electron_charge * plasma_volume - ) + source_deuterium = beam_current_deuterium / (constants.electron_charge * vol_plasma) - source_tritium = beam_current_tritium / (constants.electron_charge * plasma_volume) + source_tritium = beam_current_tritium / (constants.electron_charge * vol_plasma) pressure_coeff_deuterium = ( ATOMIC_MASS_DEUTERIUM @@ -1312,10 +1310,10 @@ def beamcalc( ) deuterium_beam_alpha_power = alpha_power_beam( - deuterium_beam_density, nt, hot_deuterium_rate, plasma_volume, ti, svdt + deuterium_beam_density, nt, hot_deuterium_rate, vol_plasma, ti, svdt ) tritium_beam_alpha_power = alpha_power_beam( - tritium_beam_density, nd, hot_tritium_rate, plasma_volume, ti, svdt + tritium_beam_density, nd, hot_tritium_rate, vol_plasma, ti, svdt ) return ( @@ -1371,7 +1369,7 @@ def alpha_power_beam( beam_ion_desnity: float, plasma_ion_desnity: float, sigv: float, - plasma_volume: float, + vol_plasma: float, ti: float, sigmav_dt: float, ) -> float: @@ -1385,7 +1383,7 @@ def alpha_power_beam( beam_ion_desnity (float): Hot beam ion density (m^-3). plasma_ion_desnity (float): Thermal ion density (m^-3). sigv (float): Hot beam fusion reaction rate (m^3/s). - plasma_volume (float): Plasma volume (m^3). + vol_plasma (float): Plasma volume (m^3). ti (float): Thermal ion temperature (keV). sigmav_dt (float): Profile averaged for D-T (m^3/s). @@ -1416,7 +1414,7 @@ def alpha_power_beam( * plasma_ion_desnity * sigv * (constants.dt_alpha_energy / 1e6) - * plasma_volume + * vol_plasma * ratio ) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 5fcf0d8014..01e4011f3c 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -267,7 +267,7 @@ def plasma_geometry(self) -> None: physics_variables.sf, physics_variables.a_plasma_surface, physics_variables.a_plasma_poloidal, - physics_variables.plasma_volume, + physics_variables.vol_plasma, ) = self.sauter_geometry( physics_variables.rminor, physics_variables.rmajor, @@ -283,7 +283,7 @@ def plasma_geometry(self) -> None: ) # Volume - physics_variables.plasma_volume = physics_variables.cvol * self.xvol( + physics_variables.vol_plasma = physics_variables.cvol * self.xvol( physics_variables.rmajor, physics_variables.rminor, xi, @@ -486,7 +486,7 @@ def sauter_geometry( - sf (float): Geometric factor - a_plasma_surface (float): Surface area - a_plasma_poloidal (float): Cross-section area - - plasma_volume (float): Plasma volume + - vol_plasma (float): Plasma volume Notes: @@ -525,16 +525,14 @@ def sauter_geometry( a_plasma_poloidal = np.pi * a**2 * kappa * (1 + 0.52 * (w07 - 1)) # Volume - plasma_volume = ( - 2.0e0 * np.pi * r0 * (1 - 0.25 * triang * eps) * a_plasma_poloidal - ) + vol_plasma = 2.0e0 * np.pi * r0 * (1 - 0.25 * triang * eps) * a_plasma_poloidal return ( len_plasma_poloidal, sf, a_plasma_surface, a_plasma_poloidal, - plasma_volume, + vol_plasma, ) diff --git a/process/stellarator.py b/process/stellarator.py index dd6bcbd88a..91bebd9d5e 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -246,7 +246,7 @@ def stigma(self): physics_variables.tin, physics_variables.q, physics_variables.qstar, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.a_plasma_poloidal, physics_variables.zeff, ) @@ -324,8 +324,8 @@ def stgeom(self): Fourierkoeffizienten' ('Representation of nested, closed surfaces with Fourier coefficients') """ - physics_variables.plasma_volume = ( - st.f_r * st.f_a**2 * stellarator_configuration.stella_config_plasma_volume + physics_variables.vol_plasma = ( + st.f_r * st.f_a**2 * stellarator_configuration.stella_config_vol_plasma ) # Plasma surface scaled from effective parameter: @@ -4107,7 +4107,7 @@ def stphys(self, output): * physics_variables.btot * physics_variables.btot / (2.0e0 * constants.rmu0) - * physics_variables.plasma_volume + * physics_variables.vol_plasma ) physics_module.rho_star = np.sqrt( @@ -4115,7 +4115,7 @@ def stphys(self, output): * constants.proton_mass * physics_variables.aion * physics_module.e_plasma_beta - / (3.0e0 * physics_variables.plasma_volume * physics_variables.dnla) + / (3.0e0 * physics_variables.vol_plasma * physics_variables.dnla) ) / ( constants.electron_charge * physics_variables.bt @@ -4150,13 +4150,13 @@ def stphys(self, output): # D-T power density is named differently to differentiate it from the beam given component physics_variables.dt_power_plasma = ( - physics_module.dt_power_density_plasma * physics_variables.plasma_volume + physics_module.dt_power_density_plasma * physics_variables.vol_plasma ) physics_variables.dhe3_power = ( - physics_module.dhe3_power_density * physics_variables.plasma_volume + physics_module.dhe3_power_density * physics_variables.vol_plasma ) physics_variables.dd_power = ( - physics_module.dd_power_density * physics_variables.plasma_volume + physics_module.dd_power_density * physics_variables.vol_plasma ) # Calculate neutral beam slowing down effects @@ -4185,7 +4185,7 @@ def stphys(self, output): physics_module.sigmav_dt_average, physics_variables.ten, physics_variables.tin, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.zeffai, ) physics_variables.fusion_rate_density_total = ( @@ -4193,14 +4193,14 @@ def stphys(self, output): + 1.0e6 * physics_variables.alpha_power_beams / (constants.dt_alpha_energy) - / physics_variables.plasma_volume + / physics_variables.vol_plasma ) physics_variables.alpha_rate_density_total = ( physics_variables.alpha_rate_density_plasma + 1.0e6 * physics_variables.alpha_power_beams / (constants.dt_alpha_energy) - / physics_variables.plasma_volume + / physics_variables.vol_plasma ) physics_variables.dt_power_total = ( physics_variables.dt_power_plasma @@ -4235,7 +4235,7 @@ def stphys(self, output): physics_variables.alpha_power_beams, physics_variables.charged_power_density, physics_variables.neutron_power_density_plasma, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.alpha_power_density_plasma, ) @@ -4302,14 +4302,14 @@ def stphys(self, output): physics_variables.pedgeradpv = max(physics_variables.pedgeradpv, 0.0e0) physics_variables.pinnerzoneradmw = ( - physics_variables.pcoreradpv * physics_variables.plasma_volume + physics_variables.pcoreradpv * physics_variables.vol_plasma ) # Should probably be vol_core physics_variables.pouterzoneradmw = ( - physics_variables.pedgeradpv * physics_variables.plasma_volume + physics_variables.pedgeradpv * physics_variables.vol_plasma ) physics_variables.pradmw = ( - physics_variables.pradpv * physics_variables.plasma_volume + physics_variables.pradpv * physics_variables.vol_plasma ) # Heating power to plasma (= Psol in divertor model) @@ -4320,7 +4320,7 @@ def stphys(self, output): physics_variables.f_alpha_plasma * physics_variables.alpha_power_total + physics_variables.non_alpha_charged_power + physics_variables.p_plasma_ohmic_mw - - physics_variables.pradpv * physics_variables.plasma_volume + - physics_variables.pradpv * physics_variables.vol_plasma ) powht = max( 0.00001e0, powht @@ -4345,7 +4345,7 @@ def stphys(self, output): physics_variables.pradmw = ( physics_variables.pradmw + physics_variables.psolradmw ) - # pradpv = physics_variables.pradmw / physics_variables.plasma_volume # this line OVERWRITES the original definition of pradpv, probably shouldn't be defined like that as the core does not lose SOL power. + # pradpv = physics_variables.pradmw / physics_variables.vol_plasma # this line OVERWRITES the original definition of pradpv, probably shouldn't be defined like that as the core does not lose SOL power. # The following line is unphysical, but prevents -ve sqrt argument # Should be obsolete if constraint eqn 17 is turned on (but beware - @@ -4433,16 +4433,16 @@ def stphys(self, output): physics_variables.tin, stellarator_variables.iotabar, physics_variables.qstar, - physics_variables.plasma_volume, + physics_variables.vol_plasma, physics_variables.a_plasma_poloidal, physics_variables.zeff, ) physics_variables.ptremw = ( - physics_variables.ptrepv * physics_variables.plasma_volume + physics_variables.ptrepv * physics_variables.vol_plasma ) physics_variables.ptrimw = ( - physics_variables.ptripv * physics_variables.plasma_volume + physics_variables.ptripv * physics_variables.vol_plasma ) physics_variables.pscalingmw = ( @@ -4471,7 +4471,7 @@ def stphys(self, output): sbar, physics_variables.dnalp, physics_variables.taueff, - physics_variables.plasma_volume, + physics_variables.vol_plasma, ) # Calculate physics_variables.beta limit. Does nothing atm so commented out @@ -4684,7 +4684,7 @@ def calc_neoclassics(self): * physics_variables.alpha_power_density_total - physics_variables.pcoreradpv ) - * physics_variables.plasma_volume + * physics_variables.vol_plasma / physics_variables.a_plasma_surface * impurity_radiation_module.coreradius ) @@ -4694,7 +4694,7 @@ def calc_neoclassics(self): * physics_variables.alpha_power_density_total - physics_variables.pcoreradpv ) - * physics_variables.plasma_volume + * physics_variables.vol_plasma / physics_variables.a_plasma_surface ) @@ -4807,7 +4807,7 @@ def calc_neoclassics(self): def st_calc_eff_chi(self): volscaling = ( - physics_variables.plasma_volume + physics_variables.vol_plasma * st.f_r * ( impurity_radiation_module.coreradius diff --git a/process/stellarator_config.py b/process/stellarator_config.py index ec84489b06..78702ee7b2 100644 --- a/process/stellarator_config.py +++ b/process/stellarator_config.py @@ -17,7 +17,7 @@ "coilspermodule": 10, "a1": 0.688, "a2": 0.025, - "plasma_volume": 1422.63, # This value is for Helias 5 + "vol_plasma": 1422.63, # This value is for Helias 5 "dmin": 0.84, "max_portsize_width": 2.12, "plasma_surface": 1960.0, # Plasma Surface @@ -59,7 +59,7 @@ "coilspermodule": 10, "a1": 0.676, "a2": 0.029, - "plasma_volume": 1380.0, + "vol_plasma": 1380.0, "dmin": 1.08, "max_portsize_width": 3.24, "plasma_surface": 1900.0, @@ -101,7 +101,7 @@ # Bmax fit parameters "a1": 0.56, "a2": 0.030, - "plasma_volume": 1300.8, + "vol_plasma": 1300.8, "dmin": 1.145, "max_portsize_width": 3.24, # ??? guess. not ready yet "plasma_surface": 1600.00, @@ -142,7 +142,7 @@ "coilspermodule": 6, "a1": 0.98, "a2": 0.041, - "plasma_volume": 26.4, + "vol_plasma": 26.4, "dmin": 0.21, "max_portsize_width": 0.5, "plasma_surface": 128.3, @@ -183,7 +183,7 @@ "coilspermodule": 10, "a1": 0.66, "a2": 0.025, - "plasma_volume": 26.4, + "vol_plasma": 26.4, "dmin": 0.28, "max_portsize_width": 0.3, "plasma_surface": 128.3, diff --git a/process/vacuum.py b/process/vacuum.py index ac1cb6f262..6b676c7e0b 100644 --- a/process/vacuum.py +++ b/process/vacuum.py @@ -57,7 +57,7 @@ def run(self, output: bool) -> None: pv.rminor, 0.5e0 * (buv.scrapli + buv.scraplo), pv.a_plasma_surface, - pv.plasma_volume, + pv.vol_plasma, buv.shldoth, buv.shldith, buv.tfcth, diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index e11f26792f..482efdee3c 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -457,11 +457,11 @@ subroutine constraint_eqn_002(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! charged_power_density : input real : non-alpha charged particle fusion power per volume (MW/m3) !! pden_plasma_ohmic_mw : input real : ohmic heating power per volume (MW/m3) !! pinjmw : input real : total auxiliary injected power (MW) - !! plasma_volume : input real : plasma volume (m3) + !! vol_plasma : input real : plasma volume (m3) use physics_variables, only: iradloss, ignite, ptrepv, ptripv, pradpv, & pcoreradpv, f_alpha_plasma, alpha_power_density_total, charged_power_density, & - pden_plasma_ohmic_mw, plasma_volume + pden_plasma_ohmic_mw, vol_plasma use current_drive_variables, only: pinjmw implicit none @@ -488,7 +488,7 @@ subroutine constraint_eqn_002(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! if plasma not ignited include injected power if (ignite == 0) then - pdenom = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw + pinjmw/plasma_volume + pdenom = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw + pinjmw/vol_plasma else ! if plasma ignited pdenom = f_alpha_plasma*alpha_power_density_total + charged_power_density + pden_plasma_ohmic_mw @@ -520,8 +520,8 @@ subroutine constraint_eqn_003(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! f_alpha_plasma : input real : fraction of alpha power deposited in plasma !! alpha_power_ions_density : input real : alpha power per volume to ions (MW/m3) !! pinjimw : input real : auxiliary injected power to ions (MW) - !! plasma_volume : input real : plasma volume (m3) - use physics_variables, only: ignite, ptripv, piepv, f_alpha_plasma, alpha_power_ions_density, plasma_volume + !! vol_plasma : input real : plasma volume (m3) + use physics_variables, only: ignite, ptripv, piepv, f_alpha_plasma, alpha_power_ions_density, vol_plasma use current_drive_variables, only: pinjimw implicit none real(dp), intent(out) :: tmp_cc @@ -532,9 +532,9 @@ subroutine constraint_eqn_003(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! No assume plasma ignition: if (ignite == 0) then - tmp_cc = 1.0D0 - (ptripv + piepv) / (f_alpha_plasma*alpha_power_ions_density + pinjimw/plasma_volume) - tmp_con = (f_alpha_plasma*alpha_power_ions_density + pinjimw/plasma_volume) * (1.0D0 - tmp_cc) - tmp_err = (f_alpha_plasma*alpha_power_ions_density + pinjimw/plasma_volume) * tmp_cc + tmp_cc = 1.0D0 - (ptripv + piepv) / (f_alpha_plasma*alpha_power_ions_density + pinjimw/vol_plasma) + tmp_con = (f_alpha_plasma*alpha_power_ions_density + pinjimw/vol_plasma) * (1.0D0 - tmp_cc) + tmp_err = (f_alpha_plasma*alpha_power_ions_density + pinjimw/vol_plasma) * tmp_cc tmp_symbol = '=' tmp_units = 'MW/m3' ! Plasma ignited: @@ -575,9 +575,9 @@ subroutine constraint_eqn_004(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! alpha_power_electron_density : input real : alpha power per volume to electrons (MW/m3) !! piepv : input real : ion/electron equilibration power per volume (MW/m3) !! pinjemw : input real : auxiliary injected power to electrons (MW) - !! plasma_volume : input real : plasma volume (m3) + !! vol_plasma : input real : plasma volume (m3) use physics_variables, only: iradloss, ignite, ptrepv, pcoreradpv, f_alpha_plasma, & - alpha_power_electron_density, piepv, plasma_volume, pradpv + alpha_power_electron_density, piepv, vol_plasma, pradpv use current_drive_variables, only: pinjemw implicit none real(dp), intent(out) :: tmp_cc @@ -601,7 +601,7 @@ subroutine constraint_eqn_004(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! if plasma not ignited include injected power if (ignite == 0) then - pdenom = f_alpha_plasma*alpha_power_electron_density + piepv + pinjemw/plasma_volume + pdenom = f_alpha_plasma*alpha_power_electron_density + piepv + pinjemw/vol_plasma else ! if plasma ignited pdenom = f_alpha_plasma*alpha_power_electron_density + piepv @@ -1029,13 +1029,13 @@ subroutine constraint_eqn_017(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! f_alpha_plasma : input real : fraction of alpha power deposited in plasma !! pinjmw : input real : total auxiliary injected power (MW) - !! plasma_volume : input real : plasma volume (m3) + !! vol_plasma : input real : plasma volume (m3) !! alpha_power_density_total : input real : alpha power per volume (MW/m3) !! charged_power_density : input real : non-alpha charged particle fusion power per volume (MW/m3) !! pden_plasma_ohmic_mw : input real : ohmic heating power per volume (MW/m3) !! fradpwr : input real : f-value for core radiation power limit !! pradpv : input real : total radiation power per volume (MW/m3) - use physics_variables, only: f_alpha_plasma, plasma_volume, alpha_power_density_total, charged_power_density, pden_plasma_ohmic_mw, pradpv + use physics_variables, only: f_alpha_plasma, vol_plasma, alpha_power_density_total, charged_power_density, pden_plasma_ohmic_mw, pradpv use current_drive_variables, only: pinjmw use constraint_variables, only: fradpwr implicit none @@ -1046,9 +1046,9 @@ subroutine constraint_eqn_017(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=10), intent(out) :: tmp_units real(dp) :: pradmaxpv - !! Maximum possible power/plasma_volume that can be radiated (local) + !! Maximum possible power/vol_plasma that can be radiated (local) - pradmaxpv = pinjmw/plasma_volume + alpha_power_density_total*f_alpha_plasma + charged_power_density + pden_plasma_ohmic_mw + pradmaxpv = pinjmw/vol_plasma + alpha_power_density_total*f_alpha_plasma + charged_power_density + pden_plasma_ohmic_mw tmp_cc = 1.0D0 - fradpwr * pradmaxpv / pradpv tmp_con = pradmaxpv * (1.0D0 - tmp_cc) tmp_err = pradpv * tmp_cc diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index cfd82c913b..4b5a90f07b 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -902,7 +902,7 @@ module physics_variables real(dp) :: triang95 !! plasma triangularity at 95% surface (calculated if `ishape = 0-2, 6, 8 or 9`) - real(dp) :: plasma_volume + real(dp) :: vol_plasma !! plasma volume (m3) real(dp) :: vsbrn @@ -1153,7 +1153,7 @@ subroutine init_physics_variables tratio = 1.0D0 triang = 0.36D0 triang95 = 0.24D0 - plasma_volume = 0.0D0 + vol_plasma = 0.0D0 vsbrn = 0.0D0 vshift = 0.0D0 vsind = 0.0D0 diff --git a/source/fortran/stellarator_configuration.f90 b/source/fortran/stellarator_configuration.f90 index aaa0f56008..6c3e48c6ce 100644 --- a/source/fortran/stellarator_configuration.f90 +++ b/source/fortran/stellarator_configuration.f90 @@ -81,7 +81,7 @@ module stellarator_configuration real(dp) stella_config_derivative_min_LCFS_coils_dist ! The derivative of min_plasma_coil_distance wrt to the minor plasma radius at the reference point [1] - real(dp) stella_config_plasma_volume + real(dp) stella_config_vol_plasma ! The plasma volume at the reference point. Scales as a*R^2. [m^3] real(dp) stella_config_plasma_surface diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 8a2fba71d7..9dc78778fd 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -7935,7 +7935,7 @@ "vlabel_2": "", "vlam": 0.0, "vmu": null, - "plasma_volume": 0.0, + "vol_plasma": 0.0, "vol_bz": 0.0, "vol_bz_ib": 0.0, "vol_bz_ob": 0.0, @@ -11048,7 +11048,7 @@ "vlabel_2": "scan value name label (2nd dimension)", "vlam": "", "vmu": "", - "plasma_volume": "plasma volume (m3)", + "vol_plasma": "plasma volume (m3)", "vol_bz": "", "vol_bz_ib": "", "vol_bz_ob": "", @@ -19270,7 +19270,7 @@ "tratio", "triang", "triang95", - "plasma_volume", + "vol_plasma", "vsbrn", "vshift", "vsind", diff --git a/tests/regression/input_files/stellarator.stella_conf.json b/tests/regression/input_files/stellarator.stella_conf.json index 66836f790b..5c7b24416e 100644 --- a/tests/regression/input_files/stellarator.stella_conf.json +++ b/tests/regression/input_files/stellarator.stella_conf.json @@ -30,7 +30,7 @@ "symmetry": 5, "rmajor_ref": 22.19309491, "rminor_ref": 1.80206932, - "plasma_volume": 1422.62552585, + "vol_plasma": 1422.62552585, "plasma_surface": 1960.01361974, "epseff": 0.01464553, "number_nu_star": 20, diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index cd4ed84c7e..c7d26e787a 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -91,7 +91,7 @@ class BootstrapFractionIter89Param(NamedTuple): rmajor: Any = None - plasma_volume: Any = None + vol_plasma: Any = None expected_bootipf: Any = None @@ -107,7 +107,7 @@ class BootstrapFractionIter89Param(NamedTuple): q95=3.5, q0=1, rmajor=8, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, expected_bootipf=0.30255906256775245, ), ), @@ -133,7 +133,7 @@ def test_bootstrap_fraction_iter89(bootstrapfractioniter89param, physics): q95=bootstrapfractioniter89param.q95, q0=bootstrapfractioniter89param.q0, rmajor=bootstrapfractioniter89param.rmajor, - plasma_volume=bootstrapfractioniter89param.plasma_volume, + vol_plasma=bootstrapfractioniter89param.vol_plasma, ) assert bootstrap_current_fraction == pytest.approx( @@ -1837,7 +1837,7 @@ class PhyauxParam(NamedTuple): taueff: Any = None - plasma_volume: Any = None + vol_plasma: Any = None expected_burnup: Any = None @@ -1869,7 +1869,7 @@ class PhyauxParam(NamedTuple): plasma_current=18398455.678867526, sbar=1, taueff=3.401323521525641, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, expected_burnup=0.20383432558954095, expected_dntau=2.5509926411442307e20, expected_figmer=55.195367036602576, @@ -1890,7 +1890,7 @@ class PhyauxParam(NamedTuple): plasma_current=18398455.678867526, sbar=1, taueff=3.402116961408892, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, expected_burnup=0.20387039462081086, expected_dntau=2.5515877210566689e20, expected_figmer=55.195367036602576, @@ -1928,7 +1928,7 @@ def test_phyaux(phyauxparam, monkeypatch, physics): plasma_current=phyauxparam.plasma_current, sbar=phyauxparam.sbar, taueff=phyauxparam.taueff, - plasma_volume=phyauxparam.plasma_volume, + vol_plasma=phyauxparam.vol_plasma, ) assert burnup == pytest.approx(phyauxparam.expected_burnup) @@ -1969,7 +1969,7 @@ class PohmParam(NamedTuple): ten: Any = None - plasma_volume: Any = None + vol_plasma: Any = None zeff: Any = None @@ -1994,7 +1994,7 @@ class PohmParam(NamedTuple): rmajor=8, rminor=2.6666666666666665, ten=12.626131115905864, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, zeff=2.0909945616489103, expected_pden_plasma_ohmic_mw=0.0004062519138005805, expected_p_plasma_ohmic_mw=0.7670731448937912, @@ -2034,7 +2034,7 @@ def test_pohm(pohmparam, monkeypatch, physics): rmajor=pohmparam.rmajor, rminor=pohmparam.rminor, ten=pohmparam.ten, - plasma_volume=pohmparam.plasma_volume, + vol_plasma=pohmparam.vol_plasma, zeff=pohmparam.zeff, ) @@ -2205,7 +2205,7 @@ class PcondParam(NamedTuple): tin: Any = None - plasma_volume: Any = None + vol_plasma: Any = None a_plasma_poloidal: Any = None @@ -2263,7 +2263,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2307,7 +2307,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2351,7 +2351,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2395,7 +2395,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2439,7 +2439,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2483,7 +2483,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2527,7 +2527,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2571,7 +2571,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2615,7 +2615,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2659,7 +2659,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2703,7 +2703,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2747,7 +2747,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2791,7 +2791,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2835,7 +2835,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2879,7 +2879,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2923,7 +2923,7 @@ class PcondParam(NamedTuple): te=12.437097421317889, ten=13.745148298980761, tin=13.745148298980761, - plasma_volume=1888.1711539956691, + vol_plasma=1888.1711539956691, a_plasma_poloidal=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, @@ -2990,7 +2990,7 @@ def test_pcond(pcondparam, monkeypatch, physics): te=pcondparam.te, ten=pcondparam.ten, tin=pcondparam.tin, - plasma_volume=pcondparam.plasma_volume, + vol_plasma=pcondparam.vol_plasma, a_plasma_poloidal=pcondparam.a_plasma_poloidal, zeff=pcondparam.zeff, ) diff --git a/tests/unit/test_physics_functions.py b/tests/unit/test_physics_functions.py index 80bac07435..3cc71258fd 100644 --- a/tests/unit/test_physics_functions.py +++ b/tests/unit/test_physics_functions.py @@ -39,7 +39,7 @@ class SetFusionPowersParam(NamedTuple): tin: Any = None - plasma_volume: Any = None + vol_plasma: Any = None alpha_power_density_plasma: Any = None @@ -76,7 +76,7 @@ class SetFusionPowersParam(NamedTuple): f_alpha_ion=0.32, alpha_power_beams=0, charged_power_density=0.00066, - plasma_volume=2426.25, + vol_plasma=2426.25, alpha_power_density_plasma=0.163, neutron_power_density_plasma=0.654, expected_alpha_power_density=0.163, @@ -96,7 +96,7 @@ class SetFusionPowersParam(NamedTuple): f_alpha_ion=0.32, alpha_power_beams=100.5, charged_power_density=0.00066, - plasma_volume=2426.25, + vol_plasma=2426.25, alpha_power_density_plasma=0.163, neutron_power_density_plasma=0.654, expected_alpha_power_density=0.20442195, @@ -116,7 +116,7 @@ class SetFusionPowersParam(NamedTuple): f_alpha_ion=0.32, alpha_power_beams=100.5, charged_power_density=0.00066, - plasma_volume=2426.25, + vol_plasma=2426.25, alpha_power_density_plasma=0.163, neutron_power_density_plasma=0.654, expected_alpha_power_density=0.20442195, @@ -136,7 +136,7 @@ class SetFusionPowersParam(NamedTuple): f_alpha_ion=0.32, alpha_power_beams=100.5, charged_power_density=0.00066, - plasma_volume=2426.25, + vol_plasma=2426.25, alpha_power_density_plasma=0.163, neutron_power_density_plasma=0.654, expected_alpha_power_density=0.20442195, @@ -184,7 +184,7 @@ def test_set_fusion_powers(setfusionpowersparam, monkeypatch): alpha_power_beams=setfusionpowersparam.alpha_power_beams, charged_power_density=setfusionpowersparam.charged_power_density, neutron_power_density_plasma=setfusionpowersparam.neutron_power_density_plasma, - plasma_volume=setfusionpowersparam.plasma_volume, + vol_plasma=setfusionpowersparam.vol_plasma, alpha_power_density_plasma=setfusionpowersparam.alpha_power_density_plasma, ) diff --git a/tests/unit/test_stellarator.py b/tests/unit/test_stellarator.py index 7739d2eabf..463e193205 100644 --- a/tests/unit/test_stellarator.py +++ b/tests/unit/test_stellarator.py @@ -61,13 +61,13 @@ class StgeomParam(NamedTuple): sareao: Any = None - plasma_volume: Any = None + vol_plasma: Any = None a_plasma_poloidal: Any = None bt: Any = None - stella_config_plasma_volume: Any = None + stella_config_vol_plasma: Any = None stella_config_plasma_surface: Any = None @@ -93,10 +93,10 @@ class StgeomParam(NamedTuple): rminor=1.7842660178426601, a_plasma_surface=0, sareao=0, - plasma_volume=0, + vol_plasma=0, a_plasma_poloidal=0, bt=5.5, - stella_config_plasma_volume=1422.6300000000001, + stella_config_vol_plasma=1422.6300000000001, stella_config_plasma_surface=1960, f_r=0.99099099099099097, f_a=0.99125889880147788, @@ -111,10 +111,10 @@ class StgeomParam(NamedTuple): rminor=1.7842660178426601, a_plasma_surface=1925.3641313657533, sareao=962.68206568287667, - plasma_volume=1385.2745877380669, + vol_plasma=1385.2745877380669, a_plasma_poloidal=10.001590778710231, bt=5.5, - stella_config_plasma_volume=1422.6300000000001, + stella_config_vol_plasma=1422.6300000000001, stella_config_plasma_surface=1960, f_r=0.99099099099099097, f_a=0.99125889880147788, @@ -150,7 +150,7 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): monkeypatch.setattr(physics_variables, "sareao", stgeomparam.sareao) - monkeypatch.setattr(physics_variables, "plasma_volume", stgeomparam.plasma_volume) + monkeypatch.setattr(physics_variables, "vol_plasma", stgeomparam.vol_plasma) monkeypatch.setattr( physics_variables, "a_plasma_poloidal", stgeomparam.a_plasma_poloidal @@ -160,8 +160,8 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): monkeypatch.setattr( stellarator_configuration, - "stella_config_plasma_volume", - stgeomparam.stella_config_plasma_volume, + "stella_config_vol_plasma", + stgeomparam.stella_config_vol_plasma, ) monkeypatch.setattr( @@ -182,7 +182,7 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): assert physics_variables.sareao == pytest.approx(stgeomparam.expected_sareao) - assert physics_variables.plasma_volume == pytest.approx(stgeomparam.expected_vol) + assert physics_variables.vol_plasma == pytest.approx(stgeomparam.expected_vol) assert physics_variables.a_plasma_poloidal == pytest.approx( stgeomparam.expected_a_plasma_poloidal @@ -2680,7 +2680,7 @@ class StCalcEffChiParam(NamedTuple): alphat: Any = None - plasma_volume: Any = None + vol_plasma: Any = None a_plasma_surface: Any = None @@ -2706,7 +2706,7 @@ class StCalcEffChiParam(NamedTuple): pcoreradpv=0.10762698429338043, alphan=0.35000000000000003, alphat=1.2, - plasma_volume=1385.8142655379029, + vol_plasma=1385.8142655379029, a_plasma_surface=1926.0551116585129, rminor=1.7863900994187722, coreradius=0.60000000000000009, @@ -2723,7 +2723,7 @@ class StCalcEffChiParam(NamedTuple): pcoreradpv=0.1002475669217598, alphan=0.35000000000000003, alphat=1.2, - plasma_volume=1385.8142655379029, + vol_plasma=1385.8142655379029, a_plasma_surface=1926.0551116585129, rminor=1.7863900994187722, coreradius=0.60000000000000009, @@ -2767,9 +2767,7 @@ def test_st_calc_eff_chi(stcalceffchiparam, monkeypatch, stellarator): monkeypatch.setattr(physics_variables, "alphat", stcalceffchiparam.alphat) - monkeypatch.setattr( - physics_variables, "plasma_volume", stcalceffchiparam.plasma_volume - ) + monkeypatch.setattr(physics_variables, "vol_plasma", stcalceffchiparam.vol_plasma) monkeypatch.setattr( physics_variables, "a_plasma_surface", stcalceffchiparam.a_plasma_surface diff --git a/tracking/tracking_data.py b/tracking/tracking_data.py index de8b9e3c33..3c95901407 100644 --- a/tracking/tracking_data.py +++ b/tracking/tracking_data.py @@ -144,7 +144,7 @@ class ProcessTracker: "te0", "pdivt", "nesep", - "plasma_volume", + "vol_plasma", "a_plasma_surface", "pnetelmw", "etath", From edb1c5f19fbf4efe3922b12884bddefc46770858 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 14:19:44 +0000 Subject: [PATCH 11/38] =?UTF-8?q?=E2=9C=85=20Refactor=20test=20functions?= =?UTF-8?q?=20to=20use=20'process.plasma=5Fgeometry'=20for=20improved=20cl?= =?UTF-8?q?arity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/test_plasma_geom.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/unit/test_plasma_geom.py b/tests/unit/test_plasma_geom.py index e5fcb65cf8..a867408a63 100644 --- a/tests/unit/test_plasma_geom.py +++ b/tests/unit/test_plasma_geom.py @@ -4,6 +4,7 @@ import pytest +import process.plasma_geometry as pg from process.plasma_geometry import PlasmaGeom @@ -95,7 +96,7 @@ def test_xparam(xparamparam, monkeypatch, plasma): ) ], ) -def test_perim(a, kap, tri, expected_perim, plasma): +def test_perim(a, kap, tri, expected_perim): """Tests `perim` function. :param a: test asset passed to the routine representing the plasma minor radius, in meters. @@ -110,7 +111,7 @@ def test_perim(a, kap, tri, expected_perim, plasma): :param expected_perim: expected result of the function. :type expected_perim: float """ - perim = plasma.perim(a, kap, tri) + perim = pg.perim(a, kap, tri) assert pytest.approx(perim) == expected_perim @@ -203,7 +204,7 @@ def test_xsecta(xi, thetai, xo, thetao, expected_xsecta, plasma): ) ], ) -def test_fvol(r, a, kap, tri, expected_fvol, plasma): +def test_fvol(r, a, kap, tri, expected_fvol): """Tests `fvol` function. :param r: test asset passed to the routine representing the plasma major radius, in meters. :type r: float @@ -221,7 +222,7 @@ def test_fvol(r, a, kap, tri, expected_fvol, plasma): :type expected_fvol: float """ - fvol = plasma.fvol(r, a, kap, tri) + fvol = pg.fvol(r, a, kap, tri) assert pytest.approx(fvol) == expected_fvol @@ -237,7 +238,7 @@ def test_fvol(r, a, kap, tri, expected_fvol, plasma): ) ], ) -def test_xsect0(a, kap, tri, expected_xsect0, plasma): +def test_xsect0(a, kap, tri, expected_xsect0): """Tests `xsect0` function. :param a: test asset passed to the routine representing the plasma minor radius, in meters. @@ -253,7 +254,7 @@ def test_xsect0(a, kap, tri, expected_xsect0, plasma): :type expected_xsect0: float """ - xsect0 = plasma.xsect0(a, kap, tri) + xsect0 = pg.xsect0(a, kap, tri) assert pytest.approx(xsect0) == expected_xsect0 @@ -363,7 +364,7 @@ class SurfaParam(NamedTuple): ), ), ) -def test_surfa(surfaparam, monkeypatch, plasma): +def test_surfa(surfaparam, monkeypatch): """ Automatically generated Regression Unit Test for surfa. @@ -376,9 +377,7 @@ def test_surfa(surfaparam, monkeypatch, plasma): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - sa, so = plasma.surfa( - a=surfaparam.a, r=surfaparam.r, k=surfaparam.k, d=surfaparam.d - ) + sa, so = pg.surfa(a=surfaparam.a, r=surfaparam.r, k=surfaparam.k, d=surfaparam.d) assert sa == pytest.approx(surfaparam.expected_sa) From bb0f6a187a9bb898adb76f82cad6849b51690d7d Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 14:28:05 +0000 Subject: [PATCH 12/38] :arrows_counterclockwise: Rename 'xparam' to 'plasma_angles_arcs' for improved clarity in plasma geometry calculations --- .../physics-models/plasma_geometry.md | 6 ++-- process/plasma_geometry.py | 6 ++-- tests/unit/test_plasma_geom.py | 30 ++++++++++--------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index cb423c589d..a3df96f440 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -202,7 +202,7 @@ The plasma and first wall clearance can be calculated or input by setting the `i - `i_plasma_wall_gap` == 0, then the inboard and outboard plasma wall gaps are set to be 10% of the plasma minor radius ($a$). - `i_plasma_wall_gap` == 1, then the inboard and outboard plasma wall gaps are set by defining `scrapli` and `scraplo` respectively. -### Geometrical properties | `xparam()` +### Geometrical properties | `plasma_angles_arcs()` This method calculates the radius and half angle of the arc describing the inboard and outboard plasma surfaces. This calculation is appropriate for plasmas with a separatrix. It requires the plasma minor radius ($a$, `rminor`), elongation ($\kappa$, `kappa`) and triangularity ($\delta$, `triang`). @@ -274,7 +274,7 @@ $$ This function finds the plasma surface area, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. -It uses the geometrical properties derived in `xparam()` +It uses the geometrical properties derived in `plasma_angles_arcs()` | Input Variable | Description | |----------|--------------------------------------| @@ -385,7 +385,7 @@ $$ ### Plasma Volume | `xvol()` -The plasma volume is calculated using the `xvol` method with the inputted $R_0$ & $a$ along with the outputs of `xparam`. +The plasma volume is calculated using the `xvol` method with the inputted $R_0$ & $a$ along with the outputs of `plasma_angles_arcs()`. The `cvol` iteration variable can be used to scale this output | Input Variable | Description | diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 01e4011f3c..2a801c2537 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -238,7 +238,7 @@ def plasma_geometry(self) -> None: # ====================================================================== # Find parameters of arcs describing plasma surfaces - xi, thetai, xo, thetao = self.xparam( + xi, thetai, xo, thetao = self.plasma_angles_arcs( physics_variables.rminor, physics_variables.kappa, physics_variables.triang, @@ -301,7 +301,9 @@ def plasma_geometry(self) -> None: # ====================================================================== @staticmethod - def xparam(a: float, kap: float, tri: float) -> tuple[float, float, float, float]: + def plasma_angles_arcs( + a: float, kap: float, tri: float + ) -> tuple[float, float, float, float]: """ Routine to find parameters used for calculating geometrical properties for double-null plasmas. diff --git a/tests/unit/test_plasma_geom.py b/tests/unit/test_plasma_geom.py index a867408a63..c4ae1af616 100644 --- a/tests/unit/test_plasma_geom.py +++ b/tests/unit/test_plasma_geom.py @@ -20,7 +20,7 @@ def plasma(): return plasma -class XparamParam(NamedTuple): +class PlasmaAnglesArcsParam(NamedTuple): a: Any = None kap: Any = None @@ -37,9 +37,9 @@ class XparamParam(NamedTuple): @pytest.mark.parametrize( - "xparamparam", + "plasmaanglesarcsparam", ( - XparamParam( + PlasmaAnglesArcsParam( a=2.8677741935483869, kap=1.8480000000000001, tri=0.5, @@ -48,7 +48,7 @@ class XparamParam(NamedTuple): expected_xo=5.4154130183225808, expected_thetao=1.3636548755403939, ), - XparamParam( + PlasmaAnglesArcsParam( a=2.8677741935483869, kap=1.8480000000000001, tri=0.5, @@ -59,30 +59,32 @@ class XparamParam(NamedTuple): ), ), ) -def test_xparam(xparamparam, monkeypatch, plasma): +def test_plasma_angles_arcs(plasmaanglesarcsparam, monkeypatch, plasma): """ - Automatically generated Regression Unit Test for xparam. + Automatically generated Regression Unit Test for plasma_angles_arcs(). This test was generated using data from tracking/baseline_2018/baseline_2018_IN.DAT. - :param xparamparam: the data used to mock and assert in this test. - :type xparamparam: xparamparam + :param plasmaanglesarcsparam: the data used to mock and assert in this test. + :type plasmaanglesarcsparam: plasmaanglesarcsparam :param monkeypatch: pytest fixture used to mock module/class variables :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - xi, thetai, xo, thetao = plasma.xparam( - a=xparamparam.a, kap=xparamparam.kap, tri=xparamparam.tri + xi, thetai, xo, thetao = plasma.plasma_angles_arcs( + a=plasmaanglesarcsparam.a, + kap=plasmaanglesarcsparam.kap, + tri=plasmaanglesarcsparam.tri, ) - assert xi == pytest.approx(xparamparam.expected_xi) + assert xi == pytest.approx(plasmaanglesarcsparam.expected_xi) - assert thetai == pytest.approx(xparamparam.expected_thetai) + assert thetai == pytest.approx(plasmaanglesarcsparam.expected_thetai) - assert xo == pytest.approx(xparamparam.expected_xo) + assert xo == pytest.approx(plasmaanglesarcsparam.expected_xo) - assert thetao == pytest.approx(xparamparam.expected_thetao) + assert thetao == pytest.approx(plasmaanglesarcsparam.expected_thetao) @pytest.mark.parametrize( From ab8bb2c3b20d365bf5098227f259cc1a21c39624 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 14:44:35 +0000 Subject: [PATCH 13/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'cvol'=20to=20'f?= =?UTF-8?q?=5Fvol=5Fplasma'=20for=20consistency=20in=20plasma=20volume=20c?= =?UTF-8?q?alculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proc-pages/physics-models/plasma_geometry.md | 2 +- process/plasma_geometry.py | 2 +- source/fortran/input.f90 | 6 +++--- source/fortran/physics_variables.f90 | 6 +++--- tests/integration/ref_dicts.json | 10 +++++----- tests/regression/input_files/st_regression.IN.DAT | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index a3df96f440..adbfc50614 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -386,7 +386,7 @@ $$ ### Plasma Volume | `xvol()` The plasma volume is calculated using the `xvol` method with the inputted $R_0$ & $a$ along with the outputs of `plasma_angles_arcs()`. -The `cvol` iteration variable can be used to scale this output +The `f_vol_plasma` iteration variable can be used to scale this output | Input Variable | Description | |----------|--------------------------------------| diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 2a801c2537..b848b4b96c 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -283,7 +283,7 @@ def plasma_geometry(self) -> None: ) # Volume - physics_variables.vol_plasma = physics_variables.cvol * self.xvol( + physics_variables.vol_plasma = physics_variables.f_vol_plasma * self.xvol( physics_variables.rmajor, physics_variables.rminor, xi, diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index d945f621d4..304bdfe7ac 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -304,7 +304,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) ncls, nfixmx, cptdin, ipfloc, i_sup_pf_shape, rref, i_pf_current, & ccl0_ma, ccls_ma, ld_ratio_cst use physics_variables, only: ipedestal, taumax, i_single_null, fvsbrnni, & - rhopedt, cvol, f_deuterium, ffwal, i_beta_component, itartpf, ilhthresh, & + rhopedt, f_vol_plasma, f_deuterium, ffwal, i_beta_component, itartpf, ilhthresh, & fpdivlim, beta_poloidal_eps_max, isc, kappa95, aspect, cwrmax, nesep, c_beta, csawth, dene, & ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, beta_norm_max, & fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, f_tritium, & @@ -557,8 +557,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('csawth') call parse_real_variable('csawth', csawth, 0.0D0, 10.0D0, & 'Coefficient for sawteeth effects') - case ('cvol') - call parse_real_variable('cvol', cvol, 0.01D0, 10.0D0, & + case ('f_vol_plasma') + call parse_real_variable('f_vol_plasma', f_vol_plasma, 0.01D0, 10.0D0, & 'Plasma volume multiplier') case ('cwrmax') call parse_real_variable('cwrmax', cwrmax, 1.0D0, 3.0D0, & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 4b5a90f07b..cf806934fc 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -125,8 +125,8 @@ module physics_variables real(dp) :: csawth !! coeff. for sawteeth effects on burn V-s requirement - real(dp) :: cvol - !! multiplying factor times plasma volume (normally=1) + real(dp) :: f_vol_plasma + !! multiplying factor for the plasma volume (normally=1) real(dp) :: cwrmax !! maximum ratio of conducting wall distance to plasma minor radius for @@ -977,7 +977,7 @@ subroutine init_physics_variables bvert = 0.0D0 c_beta = 0.5D0 csawth = 1.0D0 - cvol = 1.0D0 + f_vol_plasma = 1.0D0 cwrmax = 1.35D0 dene = 9.8D19 deni = 0.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 9dc78778fd..bf80b1981b 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1580,7 +1580,7 @@ "curpff": 0.0, "curpfs": 0.0, "curr1_": "e_*vte1_", - "cvol": 1.0, + "f_vol_plasma": 1.0, "cwrmax": 1.35, "czero": "(0.0_wp_, 0.0_wp_)", "d_vv_bot": 0.07, @@ -9246,7 +9246,7 @@ "curpff": "PF coil current array, at flat top (MA)\n Indexed by coil number, not group number", "curpfs": "PF coil current array, at end of pulse (MA)\n Indexed by coil number, not group number", "curr1_": "", - "cvol": "multiplying factor times plasma volume (normally=1)", + "f_vol_plasma": "multiplying factor times plasma volume (normally=1)", "cwrmax": "maximum ratio of conducting wall distance to plasma minor radius for\n vertical stability (`constraint equation 23`)", "czero": "", "d_vv_bot": "vacuum vessel underside thickness (TF coil / shield) (m)", @@ -12117,7 +12117,7 @@ "lb": 100.0, "ub": 1000.0 }, - "cvol": { + "f_vol_plasma": { "lb": 0.01, "ub": 10.0 }, @@ -19088,7 +19088,7 @@ "burnup", "bvert", "csawth", - "cvol", + "f_vol_plasma", "cwrmax", "dene", "deni", @@ -20153,7 +20153,7 @@ "csawth": "real_variable", "csi": "real_variable", "cturbb": "real_variable", - "cvol": "real_variable", + "f_vol_plasma": "real_variable", "cwrmax": "real_variable", "d_vv_bot": "real_variable", "d_vv_in": "real_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 2cb9464720..a9d9f82617 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -216,7 +216,7 @@ triang = 0.5 * DESCRIPTION: Margin to vertical stability (ishape = 10) * JUSTIFICATION: Not used, not using ishape=10 -*cvol = 1.0 +*f_vol_plasma = 1.0 * DESCRIPTION: Plasma volume multiplier * JUSTIFICATION: Not scaling plasma volume From e89d20dbec383a3c7b1c5c8b80f6c6da6a31fb58 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 14:48:38 +0000 Subject: [PATCH 14/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'ishape'=20to=20'?= =?UTF-8?q?i=5Fplasma=5Fgeometry'=20for=20consistency=20in=20plasma=20geom?= =?UTF-8?q?etry=20parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fusion-devices/spherical-tokamak.md | 2 +- .../proc-pages/physics-models/error.txt | 16 ++++----- .../plasma_current/plasma_current.md | 2 +- .../physics-models/plasma_geometry.md | 34 +++++++++---------- .../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 | 4 +-- examples/data/scan_MFILE.DAT | 6 ++-- examples/data/scan_example_file_IN.DAT | 4 +-- process/io/in_dat.py | 2 +- process/physics.py | 26 +++++++------- process/plasma_geometry.py | 24 ++++++------- process/utilities/errorlist.json | 2 +- source/fortran/constraint_equations.f90 | 4 +-- source/fortran/input.f90 | 6 ++-- source/fortran/physics_variables.f90 | 14 ++++---- source/fortran/scan.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 +-- tests/integration/data/large_tokamak_IN.DAT | 4 +-- .../integration/data/large_tokamak_MFILE.DAT | 4 +-- .../data/large_tokamak_once_through.IN.DAT | 8 ++--- tests/integration/data/ref_IN.DAT | 6 ++-- tests/integration/data/scan_2D_MFILE.DAT | 4 +-- tests/integration/data/scan_MFILE.DAT | 6 ++-- .../data/uncertainties_nonopt_ref_IN.DAT | 6 ++-- .../integration/data/uncertainties_ref_IN.DAT | 6 ++-- tests/integration/ref_dicts.json | 20 +++++------ .../input_files/large_tokamak.IN.DAT | 4 +-- .../input_files/large_tokamak_nof.IN.DAT | 4 +-- .../large_tokamak_once_through.IN.DAT | 8 ++--- .../input_files/st_regression.IN.DAT | 16 ++++----- tests/unit/data/large_tokamak_IN.DAT | 4 +-- tests/unit/data/large_tokamak_MFILE.DAT | 4 +-- 39 files changed, 145 insertions(+), 145 deletions(-) diff --git a/documentation/proc-pages/fusion-devices/spherical-tokamak.md b/documentation/proc-pages/fusion-devices/spherical-tokamak.md index 1a48d8ca6f..5cf6f7fe6f 100644 --- a/documentation/proc-pages/fusion-devices/spherical-tokamak.md +++ b/documentation/proc-pages/fusion-devices/spherical-tokamak.md @@ -42,7 +42,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 | +| `i_plasma_geometry` | 0, 2, 3, 4 | 1, 5, 6, 7, 8 | | `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 c92112512a..0d74cee2b7 100644 --- a/documentation/proc-pages/physics-models/error.txt +++ b/documentation/proc-pages/physics-models/error.txt @@ -119,15 +119,15 @@ values. The shape of the plasma cross-section is given by its last closed flux surface (LCFS) elongation \(\kappa\) (\texttt{kappa}) and triangularity \(\delta\) (\texttt{triang}), which can be scaled automatically with the aspect ratio if required using switch -\texttt{ishape}: +\texttt{i_plasma_geometry}: \begin{itemize} \tightlist \item - \texttt{ishape\ =\ 0} -- the input values for \texttt{kappa} and + \texttt{i_plasma_geometry\ =\ 0} -- the input values for \texttt{kappa} and \texttt{triang} are used directly. \item - \texttt{ishape\ =\ 1} -- the following scaling is used, which is + \texttt{i_plasma_geometry\ =\ 1} -- the following scaling is used, which is suitable for low aspect ratio machines (\(\epsilon = 1/A\)) \footnote{J.D. Galambos, `STAR Code : Spherical Tokamak Analysis and Reactor Code', Unpublished internal Oak Ridge document.}: @@ -141,7 +141,7 @@ automatically with the aspect ratio if required using switch \begin{itemize} \tightlist \item - \texttt{ishape\ =\ 2} -- the Zohm ITER scaling \footnote{H. Zohm et + \texttt{i_plasma_geometry\ =\ 2} -- the Zohm ITER scaling \footnote{H. Zohm et al, `On the Physics Guidelines for a Tokamak DEMO', FTP/3-3, Proc. IAEA Fusion Energy Conference, October 2012, San Diego} is used to calculate the elongation: \[ @@ -151,7 +151,7 @@ automatically with the aspect ratio if required using switch unchanged. \end{itemize} -If \texttt{ishape\ =\ 0,\ 1,\ 2}, the values for the plasma shaping +If \texttt{i_plasma_geometry\ =\ 0,\ 1,\ 2}, the values for the plasma shaping parameters at the 95\% flux surface are calculated as follows: \[\begin{aligned} @@ -162,13 +162,13 @@ parameters at the 95\% flux surface are calculated as follows: \begin{itemize} \tightlist \item - If \texttt{ishape\ =\ 3}, the Zohm ITER scaling is used to calculate - the elongation (as for \texttt{ishape\ =\ 2} above), but the + If \texttt{i_plasma_geometry\ =\ 3}, the Zohm ITER scaling is used to calculate + the elongation (as for \texttt{i_plasma_geometry\ =\ 2} above), but the triangularity at the 95\% flux surface is input via variable \texttt{triang95}, and the LCFS triangularity \texttt{triang} is calculated from it, rather than the other way round. \item - Finally, if \texttt{ishape\ =\ 4}, the 95\% flux surface values + Finally, if \texttt{i_plasma_geometry\ =\ 4}, the 95\% flux surface values \texttt{kappa95} and \texttt{triang95} are both used as inputs, and the LCFS values are calculated from them by inverting the equations above. 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 af9877cb28..5c7a6825a2 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -481,7 +481,7 @@ 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--plasma_geometry) relation. +The linear relation between these and the 95% values expressed in does not hold at high values of elongation and triangularity as per the [`i_plasma_geometry = 0`](../plasma_geometry.md#plasma-geometry-parameters--plasma_geometry) relation. $$ diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index adbfc50614..8483ce2b3a 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -9,7 +9,7 @@ calculated from these values. The inverse aspect ratio is given by, $\epsilon$ ( The shape of the plasma cross-section is given by the elongation of the last closed flux surface (LCFS) $\kappa$ (`kappa`) and the triangularity of the LCFS $\delta$ (`triang`), which can be scaled automatically with the aspect ratio if -required using certain switch conditions of `ishape`: +required using certain switch conditions of `i_plasma_geometry`: ## Plasma Geometry Parameters | `plasma_geometry()` @@ -21,7 +21,7 @@ The function uses various scaling laws and formulas to calculate these parameter ---- -- `ishape = 0` -- `kappa` and `triang` **must** be input. The elongation and triangularity of the 95% +- `i_plasma_geometry = 0` -- `kappa` and `triang` **must** be input. The elongation and triangularity of the 95% flux surface are calculated as follows, based on the 1989 ITER guidelines [^1]: $$ \kappa_{95} = \kappa / 1.12 @@ -32,7 +32,7 @@ The function uses various scaling laws and formulas to calculate these parameter ---- -- `ishape = 1` -- `kappa` and `triang` **must not** be input. They are calculated by the following equations, +- `i_plasma_geometry = 1` -- `kappa` and `triang` **must not** be input. They are calculated by the following equations, which estimate the largest elongation and triangularity achievable for low aspect ratio machines based on the STAR code[^2]: @@ -50,7 +50,7 @@ The function uses various scaling laws and formulas to calculate these parameter $$ The values for the plasma shaping parameters at the 95% flux surface are calculated using a fit - to a family of equilibria calculated using the FIESTA code, equivalent to that used in `ishape = 8`. + to a family of equilibria calculated using the FIESTA code, equivalent to that used in `i_plasma_geometry = 8`. $$ \kappa_{95} = \frac{(\kappa - 0.39467)}{0.90698} @@ -62,7 +62,7 @@ The function uses various scaling laws and formulas to calculate these parameter ---- -- `ishape = 2` -- The Zohm ITER scaling [^3] is used to calculate the elongation, where input variable `fkzohm` $= F_{kz}$ may be used to adjust the scaling, while the input +- `i_plasma_geometry = 2` -- The Zohm ITER scaling [^3] is used to calculate the elongation, where input variable `fkzohm` $= F_{kz}$ may be used to adjust the scaling, while the input value of the triangularity is used unchanged $$ @@ -79,15 +79,15 @@ The function uses various scaling laws and formulas to calculate these parameter $$ --------------------------------------------------------------------- -- `ishape = 3` -- The Zohm ITER scaling[^3] is used to calculate the elongation (as for `ishape = 2` +- `i_plasma_geometry = 3` -- The Zohm ITER scaling[^3] is used to calculate the elongation (as for `i_plasma_geometry = 2` above), but the triangularity at the 95% flux surface is input via variable `triang95`, and the LCFS triangularity `triang` is calculated from it, rather than the other way round. --------------------------------------------------------------------- -- `ishape = 4` -- The 95% flux surface values `kappa95` and `triang95` are both used as inputs, +- `i_plasma_geometry = 4` -- The 95% flux surface values `kappa95` and `triang95` are both used as inputs, and the LCFS values are calculated from them by inverting the equations given above - for `ishape = 0`. + for `i_plasma_geometry = 0`. --------------------------------------------------------------------- -- `ishape = 5` -- The 95% flux surface values `kappa95` and `triang95` are both used as inputs and +- `i_plasma_geometry = 5` -- The 95% flux surface values `kappa95` and `triang95` are both used as inputs and the LCFS values are calculated from a fit to MAST data: $$ @@ -98,10 +98,10 @@ The function uses various scaling laws and formulas to calculate these parameter \delta = 0.77394 \, \delta_{95} + 0.18515 $$ --------------------------------------------------------------------- -- `ishape = 6` -- The input values for `kappa` and `triang` are used directly and the 95% flux - surface values are calculated using the MAST scaling from `ishape = 5`. +- `i_plasma_geometry = 6` -- The input values for `kappa` and `triang` are used directly and the 95% flux + surface values are calculated using the MAST scaling from `i_plasma_geometry = 5`. --------------------------------------------------------------------- -- `ishape = 7` -- The 95% flux surface values `kappa95` and `triang95` are both used as inputs and +- `i_plasma_geometry = 7` -- The 95% flux surface values `kappa95` and `triang95` are both used as inputs and the LCFS values are calculated from a fit to FIESTA runs: $$ @@ -112,10 +112,10 @@ The function uses various scaling laws and formulas to calculate these parameter \delta = 1.3799 \, \delta_{95} + 0.048306 $$ --------------------------------------------------------------------- -- `ishape = 8` -- The input values for `kappa` and `triang` are used directly and the 95% flux - surface values are calculated using the FIESTA fit from `ishape = 7`. +- `i_plasma_geometry = 8` -- The input values for `kappa` and `triang` are used directly and the 95% flux + surface values are calculated using the FIESTA fit from `i_plasma_geometry = 7`. --------------------------------------------------------------------- -- `ishape = 9` -- The input values for `triang` and `rli` are used, `kappa` and the 95% flux +- `i_plasma_geometry = 9` -- The input values for `triang` and `rli` are used, `kappa` and the 95% flux surface values are calculated. $$ @@ -133,7 +133,7 @@ The function uses various scaling laws and formulas to calculate these parameter \delta_{95} = \delta / 1.5 $$ --------------------------------------------------------------------- -- `ishape = 10` -- The input values for `triang` are used directly to calculate 95% flux surface values. `kappa` is calculated to a fit from CREATE data for a EU-DEMO type machine with aspect ratios of ($2.6\le A \le 3.6$). Coefficient values are rounded to 2 decimal places +- `i_plasma_geometry = 10` -- The input values for `triang` are used directly to calculate 95% flux surface values. `kappa` is calculated to a fit from CREATE data for a EU-DEMO type machine with aspect ratios of ($2.6\le A \le 3.6$). Coefficient values are rounded to 2 decimal places $$ \kappa_{95} = \frac{(18.84 -(0.87 \times A)) - \sqrt{4.84A^2 -28.77 A+52.52+14.74 \times m_{\text{s,limit}}}}{2a} @@ -158,7 +158,7 @@ $$ $$ --------------------------------------------------------------------- -- `ishape = 11` -- The elongation is calculated directly dependant on the aspect ratio for spherical tokamak aspect ratios.[^4] +- `i_plasma_geometry = 11` -- The elongation is calculated directly dependant on the aspect ratio for spherical tokamak aspect ratios.[^4] $$ \kappa = 0.95 \left(1.9+\frac{1.9}{A^{1.4}}\right) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index acef9761a1..e1dd43cb7a 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -1544,7 +1544,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1561,7 +1561,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 3201ef5940..17f0a398cf 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -1538,7 +1538,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1555,7 +1555,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 44eed1adb8..623d382a90 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -1538,7 +1538,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1555,7 +1555,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 5d2441dff3..c62ec1efeb 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -1538,7 +1538,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1555,7 +1555,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index 459f9e3105..2f46985883 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -1538,7 +1538,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1555,7 +1555,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/examples/data/large_tokamak_IN.DAT b/examples/data/large_tokamak_IN.DAT index 81000b7649..fe14ce4fbc 100644 --- a/examples/data/large_tokamak_IN.DAT +++ b/examples/data/large_tokamak_IN.DAT @@ -348,7 +348,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -365,7 +365,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index b88c7ec8af..653413b08b 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -9234,7 +9234,7 @@ alphat = 1.45 * Temperature profile index aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; -fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) +fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=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) @@ -9256,10 +9256,10 @@ teped = 5.5 * Electron temperature of pedestal (kev) (ipedestal=1) tesep = 0.1 * Electron temperature at separatrix (kev) (ipedestal=1) iprofile = 1 * Switch for current profile consistency; isc = 34 * Switch for energy confinement time scaling law -ishape = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang +i_plasma_geometry = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang *kappa = 1.7808 kappa = 1.848 -triang = 0.5 * Plasma separatrix triangularity (calculated if ishape=1; 3 or 4) +triang = 0.5 * Plasma separatrix triangularity (calculated if i_plasma_geometry=1; 3 or 4) q = 3.247 * Safety factor 'near' plasma edge (iteration variable 18); q0 = 1.0 * Safety factor on axis rmajor = 9.072 * Plasma major radius (m) (iteration variable 3) diff --git a/examples/data/scan_example_file_IN.DAT b/examples/data/scan_example_file_IN.DAT index 3897696bc3..472c68b4db 100644 --- a/examples/data/scan_example_file_IN.DAT +++ b/examples/data/scan_example_file_IN.DAT @@ -348,7 +348,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -365,7 +365,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/process/io/in_dat.py b/process/io/in_dat.py index 62c600c17a..65ebe81e40 100644 --- a/process/io/in_dat.py +++ b/process/io/in_dat.py @@ -1487,7 +1487,7 @@ class StructuredInputData: input file, and hence it is more human-readable and ready to output to file. An example of the structure: - self.data["parameters"]["physics_variables"]["ishape"]["value"] = 0 + self.data["parameters"]["physics_variables"]["i_plasma_geometry"]["value"] = 0 """ def __init__(self, filename="IN.DAT"): diff --git a/process/physics.py b/process/physics.py index adde596c63..f8a58acc85 100644 --- a/process/physics.py +++ b/process/physics.py @@ -3350,7 +3350,7 @@ def outplas(self): po.ovarrf(self.outfile, "Aspect ratio", "(aspect)", physics_variables.aspect) if stellarator_variables.istell == 0: - if physics_variables.ishape in [0, 6, 8]: + if physics_variables.i_plasma_geometry in [0, 6, 8]: po.ovarrf( self.outfile, "Elongation, X-point (input value used)", @@ -3358,7 +3358,7 @@ def outplas(self): physics_variables.kappa, "IP ", ) - elif physics_variables.ishape == 1: + elif physics_variables.i_plasma_geometry == 1: po.ovarrf( self.outfile, "Elongation, X-point (TART scaling)", @@ -3366,7 +3366,7 @@ def outplas(self): physics_variables.kappa, "OP ", ) - elif physics_variables.ishape in [2, 3]: + elif physics_variables.i_plasma_geometry in [2, 3]: po.ovarrf( self.outfile, "Elongation, X-point (Zohm scaling)", @@ -3380,7 +3380,7 @@ def outplas(self): "(fkzohm)", physics_variables.fkzohm, ) - elif physics_variables.ishape in [4, 5, 7]: + elif physics_variables.i_plasma_geometry in [4, 5, 7]: po.ovarrf( self.outfile, "Elongation, X-point (calculated from kappa95)", @@ -3388,7 +3388,7 @@ def outplas(self): physics_variables.kappa, "OP ", ) - elif physics_variables.ishape == 9: + elif physics_variables.i_plasma_geometry == 9: po.ovarrf( self.outfile, "Elongation, X-point (calculated from aspect ratio and li(3))", @@ -3396,7 +3396,7 @@ def outplas(self): physics_variables.kappa, "OP ", ) - elif physics_variables.ishape == 10: + elif physics_variables.i_plasma_geometry == 10: po.ovarrf( self.outfile, "Elongation, X-point (calculated from aspect ratio and stability margin)", @@ -3404,7 +3404,7 @@ def outplas(self): physics_variables.kappa, "OP ", ) - elif physics_variables.ishape == 11: + elif physics_variables.i_plasma_geometry == 11: po.ovarrf( self.outfile, "Elongation, X-point (calculated from aspect ratio via Menard 2016)", @@ -3413,10 +3413,10 @@ def outplas(self): "OP ", ) else: - error_handling.idiags[0] = physics_variables.ishape + error_handling.idiags[0] = physics_variables.i_plasma_geometry po.report_error(86) - if physics_variables.ishape in [4, 5, 7]: + if physics_variables.i_plasma_geometry in [4, 5, 7]: po.ovarrf( self.outfile, "Elongation, 95% surface (input value used)", @@ -3441,7 +3441,7 @@ def outplas(self): "OP ", ) - if physics_variables.ishape in [0, 2, 6, 8, 9, 10, 11]: + if physics_variables.i_plasma_geometry in [0, 2, 6, 8, 9, 10, 11]: po.ovarrf( self.outfile, "Triangularity, X-point (input value used)", @@ -3449,7 +3449,7 @@ def outplas(self): physics_variables.triang, "IP ", ) - elif physics_variables.ishape == 1: + elif physics_variables.i_plasma_geometry == 1: po.ovarrf( self.outfile, "Triangularity, X-point (TART scaling)", @@ -3466,7 +3466,7 @@ def outplas(self): "OP ", ) - if physics_variables.ishape in [3, 4, 5, 7]: + if physics_variables.i_plasma_geometry in [3, 4, 5, 7]: po.ovarrf( self.outfile, "Triangularity, 95% surface (input value used)", @@ -3627,7 +3627,7 @@ def outplas(self): "OP ", ) - if physics_variables.ishape == 1: + if physics_variables.i_plasma_geometry == 1: po.ovarrf( self.outfile, "Lower limit for edge safety factor q", diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index b848b4b96c..f416a4f9f2 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -45,7 +45,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 0 + physics_variables.i_plasma_geometry == 0 ): # Use input kappa, physics_variables.triang values # Rough estimate of 95% values # ITER Physics Design Guidlines: 1989 (Uckan et al. 1990) @@ -58,7 +58,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 1 + physics_variables.i_plasma_geometry == 1 ): # ST scaling with physics_variables.aspect ratio [STAR Code] physics_variables.q95_min = 3.0e0 * ( 1.0e0 + 2.6e0 * physics_variables.eps**2.8e0 @@ -82,7 +82,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 2 + physics_variables.i_plasma_geometry == 2 ): # Zohm et al. ITER scaling for elongation, input physics_variables.triang physics_variables.kappa = physics_variables.fkzohm * min( 2.0e0, 1.5e0 + 0.5e0 / (physics_variables.aspect - 1.0e0) @@ -95,7 +95,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 3 + physics_variables.i_plasma_geometry == 3 ): # Zohm et al. ITER scaling for elongation, input physics_variables.triang95 physics_variables.kappa = physics_variables.fkzohm * min( 2.0e0, 1.5e0 + 0.5e0 / (physics_variables.aspect - 1.0e0) @@ -109,7 +109,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 4 + physics_variables.i_plasma_geometry == 4 ): # Use input kappa95, physics_variables.triang95 values # ITER Physics Design Guidlines: 1989 (Uckan et al. 1990) physics_variables.kappa = 1.12e0 * physics_variables.kappa95 @@ -118,7 +118,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 5 + physics_variables.i_plasma_geometry == 5 ): # Use input kappa95, physics_variables.triang95 values # Fit to MAST data (Issue #1086) physics_variables.kappa = 0.91300e0 * physics_variables.kappa95 + 0.38654e0 @@ -129,7 +129,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 6 + physics_variables.i_plasma_geometry == 6 ): # Use input kappa, physics_variables.triang values # Fit to MAST data (Issue #1086) physics_variables.kappa95 = ( @@ -142,7 +142,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 7 + physics_variables.i_plasma_geometry == 7 ): # Use input kappa95, physics_variables.triang95 values # Fit to FIESTA (Issue #1086) physics_variables.kappa = 0.90698e0 * physics_variables.kappa95 + 0.39467e0 @@ -153,7 +153,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 8 + physics_variables.i_plasma_geometry == 8 ): # Use input kappa, physics_variables.triang values # Fit to FIESTA (Issue #1086) physics_variables.kappa95 = ( @@ -166,7 +166,7 @@ def plasma_geometry(self) -> None: # ====================================================================== if ( - physics_variables.ishape == 9 + physics_variables.i_plasma_geometry == 9 ): # Use input triang, physics_variables.rli values # physics_variables.kappa found from physics_variables.aspect ratio and plasma internal inductance li(3) physics_variables.kappa = (1.09e0 + 0.26e0 / physics_variables.rli) * ( @@ -178,7 +178,7 @@ def plasma_geometry(self) -> None: # ====================================================================== - if physics_variables.ishape == 10: + if physics_variables.i_plasma_geometry == 10: # physics_variables.kappa95 found from physics_variables.aspect ratio and stabilty margin # Based on fit to CREATE data. ref Issue #1399 # valid for EU-DEMO like machine - physics_variables.aspect ratio 2.6 - 3.6 @@ -214,7 +214,7 @@ def plasma_geometry(self) -> None: # ====================================================================== - if physics_variables.ishape == 11: + if physics_variables.i_plasma_geometry == 11: # See Issue #1439 # physics_variables.triang is an input # physics_variables.kappa found from physics_variables.aspect ratio scaling on p32 of Menard: diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index 1b2a59f570..1d996c0952 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -438,7 +438,7 @@ { "no": 86, "level": 3, - "message": "OUTPLAS: Illegal value of ishape" + "message": "OUTPLAS: Illegal value of i_plasma_geometry" }, { "no": 87, diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index 482efdee3c..48f5f6c630 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -2889,8 +2889,8 @@ subroutine constraint_eqn_076(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! alpha_crit : output real : critical ballooning parameter value !! nesep_crit : output real : critical electron density at separatrix [m-3] - !! kappa : input real : plasma separatrix elongation (calculated if ishape = 1-5, 7 or 9) - !! triang : input real : plasma separatrix triangularity (calculated if ishape = 1, 3-5 or 7) + !! kappa : input real : plasma separatrix elongation (calculated if i_plasma_geometry = 1-5, 7 or 9) + !! triang : input real : plasma separatrix triangularity (calculated if i_plasma_geometry = 1, 3-5 or 7) !! aspect : input real : aspect ratio (iteration variable 1) !! pdivt : input real : power to conducted to the divertor region (MW) !! dlimit(7) : input real array : density limit (/m3) as calculated using various models diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 304bdfe7ac..9d57c7824f 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) rhopedt, f_vol_plasma, f_deuterium, ffwal, i_beta_component, itartpf, ilhthresh, & fpdivlim, beta_poloidal_eps_max, isc, kappa95, aspect, cwrmax, nesep, c_beta, csawth, dene, & ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, beta_norm_max, & - fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, f_tritium, & + fgwsep, rhopedn, tratio, q0, i_plasma_geometry, fne0, ignite, f_tritium, & i_beta_fast_alpha, tauee_in, alphaj, alphat, i_plasma_current, q, ti, tesep, rli, triang, & itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & teped, f_helium3, iwalld, gamma, f_alpha_plasma, fgwped, tbeta, i_bootstrap_current, & @@ -666,8 +666,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('i_plasma_wall_gap') call parse_int_variable('i_plasma_wall_gap', i_plasma_wall_gap, 0, 1, & 'Switch for midplane gap between plasma and wall') - case ('ishape') - call parse_int_variable('ishape', ishape, 0, 11, & + case ('i_plasma_geometry') + call parse_int_variable('i_plasma_geometry', i_plasma_geometry, 0, 11, & 'Switch for plasma shape vs. aspect') case ('itart') call parse_int_variable('itart', itart, 0, 1, & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index cf806934fc..53fe0e496e 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -233,7 +233,7 @@ module physics_variables !! physics figure of merit (= plasma_current*aspect**sbar, where `sbar=1`) real(dp) :: fkzohm - !! Zohm elongation scaling adjustment factor (`ishape=2, 3`) + !! Zohm elongation scaling adjustment factor (`i_plasma_geometry=2, 3`) real(dp) :: fplhsep !! F-value for Psep >= Plh + Paux (`constraint equation 73`) @@ -529,7 +529,7 @@ module physics_variables !! - =0 use 10% of plasma minor radius !! - =1 use input (`scrapli` and `scraplo`) - integer :: ishape + integer :: i_plasma_geometry !! switch for plasma cross-sectional shape calculation: !! !! - =0 use input kappa, triang to calculate 95% values @@ -564,10 +564,10 @@ module physics_variables !! - =2 use first wall area directly real(dp) :: kappa - !! plasma separatrix elongation (calculated if `ishape = 1-5, 7 or 9-10`) + !! plasma separatrix elongation (calculated if `i_plasma_geometry = 1-5, 7 or 9-10`) real(dp) :: kappa95 - !! plasma elongation at 95% surface (calculated if `ishape = 0-3, 6, or 8-10`) + !! plasma elongation at 95% surface (calculated if `i_plasma_geometry = 0-3, 6, or 8-10`) real(dp) :: kappaa !! plasma elongation calculated as a_plasma_poloidal/(pi.a^2) @@ -897,10 +897,10 @@ module physics_variables !! ion temperature / electron temperature(used to calculate ti if `tratio > 0.0` real(dp) :: triang - !! plasma separatrix triangularity (calculated if `ishape = 1, 3-5 or 7`) + !! plasma separatrix triangularity (calculated if `i_plasma_geometry = 1, 3-5 or 7`) real(dp) :: triang95 - !! plasma triangularity at 95% surface (calculated if `ishape = 0-2, 6, 8 or 9`) + !! plasma triangularity at 95% surface (calculated if `i_plasma_geometry = 0-2, 6, 8 or 9`) real(dp) :: vol_plasma !! plasma volume (m3) @@ -1046,7 +1046,7 @@ subroutine init_physics_variables iradloss = 1 isc = 34 i_plasma_wall_gap = 1 - ishape = 0 + i_plasma_geometry = 0 itart = 0 itartpf = 0 iwalld = 1 diff --git a/source/fortran/scan.f90 b/source/fortran/scan.f90 index 3e3449e1e1..270f8bba33 100644 --- a/source/fortran/scan.f90 +++ b/source/fortran/scan.f90 @@ -326,7 +326,7 @@ subroutine scan_1d_write_plot(iscan, outvar) plabel(13) = 'B_Toroidal_Axis_(T)______' plabel(14) = 'B_total_on_axis_(T)______' plabel(15) = 'Safety_Factor____________' - plabel(16) = 'q95_min_(zero_if_ishape=0)__' + plabel(16) = 'q95_min_(zero_if_i_plasma_geometry=0)__' plabel(17) = 'Beta_____________________' plabel(18) = 'Beta_Limit_______________' plabel(19) = 'Epsilon_Beta_Poloidal____' @@ -514,7 +514,7 @@ subroutine scan_2d_write_plot(iscan, outvar, sweep_1_vals, sweep_2_vals) plabel(13) = 'B_Toroidal_Axis_(T)______' plabel(14) = 'B_total_on_axis_(T)______' plabel(15) = 'Safety_Factor____________' - plabel(16) = 'q95_min_(zero_if_ishape=0)__' + plabel(16) = 'q95_min_(zero_if_i_plasma_geometry=0)__' plabel(17) = 'Beta_____________________' plabel(18) = 'Beta_Limit_______________' plabel(19) = 'Epsilon_Beta_Poloidal____' diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 5e42e9952b..443aa0dc3d 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -1537,7 +1537,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1554,7 +1554,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 296cf30e8c..b03f73eba2 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -1538,7 +1538,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1555,7 +1555,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 11a8d4966a..0536e43984 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -1538,7 +1538,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1555,7 +1555,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 95e68a29c8..769426d472 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -1538,7 +1538,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1555,7 +1555,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/integration/data/large_tokamak_IN.DAT b/tests/integration/data/large_tokamak_IN.DAT index 81000b7649..fe14ce4fbc 100644 --- a/tests/integration/data/large_tokamak_IN.DAT +++ b/tests/integration/data/large_tokamak_IN.DAT @@ -348,7 +348,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -365,7 +365,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 3919d2f756..a407b53233 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -1539,7 +1539,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1556,7 +1556,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/integration/data/large_tokamak_once_through.IN.DAT b/tests/integration/data/large_tokamak_once_through.IN.DAT index c911fb1ce3..a9bd6d5582 100644 --- a/tests/integration/data/large_tokamak_once_through.IN.DAT +++ b/tests/integration/data/large_tokamak_once_through.IN.DAT @@ -320,7 +320,7 @@ bt = 5.318322174644904 * toroidal field on axis (T) (`iteration variable 2 dene = 7.796223900029837e+19 * electron density (/m3) (`iteration variable 6`) beta_norm_max = 3.0 * Troyon-like coefficient for beta scaling calculated fgwsep = 0.5 * fraction of Greenwald density to set as separatrix density; If `<0`; separatrix -fkzohm = 1.02 * Zohm elongation scaling adjustment factor (`ishape=2; 3`) +fkzohm = 1.02 * Zohm elongation scaling adjustment factor (`i_plasma_geometry=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`); @@ -341,8 +341,8 @@ teped = 5.5 * electron temperature of pedestal (keV) (`ipedestal==1') tesep = 0.1 * electron temperature at separatrix (keV) (`ipedestal==1`) calculated if reinke iprofile = 1 * switch for current profile consistency; isc = 34 * switch for energy confinement time scaling law (see description in `tauscl`) -ishape = 0 * switch for plasma cross-sectional shape calculation; -kappa = 1.85 * plasma separatrix elongation (calculated if `ishape = 1-5; 7 or 9-10`) +i_plasma_geometry = 0 * switch for plasma cross-sectional shape calculation; +kappa = 1.85 * plasma separatrix elongation (calculated if `i_plasma_geometry = 1-5; 7 or 9-10`) q = 3.7339078193128556 * Safety factor 'near' plasma edge (`iteration variable 18`) equal to q95 q0 = 1.0 * safety factor on axis ralpne = 0.060238763988650204 * thermal alpha density/electron density (`iteration variable 109`) @@ -350,7 +350,7 @@ rmajor = 8.0 * plasma major radius (m) (`iteration variable 3`) i_single_null = 1 * switch for single null / double null plasma; ssync = 0.6 * synchrotron wall reflectivity factor te = 12.221383528378944 * volume averaged electron temperature (keV) (`iteration variable 4`) -triang = 0.5 * plasma separatrix triangularity (calculated if `ishape = 1; 3-5 or 7`) +triang = 0.5 * plasma separatrix triangularity (calculated if `i_plasma_geometry = 1; 3-5 or 7`) *----------------------Power-----------------------* diff --git a/tests/integration/data/ref_IN.DAT b/tests/integration/data/ref_IN.DAT index 3d6cc37df6..278219d5d3 100644 --- a/tests/integration/data/ref_IN.DAT +++ b/tests/integration/data/ref_IN.DAT @@ -255,7 +255,7 @@ alphat = 1.45 * Temperature profile index aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; -fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) +fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=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) @@ -277,10 +277,10 @@ teped = 5.5 * Electron temperature of pedestal (kev) (ipedestal=1) tesep = 0.1 * Electron temperature at separatrix (kev) (ipedestal=1) iprofile = 1 * Switch for current profile consistency; isc = 34 * Switch for energy confinement time scaling law -ishape = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang +i_plasma_geometry = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang *kappa = 1.7808 kappa = 1.848 -triang = 0.5 * Plasma separatrix triangularity (calculated if ishape=1; 3 or 4) +triang = 0.5 * Plasma separatrix triangularity (calculated if i_plasma_geometry=1; 3 or 4) q = 3.247 * Safety factor 'near' plasma edge (iteration variable 18); q0 = 1.0 * Safety factor on axis rmajor = 9.072 * Plasma major radius (m) (iteration variable 3) diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 4d3f34b84c..a29b8f3a53 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -17824,7 +17824,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -17841,7 +17841,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index ad0794d941..10b5d6dae7 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -9234,7 +9234,7 @@ alphat = 1.45 * Temperature profile index aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; -fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) +fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=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) @@ -9256,10 +9256,10 @@ teped = 5.5 * Electron temperature of pedestal (kev) (ipedestal=1) tesep = 0.1 * Electron temperature at separatrix (kev) (ipedestal=1) iprofile = 1 * Switch for current profile consistency; isc = 34 * Switch for energy confinement time scaling law -ishape = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang +i_plasma_geometry = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang *kappa = 1.7808 kappa = 1.848 -triang = 0.5 * Plasma separatrix triangularity (calculated if ishape=1; 3 or 4) +triang = 0.5 * Plasma separatrix triangularity (calculated if i_plasma_geometry=1; 3 or 4) q = 3.247 * Safety factor 'near' plasma edge (iteration variable 18); q0 = 1.0 * Safety factor on axis rmajor = 9.072 * Plasma major radius (m) (iteration variable 3) diff --git a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT index ad212fe893..a8b2bf30e5 100644 --- a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT +++ b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT @@ -255,7 +255,7 @@ alphat = 1.45 * Temperature profile index aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; -fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) +fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=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) @@ -277,10 +277,10 @@ teped = 5.5 * Electron temperature of pedestal (kev) (ipedestal=1) tesep = 0.1 * Electron temperature at separatrix (kev) (ipedestal=1) iprofile = 1 * Switch for current profile consistency; isc = 34 * Switch for energy confinement time scaling law -ishape = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang +i_plasma_geometry = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang *kappa = 1.7808 kappa = 1.848 -triang = 0.5 * Plasma separatrix triangularity (calculated if ishape=1; 3 or 4) +triang = 0.5 * Plasma separatrix triangularity (calculated if i_plasma_geometry=1; 3 or 4) q = 3.247 * Safety factor 'near' plasma edge (iteration variable 18); q0 = 1.0 * Safety factor on axis rmajor = 9.072 * Plasma major radius (m) (iteration variable 3) diff --git a/tests/integration/data/uncertainties_ref_IN.DAT b/tests/integration/data/uncertainties_ref_IN.DAT index d6a97fbe73..ee0314be51 100644 --- a/tests/integration/data/uncertainties_ref_IN.DAT +++ b/tests/integration/data/uncertainties_ref_IN.DAT @@ -255,7 +255,7 @@ alphat = 1.45 * Temperature profile index aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; -fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (ishape=2; 3) +fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=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) @@ -277,10 +277,10 @@ teped = 5.5 * Electron temperature of pedestal (kev) (ipedestal=1) tesep = 0.1 * Electron temperature at separatrix (kev) (ipedestal=1) iprofile = 1 * Switch for current profile consistency; isc = 34 * Switch for energy confinement time scaling law -ishape = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang +i_plasma_geometry = 0 * Switch for plasma cross-sectional shape calculation: use input kappa & triang *kappa = 1.7808 kappa = 1.848 -triang = 0.5 * Plasma separatrix triangularity (calculated if ishape=1; 3 or 4) +triang = 0.5 * Plasma separatrix triangularity (calculated if i_plasma_geometry=1; 3 or 4) q = 3.247 * Safety factor 'near' plasma edge (iteration variable 18); q0 = 1.0 * Safety factor on axis rmajor = 9.072 * Plasma major radius (m) (iteration variable 3) diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index bf80b1981b..4a2747e6f6 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -2670,7 +2670,7 @@ "iscenr": 2.0, "i_plasma_wall_gap": 1.0, "iscz": 0.0, - "ishape": 0.0, + "i_plasma_geometry": 0.0, "istell": 0.0, "isthtr": 3.0, "istore": 1.0, @@ -9571,7 +9571,7 @@ "fjohc0": "f-value for central solenoid current at beginning of pulse\n (`constraint equation 27`, `iteration variable 39`)", "fjprot": "f-value for TF coil winding pack current density\n (`constraint equation 35`, `iteration variable 53`)", "fkind": "multiplier for Nth of a kind costs", - "fkzohm": "Zohm elongation scaling adjustment factor (`ishape=2, 3`)", + "fkzohm": "Zohm elongation scaling adjustment factor (`i_plasma_geometry=2, 3`)", "flhthresh": "f-value for L-H power threshold (`constraint equation 15`, `iteration variable 103`)", "flirad": "radius of FLiBe/lithium inlet (m) (`ifetyp=3,4`)", "flpitch": "field line pitch (rad)", @@ -9911,7 +9911,7 @@ "iscenr": "Switch for PF coil energy storage option:\n
      \n
    • =1 all power from MGF (motor-generator flywheel) units
    • \n
    • =2 all pulsed power from line
    • \n
    • =3 PF power from MGF, heating from line
    • \n
    ", "i_plasma_wall_gap": "switch for plasma-first wall clearances:\n
      \n
    • =0 use 10% of rminor
    • \n
    • =1 use input (scrapli and scraplo)
    • \n
    ", "iscz": "", - "ishape": "switch for plasma cross-sectional shape calculation:\n
      \n
    • =0 use input kappa, triang to calculate 95% values
    • \n
    • =1 scale q95_min, kappa, triang with aspect ratio (ST)
    • \n
    • =2 set kappa to the natural elongation value (Zohm ITER scaling), triang input
    • \n
    • =3 set kappa to the natural elongation value (Zohm ITER scaling), triang95 input
    • \n
    • =4 use input kappa95, triang95 to calculate separatrix values
    • \n
    • =5 use input kappa95, triang95 to calculate separatrix values based on MAST scaling (ST)
    • \n
    • =6 use input kappa, triang to calculate 95% values based on MAST scaling (ST)
    • \n
    • =7 use input kappa95, triang95 to calculate separatrix values based on fit to FIESTA (ST)
    • \n
    • =8 use input kappa, triang to calculate 95% values based on fit to FIESTA (ST)
    • \n
    • =9 set kappa to the natural elongation value, triang input
    • \n
    • =10 set kappa to maximum stable value at a given aspect ratio (2.6\n
    • =11 set kappa Menard 2016 aspect-ratio-dependent scaling, triang input (#1439)
    • \n
    ", + "i_plasma_geometry": "switch for plasma cross-sectional shape calculation:\n
      \n
    • =0 use input kappa, triang to calculate 95% values
    • \n
    • =1 scale q95_min, kappa, triang with aspect ratio (ST)
    • \n
    • =2 set kappa to the natural elongation value (Zohm ITER scaling), triang input
    • \n
    • =3 set kappa to the natural elongation value (Zohm ITER scaling), triang95 input
    • \n
    • =4 use input kappa95, triang95 to calculate separatrix values
    • \n
    • =5 use input kappa95, triang95 to calculate separatrix values based on MAST scaling (ST)
    • \n
    • =6 use input kappa, triang to calculate 95% values based on MAST scaling (ST)
    • \n
    • =7 use input kappa95, triang95 to calculate separatrix values based on fit to FIESTA (ST)
    • \n
    • =8 use input kappa, triang to calculate 95% values based on fit to FIESTA (ST)
    • \n
    • =9 set kappa to the natural elongation value, triang input
    • \n
    • =10 set kappa to maximum stable value at a given aspect ratio (2.6\n
    • =11 set kappa Menard 2016 aspect-ratio-dependent scaling, triang input (#1439)
    • \n
    ", "istell": "Switch for stellarator option (set via `device.dat`):\n
      \n
    • =0 use tokamak model
    • \n
    • =1 use stellarator model: Helias5-b
    • \n
    • =2 use stellarator model: Helias4-b
    • \n
    • =3 use stellarator model: Helias3-b
    • \n
    ", "isthtr": "Switch for stellarator auxiliary heating method:\n
      \n
    • = 1electron cyclotron resonance heating
    • \n
    • = 2lower hybrid heating
    • \n
    • = 3neutral beam injection
    • \n
    ", "istore": "Switch for thermal storage method:\n
      \n
    • =1 option 1 of Electrowatt report, AEA FUS 205
    • \n
    • =2 option 2 of Electrowatt report, AEA FUS 205
    • \n
    • =3 stainless steel block
    • \n
    ", @@ -9951,9 +9951,9 @@ "kallenbach_switch": "switch to turn on the 1D Kallenbach divertor model:\n
      \n
    • =1 on
    • \n
    • =0 off
    • \n
    ", "kallenbach_test_option": "switch to choose kallenbach test option:\n
      \n
    • =0 Test case with user inputs
    • \n
    • =1 Test case for Kallenbach paper
    • \n
    ", "kallenbach_tests": "switch to run tests of 1D Kallenbach divertor model:\n
      \n
    • =1 on
    • \n
    • =0 off
    • \n
    ", - "kappa": "plasma separatrix elongation (calculated if `ishape = 1-5, 7 or 9-10`)", + "kappa": "plasma separatrix elongation (calculated if `i_plasma_geometry = 1-5, 7 or 9-10`)", "kappa0": "", - "kappa95": "plasma elongation at 95% surface (calculated if `ishape = 0-3, 6, or 8-10`)", + "kappa95": "plasma elongation at 95% surface (calculated if `i_plasma_geometry = 0-3, 6, or 8-10`)", "kappaa": "plasma elongation calculated as a_plasma_poloidal/(pi.a^2)", "kappaa_IPB": "Volume measure of plasma elongation", "keV_": "", @@ -10875,8 +10875,8 @@ "transp_clrnc": "transportation clearance between components (m)", "tratio": "ion temperature / electron temperature(used to calculate ti if `tratio > 0.0`", "trcl": "transportation clearance between components (m)", - "triang": "plasma separatrix triangularity (calculated if `ishape = 1, 3-5 or 7`)", - "triang95": "plasma triangularity at 95% surface (calculated if `ishape = 0-2, 6, 8 or 9`)", + "triang": "plasma separatrix triangularity (calculated if `i_plasma_geometry = 1, 3-5 or 7`)", + "triang95": "plasma triangularity at 95% surface (calculated if `i_plasma_geometry = 0-2, 6, 8 or 9`)", "trithtmw": "power required for tritium processing (MW)", "tritprate": "tritium production rate (g/day) (`iblanket=2` (KIT HCPB))", "triv": "volume of tritium, fuel handling and health physics buildings (m3)", @@ -13505,7 +13505,7 @@ "lb": 0, "ub": 1 }, - "ishape": { + "i_plasma_geometry": { "lb": 0, "ub": 11 }, @@ -19164,7 +19164,7 @@ "isc", "tauscl", "i_plasma_wall_gap", - "ishape", + "i_plasma_geometry", "itart", "itartpf", "iwalld", @@ -20508,7 +20508,7 @@ "isc": "int_variable", "iscenr": "int_variable", "i_plasma_wall_gap": "int_variable", - "ishape": "int_variable", + "i_plasma_geometry": "int_variable", "istell": "int_variable", "isthtr": "int_variable", "istore": "int_variable", diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT index 05bb940e1b..384d0115c1 100644 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ b/tests/regression/input_files/large_tokamak.IN.DAT @@ -348,7 +348,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -365,7 +365,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index f642573aec..3d5d56b19b 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -330,7 +330,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -347,7 +347,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula 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 6a135e9dbb..340d176d19 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -320,7 +320,7 @@ bt = 5.318322174644904 * toroidal field on axis (T) (`iteration variable 2 dene = 7.796223900029837e+19 * electron density (/m3) (`iteration variable 6`) beta_norm_max = 3.0 * Troyon-like coefficient for beta scaling calculated fgwsep = 0.5 * fraction of Greenwald density to set as separatrix density; If `<0`; separatrix -fkzohm = 1.02 * Zohm elongation scaling adjustment factor (`ishape=2; 3`) +fkzohm = 1.02 * Zohm elongation scaling adjustment factor (`i_plasma_geometry=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`); @@ -341,8 +341,8 @@ teped = 5.5 * electron temperature of pedestal (keV) (`ipedestal==1') tesep = 0.1 * electron temperature at separatrix (keV) (`ipedestal==1`) calculated if reinke iprofile = 1 * switch for current profile consistency; isc = 34 * switch for energy confinement time scaling law (see description in `tauscl`) -ishape = 0 * switch for plasma cross-sectional shape calculation; -kappa = 1.85 * plasma separatrix elongation (calculated if `ishape = 1-5; 7 or 9-10`) +i_plasma_geometry = 0 * switch for plasma cross-sectional shape calculation; +kappa = 1.85 * plasma separatrix elongation (calculated if `i_plasma_geometry = 1-5; 7 or 9-10`) q = 3.7339078193128556 * Safety factor 'near' plasma edge (`iteration variable 18`) equal to q95 q0 = 1.0 * safety factor on axis ralpne = 0.060238763988650204 * thermal alpha density/electron density (`iteration variable 109`) @@ -350,7 +350,7 @@ rmajor = 8.0 * plasma major radius (m) (`iteration variable 3`) i_single_null = 1 * switch for single null / double null plasma; ssync = 0.6 * synchrotron wall reflectivity factor te = 12.221383528378944 * volume averaged electron temperature (keV) (`iteration variable 4`) -triang = 0.5 * plasma separatrix triangularity (calculated if `ishape = 1; 3-5 or 7`) +triang = 0.5 * plasma separatrix triangularity (calculated if `i_plasma_geometry = 1; 3-5 or 7`) *----------------------Power-----------------------* diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index a9d9f82617..e258d7e149 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -176,7 +176,7 @@ aspect = 1.8 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -ishape = 0 +i_plasma_geometry = 0 * DESCRIPTION: Switch for plasma shape vs. aspect (default = 0) * =0 use input kappa, triang to calculate 95% values * =1 scale q95_min, kappa, triang with aspect ratio (ST) @@ -198,7 +198,7 @@ kappa = 2.8 *kappa95 = * DESCRIPTION: Plasma 95% elongation -* JUSTIFICATION: Not set, calculated as ishape=0 +* JUSTIFICATION: Not set, calculated as i_plasma_geometry=0 triang = 0.5 * DESCRIPTION: Plasma Separatrix Triangularity @@ -206,15 +206,15 @@ triang = 0.5 *triang95 = * DESCRIPTION: Plasma 95% triangularity -* JUSTIFICATION: Not set, calculated as ishape=0 +* JUSTIFICATION: Not set, calculated as i_plasma_geometry=0 *fkzohm = -* DESCRIPTION: Zohm elongation scaling multiplier (ishape 2,3) -* JUSTIFICATION: Not scaling plasma shape. Used when ishape=2,3 +* DESCRIPTION: Zohm elongation scaling multiplier (i_plasma_geometry 2,3) +* JUSTIFICATION: Not scaling plasma shape. Used when i_plasma_geometry=2,3 *m_s_limit = -* DESCRIPTION: Margin to vertical stability (ishape = 10) -* JUSTIFICATION: Not used, not using ishape=10 +* DESCRIPTION: Margin to vertical stability (i_plasma_geometry = 10) +* JUSTIFICATION: Not used, not using i_plasma_geometry=10 *f_vol_plasma = 1.0 * DESCRIPTION: Plasma volume multiplier @@ -390,7 +390,7 @@ q0 = 2.0 * JUSTIFICATION: * icc = 45 -* DESCRIPTION: Constraint equation for edge safety factor lower limit (TART) (ishape = 1) +* DESCRIPTION: Constraint equation for edge safety factor lower limit (TART) (i_plasma_geometry = 1) * JUSTIFICATION: Not used, dont care about q at edge lower limit * VARIABLES: itart, q95_min (lower limit for edge safety factor). q calculated in-situ diff --git a/tests/unit/data/large_tokamak_IN.DAT b/tests/unit/data/large_tokamak_IN.DAT index b13db006c7..a4d0e3330c 100644 --- a/tests/unit/data/large_tokamak_IN.DAT +++ b/tests/unit/data/large_tokamak_IN.DAT @@ -348,7 +348,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -365,7 +365,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index b4c0187b25..64f64c92e5 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -1539,7 +1539,7 @@ aspect = 3.0 hfact = 1.1 * Switch for plasma cross-sectional shape calc - use input kappa & triang -ishape = 0 +i_plasma_geometry = 0 * Plasma elongation [-] kappa = 1.85 @@ -1556,7 +1556,7 @@ alphat = 1.45 * (troyon-like) coefficient for beta scaling beta_norm_max = 3.0 -* Zohm elongation scaling adjustment factor (ishape=2; 3) +* Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) fkzohm = 1.02 * Ejima coefficient for resistive startup V-s formula From f3797a282e0a14fa655e0e3e85f96006523cafe1 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 14:56:08 +0000 Subject: [PATCH 15/38] :sparkle: Add 'i_plasma_shape' variable for plasma boundary shape selection --- source/fortran/input.f90 | 5 ++++- source/fortran/physics_variables.f90 | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 9d57c7824f..0380421cc0 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) rhopedt, f_vol_plasma, f_deuterium, ffwal, i_beta_component, itartpf, ilhthresh, & fpdivlim, beta_poloidal_eps_max, isc, kappa95, aspect, cwrmax, nesep, c_beta, csawth, dene, & ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, beta_norm_max, & - fgwsep, rhopedn, tratio, q0, i_plasma_geometry, fne0, ignite, f_tritium, & + fgwsep, rhopedn, tratio, q0, i_plasma_geometry, i_plasma_shape, fne0, ignite, f_tritium, & i_beta_fast_alpha, tauee_in, alphaj, alphat, i_plasma_current, q, ti, tesep, rli, triang, & itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & teped, f_helium3, iwalld, gamma, f_alpha_plasma, fgwped, tbeta, i_bootstrap_current, & @@ -669,6 +669,9 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('i_plasma_geometry') call parse_int_variable('i_plasma_geometry', i_plasma_geometry, 0, 11, & 'Switch for plasma shape vs. aspect') + case ('i_plasma_shape') + call parse_int_variable('i_plasma_shape', i_plasma_shape, 0, 1, & + 'Switch for plasma outline shape') case ('itart') call parse_int_variable('itart', itart, 0, 1, & 'Switch for tight aspect ratio physics') diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 53fe0e496e..e9f3c1bc29 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -530,7 +530,7 @@ module physics_variables !! - =1 use input (`scrapli` and `scraplo`) integer :: i_plasma_geometry - !! switch for plasma cross-sectional shape calculation: + !! switch for plasma elongation and triangularity calculations: !! !! - =0 use input kappa, triang to calculate 95% values !! - =1 scale q95_min, kappa, triang with aspect ratio (ST) @@ -545,6 +545,12 @@ module physics_variables !! - =10 set kappa to maximum stable value at a given aspect ratio (2.6 Date: Fri, 17 Jan 2025 15:05:02 +0000 Subject: [PATCH 16/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'xvol'=20to=20'pl?= =?UTF-8?q?asma=5Fvolume'=20for=20consistency=20in=20plasma=20volume=20cal?= =?UTF-8?q?culations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../physics-models/plasma_geometry.md | 2 +- process/plasma_geometry.py | 19 +++++++++++-------- tests/unit/test_plasma_geom.py | 16 +++++++++------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 8483ce2b3a..a051e6784e 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -383,7 +383,7 @@ $$ 2.0\pi a} $$ -### Plasma Volume | `xvol()` +### Plasma Volume | `plasma_volume()` The plasma volume is calculated using the `xvol` method with the inputted $R_0$ & $a$ along with the outputs of `plasma_angles_arcs()`. The `f_vol_plasma` iteration variable can be used to scale this output diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index f416a4f9f2..d81904fccd 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -283,13 +283,16 @@ def plasma_geometry(self) -> None: ) # Volume - physics_variables.vol_plasma = physics_variables.f_vol_plasma * self.xvol( - physics_variables.rmajor, - physics_variables.rminor, - xi, - thetai, - xo, - thetao, + physics_variables.vol_plasma = ( + physics_variables.f_vol_plasma + * self.plasma_volume( + physics_variables.rmajor, + physics_variables.rminor, + xi, + thetai, + xo, + thetao, + ) ) # Cross-sectional area @@ -383,7 +386,7 @@ def xsurf( return xsi, xso @staticmethod - def xvol(rmajor, rminor, xi, thetai, xo, thetao): + def plasma_volume(rmajor, rminor, xi, thetai, xo, thetao): """ Plasma volume calculation author: P J Knight, CCFE, Culham Science Centre diff --git a/tests/unit/test_plasma_geom.py b/tests/unit/test_plasma_geom.py index c4ae1af616..c0131560c1 100644 --- a/tests/unit/test_plasma_geom.py +++ b/tests/unit/test_plasma_geom.py @@ -119,7 +119,7 @@ def test_perim(a, kap, tri, expected_perim): @pytest.mark.parametrize( - "rmajor, rminor, xi, thetai, xo, thetao, expected_xvol", + "rmajor, rminor, xi, thetai, xo, thetao, expected_plasma_volume", [ ( 9.2995201822511735, @@ -132,8 +132,10 @@ def test_perim(a, kap, tri, expected_perim): ) ], ) -def test_xvol(rmajor, rminor, xi, thetai, xo, thetao, expected_xvol, plasma): - """Tests `xvol` function. +def test_plasma_volume( + rmajor, rminor, xi, thetai, xo, thetao, expected_plasma_volume, plasma +): + """Tests `plasma_volume()` function. :param rmajor: test asset passed to the routine representing the plasma major radius (m). :type rmajor: float @@ -152,12 +154,12 @@ def test_xvol(rmajor, rminor, xi, thetai, xo, thetao, expected_xvol, plasma): :param thetao: test asset passed to the routine representing the half-angle of arc describing outboard surface. :type thetao: float - :param expected_xvol: expected result of the function. - :type expected_xvol: float + :param expected_plasma_volume: expected result of the function. + :type expected_plasma_volume: float """ - xvol = plasma.xvol(rmajor, rminor, xi, thetai, xo, thetao) + plasma_volume = plasma.plasma_volume(rmajor, rminor, xi, thetai, xo, thetao) - assert pytest.approx(xvol) == expected_xvol + assert pytest.approx(plasma_volume) == expected_plasma_volume @pytest.mark.parametrize( From cbb59b27fbee5388d7250d8dd33e02098d825b8c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 15:10:06 +0000 Subject: [PATCH 17/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'xsecta'=20to=20'?= =?UTF-8?q?plasma=5Fcross=5Fsection'=20for=20consistency=20in=20plasma=20g?= =?UTF-8?q?eometry=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proc-pages/physics-models/plasma_geometry.md | 2 +- process/plasma_geometry.py | 16 ++++++++++------ tests/unit/test_plasma_geom.py | 16 +++++++++------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index a051e6784e..83eac26ec1 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -422,7 +422,7 @@ $$ \mathtt{xvol} = \mathtt{vout}-\mathtt{vin} $$ -### Plasma cross-sectional area | `xsecta()` +### Plasma cross-sectional area | `plasma_cross_section()` This function finds the plasma cross-sectional area, using the revolution of two intersecting arcs around the device centreline. diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index d81904fccd..8a9e5f5799 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -296,7 +296,9 @@ def plasma_geometry(self) -> None: ) # Cross-sectional area - physics_variables.a_plasma_poloidal = self.xsecta(xi, thetai, xo, thetao) + physics_variables.a_plasma_poloidal = self.plasma_cross_section( + xi, thetai, xo, thetao + ) # Surface area - sum of inboard and outboard. physics_variables.a_plasma_surface = xsi + xso @@ -444,7 +446,9 @@ def plasma_volume(rmajor, rminor, xi, thetai, xo, thetao): return xvol @staticmethod - def xsecta(xi: float, thetai: float, xo: float, thetao: float) -> float: + def plasma_cross_section( + xi: float, thetai: float, xo: float, thetao: float + ) -> float: """ Plasma cross-sectional area calculation author: P J Knight, CCFE, Culham Science Centre @@ -466,11 +470,11 @@ def xsecta(xi: float, thetai: float, xo: float, thetao: float) -> float: - F/MI/PJK/LOGBOOK14, p.41 """ - xsecta = xo**2 * (thetao - np.cos(thetao) * np.sin(thetao)) + xi**2 * ( - thetai - np.cos(thetai) * np.sin(thetai) - ) + plasma_cross_section = xo**2 * ( + thetao - np.cos(thetao) * np.sin(thetao) + ) + xi**2 * (thetai - np.cos(thetai) * np.sin(thetai)) - return xsecta + return plasma_cross_section @staticmethod def sauter_geometry( diff --git a/tests/unit/test_plasma_geom.py b/tests/unit/test_plasma_geom.py index c0131560c1..81450370f0 100644 --- a/tests/unit/test_plasma_geom.py +++ b/tests/unit/test_plasma_geom.py @@ -163,7 +163,7 @@ def test_plasma_volume( @pytest.mark.parametrize( - "xi, thetai, xo ,thetao, expected_xsecta", + "xi, thetai, xo ,thetao, expected_plasma_cross_section", [ ( 10.261919050584332, @@ -174,8 +174,10 @@ def test_plasma_volume( ) ], ) -def test_xsecta(xi, thetai, xo, thetao, expected_xsecta, plasma): - """Tests `xsecta` function. +def test_plasma_cross_section( + xi, thetai, xo, thetao, expected_plasma_cross_section, plasma +): + """Tests `plasma_cross_section()` function. :param xi: test asset passed to the routine representing the radius of arc describing inboard surface (m). :type xi: float @@ -188,12 +190,12 @@ def test_xsecta(xi, thetai, xo, thetao, expected_xsecta, plasma): :param thetao: test asset passed to the routine representing the half-angle of arc describing outboard surface. :type thetao: float - :param expected_xsecta: expected result of the function. - :type expected_xsecta: float + :param expected_plasma_cross_section: expected result of the function. + :type expected_plasma_cross_section: float """ - xsecta = plasma.xsecta(xi, thetai, xo, thetao) + plasma_cross_section = plasma.plasma_cross_section(xi, thetai, xo, thetao) - assert pytest.approx(xsecta) == expected_xsecta + assert pytest.approx(plasma_cross_section) == expected_plasma_cross_section @pytest.mark.parametrize( From b60b1484ece99b857fc0d5029cafc930e7c792aa Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 16:06:05 +0000 Subject: [PATCH 18/38] :fire: Remove `sf` variable and put calculation directly into function where it is used --- .../plasma_current/plasma_current.md | 4 +- .../physics-models/plasma_geometry.md | 11 ----- process/physics.py | 19 +++++---- process/plasma_geometry.py | 41 ++++++++----------- source/fortran/physics_variables.f90 | 4 -- tests/integration/ref_dicts.json | 3 -- tests/unit/test_physics.py | 5 --- 7 files changed, 30 insertions(+), 57 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 5c7a6825a2..3172f5cf01 100644 --- a/documentation/proc-pages/physics-models/plasma_current/plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/plasma_current.md @@ -116,9 +116,9 @@ 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$$ +$$f_q = \left(\frac{{1.22 - 0.68 \epsilon}}{{(1.0 - \epsilon^2)^2}}\right) \left(\frac{L_{\text{poloidal}}}{2\pi a}\right)^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` +Where $\epsilon$ is the inverse [aspect ratio](../plasma_geometry.md) ($\mathtt{eps}$) and $L_{\text{poloidal}}$ is the poloidal perimeter of the plasma. ----------- diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 83eac26ec1..a1de13d877 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -346,12 +346,6 @@ $$ \mathtt{len_plasma_poloidal} = 2.0\pi a (1 + 0.55 (\kappa - 1))(1 + 0.08 \delta^2)(1 + 0.2 (\mathtt{w07} - 1)) $$ -A geometric factor - -$$ -\mathtt{sf} = \frac{\mathtt{len_plasma_poloidal}}{2.0\pi a} -$$ - Surface area (named Ap in Sauter) $$ @@ -377,11 +371,6 @@ $$ \mathtt{len_plasma_poloidal} = 2.0 \times (\mathtt{xo} \times \mathtt{thetao} + \mathtt{xi} \times \mathtt{thetai}) $$ -The shaping factor for `i_plasma_current = 1` is also calculated here: -$$ -\mathtt{sf} = \frac{\mathtt{len_plasma_poloidal}}{ - 2.0\pi a} -$$ ### Plasma Volume | `plasma_volume()` diff --git a/process/physics.py b/process/physics.py index f8a58acc85..151c0d7aab 100644 --- a/process/physics.py +++ b/process/physics.py @@ -295,18 +295,26 @@ def calculate_poloidal_field( return bt * (ff1 + ff2) / (2.0 * np.pi * qbar) -def calculate_current_coefficient_peng(eps: float, sf: float) -> float: +def calculate_current_coefficient_peng( + eps: float, len_plasma_poloidal: float, rminor: 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 + - len_plasma_poloidal: float, plasma poloidal perimeter length [m] + - rminor: float, plasma minor radius [m] References: - None """ - return (1.22 - 0.68 * eps) / ((1.0 - eps * eps) ** 2) * sf**2 + + return ( + (1.22 - 0.68 * eps) + / ((1.0 - eps * eps) ** 2) + * (len_plasma_poloidal / (2.0 * np.pi * rminor)) ** 2 + ) def calculate_plasma_current_peng( @@ -1516,7 +1524,6 @@ def physics(self): physics_variables.rli, physics_variables.rmajor, physics_variables.rminor, - physics_variables.sf, physics_variables.triang, physics_variables.triang95, ) @@ -3039,7 +3046,6 @@ def calculate_plasma_current( rli: float, rmajor: float, rminor: float, - sf: float, triang: float, triang95: float, ) -> tuple[float, float, float, float, float]: @@ -3076,7 +3082,6 @@ def calculate_plasma_current( rli (float): Plasma normalised internal inductance. rmajor (float): Major radius (m). rminor (float): Minor radius (m). - sf (float): Shape factor for i_plasma_current=1 (=A/pi in documentation). triang (float): Plasma triangularity. triang95 (float): Plasma triangularity at 95% surface. @@ -3115,7 +3120,7 @@ def calculate_plasma_current( # Peng analytical fit if i_plasma_current == 1: - fq = calculate_current_coefficient_peng(eps, sf) + fq = calculate_current_coefficient_peng(eps, len_plasma_poloidal, rminor) # Peng scaling for double null divertor; TARTs [STAR Code] elif i_plasma_current == 2: diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 8a9e5f5799..dea139183d 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -264,7 +264,6 @@ def plasma_geometry(self) -> None: if physics_variables.i_plasma_current == 8: ( physics_variables.len_plasma_poloidal, - physics_variables.sf, physics_variables.a_plasma_surface, physics_variables.a_plasma_poloidal, physics_variables.vol_plasma, @@ -278,9 +277,6 @@ def plasma_geometry(self) -> None: else: # Poloidal perimeter physics_variables.len_plasma_poloidal = 2.0e0 * (xo * thetao + xi * thetai) - physics_variables.sf = physics_variables.len_plasma_poloidal / ( - 2.0e0 * np.pi * physics_variables.rminor - ) # Volume physics_variables.vol_plasma = ( @@ -483,26 +479,25 @@ def sauter_geometry( """ Calculate the plasma geometry parameters using the Sauter geometry model. - Parameters: - a (float): Plasma minor radius (m) - r0 (float): Plasma major radius (m) - kappa (float): Plasma separatrix elongation - triang (float): Plasma separatrix triangularity + Parameters: + a (float): Plasma minor radius (m) + r0 (float): Plasma major radius (m) + kappa (float): Plasma separatrix elongation + triang (float): Plasma separatrix triangularity - Returns: - tuple: A tuple containing: - - len_plasma_poloidal (float): Poloidal perimeter - - sf (float): Geometric factor - - a_plasma_surface (float): Surface area - - a_plasma_poloidal (float): Cross-section area - - vol_plasma (float): Plasma volume + Returns: + tuple: A tuple containing: + - len_plasma_poloidal (float): Poloidal perimeter + - a_plasma_surface (float): Surface area + - a_plasma_poloidal (float): Cross-section area + - vol_plasma (float): Plasma volume - Notes: + Notes: - Refrences: - - O. Sauter, “Geometric formulas for system codes including the effect of negative triangularity,” - Fusion Engineering and Design, vol. 112, pp. 633–645, Nov. 2016, - doi: https://doi.org/10.1016/j.fusengdes.2016.04.033. + Refrences: + - O. Sauter, “Geometric formulas for system codes including the effect of negative triangularity,” + Fusion Engineering and Design, vol. 112, pp. 633–645, Nov. 2016, + doi: https://doi.org/10.1016/j.fusengdes.2016.04.033. """ @@ -522,9 +517,6 @@ def sauter_geometry( * (1 + 0.2 * (w07 - 1)) ) - # A geometric factor - sf = len_plasma_poloidal / (2.0e0 * np.pi * a) - # Surface area (named Ap in Sauter) a_plasma_surface = ( 2.0e0 * np.pi * r0 * (1 - 0.32 * triang * eps) * len_plasma_poloidal @@ -538,7 +530,6 @@ def sauter_geometry( return ( len_plasma_poloidal, - sf, a_plasma_surface, a_plasma_poloidal, vol_plasma, diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index e9f3c1bc29..110321839d 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -854,9 +854,6 @@ module physics_variables real(dp) :: sareao !! outboard plasma surface area - real(dp) :: sf - !! shape factor = plasma poloidal perimeter / (2.pi.rminor) - integer :: i_single_null !! switch for single null / double null plasma: !! @@ -1143,7 +1140,6 @@ subroutine init_physics_variables res_time = 0.0D0 a_plasma_surface = 0.0D0 sareao = 0.0D0 - sf = 0.0D0 i_single_null = 1 ssync = 0.6D0 tauee = 0.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 4a2747e6f6..f31674a44e 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -5265,7 +5265,6 @@ "sec_buildings_w": 25.0, "secondary_cycle": 0.0, "seppowerratio": 2.3, - "sf": 0.0, "sfd": null, "sfn": null, "sft": null, @@ -10607,7 +10606,6 @@ "sec_buildings_w": "security & safety buildings length, width, height (m)", "secondary_cycle": "Switch for power conversion cycle:\n
      \n
    • =0 Set efficiency for chosen blanket, from detailed models (divertor heat not used)
    • \n
    • =1 Set efficiency for chosen blanket, from detailed models (divertor heat used)
    • \n
    • =2 user input thermal-electric efficiency (etath)
    • \n
    • =3 steam Rankine cycle
    • \n
    • =4 supercritical CO2 cycle
    • \n
    ", "seppowerratio": "", - "sf": "shape factor = plasma poloidal perimeter / (2.pi.rminor)", "sfd": "", "sfn": "", "sft": "", @@ -19253,7 +19251,6 @@ "res_time", "a_plasma_surface", "sareao", - "sf", "i_single_null", "ssync", "tauee", diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index c7d26e787a..42c9002a6d 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -897,8 +897,6 @@ class PlasmaCurrentParam(NamedTuple): rminor: Any = None - sf: Any = None - triang: Any = None triang95: Any = None @@ -937,7 +935,6 @@ class PlasmaCurrentParam(NamedTuple): q95=3.5, rmajor=8, rminor=2.6666666666666665, - sf=1.4372507312498271, triang=0.5, triang95=0.33333333333333331, expected_normalised_total_beta=2.4784688886891844, @@ -965,7 +962,6 @@ class PlasmaCurrentParam(NamedTuple): q95=3.5, rmajor=8, rminor=2.6666666666666665, - sf=1.4372507312498271, triang=0.5, triang95=0.33333333333333331, expected_normalised_total_beta=2.4784688886891844, @@ -1014,7 +1010,6 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): q95=plasmacurrentparam.q95, rmajor=plasmacurrentparam.rmajor, rminor=plasmacurrentparam.rminor, - sf=plasmacurrentparam.sf, triang=plasmacurrentparam.triang, triang95=plasmacurrentparam.triang95, ) From a12026ce9a2ab118a5404c52c31b7b3e41c9705e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 16:11:23 +0000 Subject: [PATCH 19/38] :sparkle: Refactor plasma geometry calculations: extract poloidal perimeter calculation into a separate method and rename parameters for clarity --- .../physics-models/plasma_geometry.md | 17 +++++++- process/plasma_geometry.py | 42 ++++++++++++++----- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index a1de13d877..18578f315d 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -365,10 +365,23 @@ $$ -### Poloidal perimeter +### Poloidal perimeter | `plasma_poloidal_perimeter()` The poloidal plasma perimtere length `len_plasma_poloidal` is calculated as follows: + +| Input Variable | Description | +|----------|--------------------------------------| +| `xi` | Radius of arc describing inboard surface [$\text{m}$] | +| `thetai` | Half-angle of arc describing inboard surface | +| `xo` | Radius of arc describing outboard surface [$\text{m}$] | +| `thetao` | Half-angle of arc describing outboard surface | + + +| Output Variable | Description | +|----------|--------------------------------------| +| `len_plasma_poloidal` | Plasma poloidal perimeter [$\text{m}$] | + $$ -\mathtt{len_plasma_poloidal} = 2.0 \times (\mathtt{xo} \times \mathtt{thetao} + \mathtt{xi} \times \mathtt{thetai}) +\mathtt{len\_plasma\_poloidal} = 2.0 \times (\mathtt{xo} \times \mathtt{thetao} + \mathtt{xi} \times \mathtt{thetai}) $$ diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index dea139183d..161aa4f482 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -276,7 +276,9 @@ def plasma_geometry(self) -> None: else: # Poloidal perimeter - physics_variables.len_plasma_poloidal = 2.0e0 * (xo * thetao + xi * thetai) + physics_variables.len_plasma_poloidal = self.plasma_poloidal_perimeter( + xi, thetai, xo, thetao + ) # Volume physics_variables.vol_plasma = ( @@ -303,7 +305,7 @@ def plasma_geometry(self) -> None: @staticmethod def plasma_angles_arcs( - a: float, kap: float, tri: float + a: float, kappa: float, triang: float ) -> tuple[float, float, float, float]: """ Routine to find parameters used for calculating geometrical @@ -313,7 +315,7 @@ def plasma_angles_arcs( Parameters: a (float): Plasma minor radius (m) - kap (float): Plasma separatrix elongation + kappa (float): Plasma separatrix elongation tri (float): Plasma separatrix triangularity Returns: @@ -331,20 +333,38 @@ def plasma_angles_arcs( - F/MI/PJK/LOGBOOK14, p.42 - F/PL/PJK/PROCESS/CODE/047 """ - t = 1.0e0 - tri - denomi = (kap**2 - t**2) / (2.0e0 * t) - thetai = np.arctan(kap / denomi) - xi = a * (denomi + 1.0e0 - tri) + t = 1.0e0 - triang + denomi = (kappa**2 - t**2) / (2.0e0 * t) + thetai = np.arctan(kappa / denomi) + xi = a * (denomi + 1.0e0 - triang) # Find radius and half-angle of outboard arc - n = 1.0e0 + tri - denomo = (kap**2 - n**2) / (2.0e0 * n) - thetao = np.arctan(kap / denomo) - xo = a * (denomo + 1.0e0 + tri) + n = 1.0e0 + triang + denomo = (kappa**2 - n**2) / (2.0e0 * n) + thetao = np.arctan(kappa / denomo) + xo = a * (denomo + 1.0e0 + triang) return xi, thetai, xo, thetao + @staticmethod + def plasma_poloidal_perimeter( + xi: float, thetai: float, xo: float, thetao: float + ) -> float: + """ + Calculate the poloidal perimeter of the plasma. + + Parameters: + xi (float): Radius of arc describing inboard surface (m) + thetai (float): Half-angle of arc describing inboard surface + xo (float): Radius of arc describing outboard surface (m) + thetao (float): Half-angle of arc describing outboard surface + + Returns: + float: Poloidal perimeter (m) + """ + return 2.0e0 * (xo * thetao + xi * thetai) + @staticmethod def xsurf( rmajor: float, rminor: float, xi: float, thetai: float, xo: float, thetao: float From 5876f9347c340877d8941a6a6f9db1de9d797993 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 17 Jan 2025 16:49:19 +0000 Subject: [PATCH 20/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20'sareao'=20to=20'?= =?UTF-8?q?a=5Fplasma=5Fsurface=5Foutboard'=20for=20consistency=20in=20pla?= =?UTF-8?q?sma=20surface=20area=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/dcll.py | 7 +++++-- process/divertor.py | 2 +- process/plasma_geometry.py | 2 +- process/stellarator.py | 4 ++-- source/fortran/physics_variables.f90 | 4 ++-- tests/integration/ref_dicts.json | 6 +++--- tests/unit/test_dcll.py | 12 ++++++++---- tests/unit/test_stellarator.py | 22 ++++++++++++++-------- 8 files changed, 36 insertions(+), 23 deletions(-) diff --git a/process/dcll.py b/process/dcll.py index 8a11a04303..09ba6c9f8f 100644 --- a/process/dcll.py +++ b/process/dcll.py @@ -708,7 +708,10 @@ def dcll_masses(self, output: bool): ) + fwbs_variables.fw_armour_mass * ( - (physics_variables.a_plasma_surface - physics_variables.sareao) + ( + physics_variables.a_plasma_surface + - physics_variables.a_plasma_surface_outboard + ) * fwbs_variables.fw_armour_thickness / fwbs_variables.fw_armour_vol ) @@ -720,7 +723,7 @@ def dcll_masses(self, output: bool): * (build_variables.fwareaob * build_variables.fwoth / fwbs_variables.volfw) + fwbs_variables.fw_armour_mass * ( - physics_variables.sareao + physics_variables.a_plasma_surface_outboard * fwbs_variables.fw_armour_thickness / fwbs_variables.fw_armour_vol ) diff --git a/process/divertor.py b/process/divertor.py index 467fa438b9..a06ff3e89b 100644 --- a/process/divertor.py +++ b/process/divertor.py @@ -107,7 +107,7 @@ def run(self, output: bool) -> None: # Main plasma separatrix area to divertor (and power fraction) # +PJK Is the 2 related to 2 divertors (i.e. double-null assumed)? - frgd = (pv.sareao) / (2.0e0 * pv.a_plasma_surface) + frgd = (pv.a_plasma_surface_outboard) / (2.0e0 * pv.a_plasma_surface) # -PJK # Power flow to divertor diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 161aa4f482..a4fefcb5b9 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -256,7 +256,7 @@ def plasma_geometry(self) -> None: xo, thetao, ) - physics_variables.sareao = xso + physics_variables.a_plasma_surface_outboard = xso # ====================================================================== diff --git a/process/stellarator.py b/process/stellarator.py index 91bebd9d5e..4bf47e5891 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -338,10 +338,10 @@ def stgeom(self): np.pi * physics_variables.rminor * physics_variables.rminor ) # average, could be calculated for every toroidal angle if desired - # physics_variables.sareao is retained only for obsolescent fispact calculation... + # physics_variables.a_plasma_surface_outboard is retained only for obsolescent fispact calculation... # Cross-sectional area, averaged over toroidal angle - physics_variables.sareao = ( + physics_variables.a_plasma_surface_outboard = ( 0.5e0 * physics_variables.a_plasma_surface ) # Used only in the divertor model; approximate as for tokamaks diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 110321839d..3fb83480ed 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -851,7 +851,7 @@ module physics_variables real(dp) :: a_plasma_surface !! plasma surface area - real(dp) :: sareao + real(dp) :: a_plasma_surface_outboard !! outboard plasma surface area integer :: i_single_null @@ -1139,7 +1139,7 @@ subroutine init_physics_variables res_plasma = 0.0D0 res_time = 0.0D0 a_plasma_surface = 0.0D0 - sareao = 0.0D0 + a_plasma_surface_outboard = 0.0D0 i_single_null = 1 ssync = 0.6D0 tauee = 0.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index f31674a44e..bf74eb81cd 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -4902,7 +4902,7 @@ ], "s_tresca_oh": 0.0, "a_plasma_surface": 0.0, - "sareao": 0.0, + "a_plasma_surface_outboard": 0.0, "scafc": [ 0.0, 0.0, @@ -10595,7 +10595,7 @@ "s_label": "", "s_tresca_oh": "Maximum shear stress (Tresca criterion) coils/central solenoid [MPa]", "a_plasma_surface": "plasma surface area", - "sareao": "outboard plasma surface area", + "a_plasma_surface_outboard": "outboard plasma surface area", "scafc": "", "scale": "", "scan_dim": "1-D or 2-D scan switch (1=1D, 2=2D)", @@ -19250,7 +19250,7 @@ "res_plasma", "res_time", "a_plasma_surface", - "sareao", + "a_plasma_surface_outboard", "i_single_null", "ssync", "tauee", diff --git a/tests/unit/test_dcll.py b/tests/unit/test_dcll.py index 03dcebc028..7046d954e0 100644 --- a/tests/unit/test_dcll.py +++ b/tests/unit/test_dcll.py @@ -294,7 +294,7 @@ class DcllMassesParam(NamedTuple): a_plasma_surface: Any = None - sareao: Any = None + a_plasma_surface_outboard: Any = None iblnkith: Any = None @@ -524,7 +524,7 @@ class DcllMassesParam(NamedTuple): blbuoth=0.46500000000000002, blbmoth=0.27000000000000002, a_plasma_surface=1403.2719775669307, - sareao=949.22962703393853, + a_plasma_surface_outboard=949.22962703393853, iblnkith=1, volblkt=1397.9003011502937, volblkti=401.90579863726225, @@ -644,7 +644,7 @@ class DcllMassesParam(NamedTuple): blbuoth=0.46500000000000002, blbmoth=0.49699999999999994, a_plasma_surface=1403.2719775669307, - sareao=949.22962703393853, + a_plasma_surface_outboard=949.22962703393853, iblnkith=1, volblkt=1400.4860764869636, volblkti=402.02180553751157, @@ -791,7 +791,11 @@ def test_dcll_masses(dcllmassesparam, monkeypatch, dcll): physics_variables, "a_plasma_surface", dcllmassesparam.a_plasma_surface ) - monkeypatch.setattr(physics_variables, "sareao", dcllmassesparam.sareao) + monkeypatch.setattr( + physics_variables, + "a_plasma_surface_outboard", + dcllmassesparam.a_plasma_surface_outboard, + ) monkeypatch.setattr(fwbs_variables, "iblnkith", dcllmassesparam.iblnkith) diff --git a/tests/unit/test_stellarator.py b/tests/unit/test_stellarator.py index 463e193205..db0c80c83e 100644 --- a/tests/unit/test_stellarator.py +++ b/tests/unit/test_stellarator.py @@ -59,7 +59,7 @@ class StgeomParam(NamedTuple): a_plasma_surface: Any = None - sareao: Any = None + a_plasma_surface_outboard: Any = None vol_plasma: Any = None @@ -77,7 +77,7 @@ class StgeomParam(NamedTuple): expected_a_plasma_surface: Any = None - expected_sareao: Any = None + expected_a_plasma_surface_outboard: Any = None expected_vol: Any = None @@ -92,7 +92,7 @@ class StgeomParam(NamedTuple): rmajor=22, rminor=1.7842660178426601, a_plasma_surface=0, - sareao=0, + a_plasma_surface_outboard=0, vol_plasma=0, a_plasma_poloidal=0, bt=5.5, @@ -101,7 +101,7 @@ class StgeomParam(NamedTuple): f_r=0.99099099099099097, f_a=0.99125889880147788, expected_a_plasma_surface=1925.3641313657533, - expected_sareao=962.68206568287667, + expected_a_plasma_surface_outboard=962.68206568287667, expected_vol=1385.2745877380669, expected_a_plasma_poloidal=10.001590778710231, ), @@ -110,7 +110,7 @@ class StgeomParam(NamedTuple): rmajor=22, rminor=1.7842660178426601, a_plasma_surface=1925.3641313657533, - sareao=962.68206568287667, + a_plasma_surface_outboard=962.68206568287667, vol_plasma=1385.2745877380669, a_plasma_poloidal=10.001590778710231, bt=5.5, @@ -119,7 +119,7 @@ class StgeomParam(NamedTuple): f_r=0.99099099099099097, f_a=0.99125889880147788, expected_a_plasma_surface=1925.3641313657533, - expected_sareao=962.68206568287667, + expected_a_plasma_surface_outboard=962.68206568287667, expected_vol=1385.2745877380669, expected_a_plasma_poloidal=10.001590778710231, ), @@ -148,7 +148,11 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): physics_variables, "a_plasma_surface", stgeomparam.a_plasma_surface ) - monkeypatch.setattr(physics_variables, "sareao", stgeomparam.sareao) + monkeypatch.setattr( + physics_variables, + "a_plasma_surface_outboard", + stgeomparam.a_plasma_surface_outboard, + ) monkeypatch.setattr(physics_variables, "vol_plasma", stgeomparam.vol_plasma) @@ -180,7 +184,9 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): stgeomparam.expected_sarea ) - assert physics_variables.sareao == pytest.approx(stgeomparam.expected_sareao) + assert physics_variables.a_plasma_surface_outboard == pytest.approx( + stgeomparam.expected_a_plasma_surface_outboard + ) assert physics_variables.vol_plasma == pytest.approx(stgeomparam.expected_vol) From 2e9e7f2ab172caddbe9219513ecfb06ef68879a7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 10:34:25 +0000 Subject: [PATCH 21/38] Refactor plasma geometry calculations: standardize variable names for clarity and consistency --- .../physics-models/plasma_geometry.md | 125 ++++++++++++++++-- 1 file changed, 111 insertions(+), 14 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index 18578f315d..eae187abe9 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -11,6 +11,78 @@ elongation of the last closed flux surface (LCFS) $\kappa$ (`kappa`) and the tri $\delta$ (`triang`), which can be scaled automatically with the aspect ratio if required using certain switch conditions of `i_plasma_geometry`: +The setting of the `i_plasma_shape` switch determines what type of plasma shaping formula to use. + + - `i_plasma_shape = 0`: Default PROCESS plasma shape is used wich models the plasma as 2-intersecting arcs (DEFAULT). + - `i_plasma_shape = 1`: The Sauter geometry is used which includes the squareness $(\xi)$ parameter. + +The different parameterisations of the plasma shape can be experimented with in the plot below. + + + + + + Bokeh Plot + + + + + + +
    + + + + + + +--------------------- + ## Plasma Geometry Parameters | `plasma_geometry()` This subroutine calculates the plasma geometry parameters based on the given input values. @@ -174,6 +246,7 @@ $$ $$ --------------------------------------------------------------------- + An explicit constraint relating to the plasma's vertical stability may be turned on if required. In principle, the inner surface of the outboard shield could be used as the location of a conducting shell to mitigate the vertical @@ -190,6 +263,8 @@ intersect the plasma X-points and the plasma midplane outer and inner radii. (This is a reasonable assumption for double-null diverted plasmas, but will be inaccurate for single-null plasmas, `snull = 1`) +------------------ + ### Plasma-Wall Gap The region directly outside the last closed flux surface of the core plasma is @@ -202,6 +277,9 @@ The plasma and first wall clearance can be calculated or input by setting the `i - `i_plasma_wall_gap` == 0, then the inboard and outboard plasma wall gaps are set to be 10% of the plasma minor radius ($a$). - `i_plasma_wall_gap` == 1, then the inboard and outboard plasma wall gaps are set by defining `scrapli` and `scraplo` respectively. + +------------------ + ### Geometrical properties | `plasma_angles_arcs()` This method calculates the radius and half angle of the arc describing the inboard and outboard plasma surfaces. This calculation is appropriate for plasmas with a separatrix. It requires the plasma minor radius ($a$, `rminor`), elongation ($\kappa$, `kappa`) and triangularity ($\delta$, `triang`). @@ -270,6 +348,9 @@ $$ \mathtt{xo}=x_o = a(M+1+\delta)$} $$ + +------------------ + ### Surface Area | `xsurf()` This function finds the plasma surface area, using the revolution of two intersecting arcs around the device centreline. @@ -311,11 +392,12 @@ $$ \mathtt{xso} = 4\pi \times \mathtt{xo} (\mathtt{rc} \times \mathtt{thetao}+ (\mathtt{xo}\times \sin({\mathtt{thetao}))}) $$ +------------------ + ### Sauter geoemtry | `sauter_geometry()` -Plasma geometry based on equations (36) in O. Sauter, Fusion Engineering and Design 112 (2016) 633–645 -'Geometric formulas for system codes including the effect of negative triangularity' +Plasma geometry based on equations'Geometric formulas for system codes including the effect of negative triangularity'[^7] | Input Variable | Description | |----------|--------------------------------------| @@ -343,27 +425,29 @@ $$ Poloidal perimeter (named Lp in Sauter) $$ -\mathtt{len_plasma_poloidal} = 2.0\pi a (1 + 0.55 (\kappa - 1))(1 + 0.08 \delta^2)(1 + 0.2 (\mathtt{w07} - 1)) +\mathtt{len\_plasma\_poloidal} = 2.0\pi a (1 + 0.55 (\kappa - 1))(1 + 0.08 \delta^2)(1 + 0.2 (\mathtt{w07} - 1)) $$ Surface area (named Ap in Sauter) $$ -\mathtt{a_plasma_surface} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{len_plasma_poloidal} -$$ +\mathtt{a\_plasma\_surface} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{len\_plasma\_poloidal} +$$ Cross-section area (named S_phi in Sauter) + $$ -\mathtt{a_plasma_poloidal} = \pi a^2 \kappa (1 + 0.52 (\mathtt{w07} - 1)) +\mathtt{a\_plasma\_poloidal} = \pi a^2 \kappa (1 + 0.52 (\mathtt{w07} - 1)) $$ Volume + $$ -\mathtt{vol_plasma} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{a_plasma_poloidal} +\mathtt{vol\_plasma} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{a\_plasma\_poloidal} $$ - +------------------ ### Poloidal perimeter | `plasma_poloidal_perimeter()` The poloidal plasma perimtere length `len_plasma_poloidal` is calculated as follows: @@ -384,6 +468,7 @@ $$ \mathtt{len\_plasma\_poloidal} = 2.0 \times (\mathtt{xo} \times \mathtt{thetao} + \mathtt{xi} \times \mathtt{thetai}) $$ +------------------ ### Plasma Volume | `plasma_volume()` @@ -408,14 +493,18 @@ Calculate the volume for the inboard plasma side: $$ \mathtt{rc} = R_0 - a + \mathtt{xi} \\ -\mathtt{vin} = (2\pi \times \mathtt{xi}) \times(\mathtt{rc}^2 \times \sin{(\mathtt{thetai})} - (\mathtt{rc}\times \mathtt{xi} \times \mathtt{thetai})-(0.5\times\mathtt{rc} \mathtt{xi} \times \sin{(2\times\mathtt{thetai})})+(\mathtt{xi}^2\times \sin{(\mathtt{thetai})})-\left(\frac{1}{3}\times \mathtt{xi}^2 \times (\sin{(\mathtt{thetai})})^3\right) +\mathtt{vin} = (2\pi \times \mathtt{xi}) \times(\mathtt{rc}^2 \times \sin{(\mathtt{thetai})} - (\mathtt{rc}\times \mathtt{xi} \times \mathtt{thetai}) \\ +-(0.5\times\mathtt{rc} \mathtt{xi} \times \sin{(2\times\mathtt{thetai})})+(\mathtt{xi}^2\times \sin{(\mathtt{thetai})}) \\ +-\left(\frac{1}{3}\times \mathtt{xi}^2 \times (\sin{(\mathtt{thetai})})^3\right) $$ Calculate the volume for the outboard plasma side: $$ \mathtt{rc} = R_0 + a - \mathtt{xo} \\ -\mathtt{vout} = (2\pi \times \mathtt{xo}) \times(\mathtt{rc}^2 \times \sin{(\mathtt{thetao})} + (\mathtt{rc}\times \mathtt{xo} \times \mathtt{thetao})+(0.5\times\mathtt{rc} \times\mathtt{xo} \times \sin{(2\times\mathtt{thetao})})+(\mathtt{xo}^2\times \sin{(\mathtt{thetao})})-\left(\frac{1}{3}\times \mathtt{xo}^2 \times (\sin{(\mathtt{thetao})})^3\right) +\mathtt{vout} = (2\pi \times \mathtt{xo}) \times(\mathtt{rc}^2 \times \sin{(\mathtt{thetao})} + (\mathtt{rc}\times \mathtt{xo} \times \mathtt{thetao}) \\ ++(0.5\times\mathtt{rc} \times\mathtt{xo} \times \sin{(2\times\mathtt{thetao})})+(\mathtt{xo}^2\times \sin{(\mathtt{thetao})}) \\ +-\left(\frac{1}{3}\times \mathtt{xo}^2 \times (\sin{(\mathtt{thetao})})^3\right) $$ The volume is then the difference between the two volumes @@ -424,6 +513,8 @@ $$ \mathtt{xvol} = \mathtt{vout}-\mathtt{vin} $$ +------------------ + ### Plasma cross-sectional area | `plasma_cross_section()` This function finds the plasma cross-sectional area, using the @@ -446,9 +537,11 @@ This calculation is appropriate for plasmas with a separatrix. $$ \mathtt{xsecta} = \mathtt{xo}^2 \times ( \mathtt{thetao} - \cos{(\mathtt{thetao})} \times \sin({\mathtt{thetao}}) - ) + \mathtt{xi}^2 \times (\mathtt{thetai} - \cos{(\mathtt{thetai})} \times \sin{(\mathtt{thetai}))} + ) \\ + + \mathtt{xi}^2 \times (\mathtt{thetai} - \cos{(\mathtt{thetai})} \times \sin{(\mathtt{thetai}))} $$ +------------------ ## Legacy claculations @@ -591,7 +684,8 @@ $$ $$ $$ -\mathtt{{vout}} = -\frac{2}{3} \pi \times \mathtt{zn}^3 + 2 \pi \times \mathtt{zn} \times (\mathtt{c1}^2 + \mathtt{rc1}^2) + 2 \pi \times \mathtt{c1} \times \left(\mathtt{zn} \times \sqrt{\mathtt{rc1}^2 - \mathtt{zn}^2} + \mathtt{rc1}^2 \times \arcsin{\left(\frac{\mathtt{zn}}{\mathtt{rc1}}\right)}\right) +\mathtt{{vout}} = -\frac{2}{3} \pi \times \mathtt{zn}^3 + 2 \pi \times \mathtt{zn} \times (\mathtt{c1}^2 + \mathtt{rc1}^2) \\ ++ 2 \pi \times \mathtt{c1} \times \left(\mathtt{zn} \times \sqrt{\mathtt{rc1}^2 - \mathtt{zn}^2} + \mathtt{rc1}^2 \times \arcsin{\left(\frac{\mathtt{zn}}{\mathtt{rc1}}\right)}\right) $$ $$ @@ -603,7 +697,8 @@ $$ $$ $$ -\mathtt{vin} = -\frac{2}{3} \pi \times \mathtt{zn}^3 + 2 \pi \times \mathtt{zn} \times (\mathtt{rc2}^2 + \mathtt{c2}^2) - 2 \pi \times \mathtt{c2} \times \left(\mathtt{zn} \times \sqrt{\mathtt{rc2}^2 - \mathtt{zn}^2} + \mathtt{rc2}^2 \times \arcsin{\left(\frac{\mathtt{zn}}{\mathtt{rc2}}\right)}\right) +\mathtt{vin} = -\frac{2}{3} \pi \times \mathtt{zn}^3 + 2 \pi \times \mathtt{zn} \times (\mathtt{rc2}^2 + \mathtt{c2}^2) \\ +- 2 \pi \times \mathtt{c2} \times \left(\mathtt{zn} \times \sqrt{\mathtt{rc2}^2 - \mathtt{zn}^2} + \mathtt{rc2}^2 \times \arcsin{\left(\frac{\mathtt{zn}}{\mathtt{rc2}}\right)}\right) $$ $$ @@ -681,4 +776,6 @@ FTP/3-3, Proc. IAEA Fusion Energy Conference, October 2012, San Diego [^5]: H.S. Bosch and G.M. Hale, *Improved Formulas for Fusion Cross-sections* and Thermal Reactivities', Nuclear Fusion 32 (1992) 611 [^6]: J D Galambos, *STAR Code : Spherical Tokamak Analysis and Reactor Code*, -unpublished internal Oak Ridge document \ No newline at end of file +unpublished internal Oak Ridge document +[^7]: O. Sauter, “Geometric formulas for system codes including the effect of negative triangularity,” Fusion Engineering and Design, vol. 112, pp. 633–645, Nov. 2016, doi: https://doi.org/10.1016/j.fusengdes.2016.04.033. +‌ \ No newline at end of file From bb3cba70a59e9a9ec9f33ab3c4d2dd19590adc28 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 10:38:49 +0000 Subject: [PATCH 22/38] :sparkle: Add plasma cross-section plotting script: implement interactive visualization with Bokeh --- .../plasma_cross_section_plot.py | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 documentation/proc-pages/scripts/plotting_scripts/plasma_cross_section_plot.py diff --git a/documentation/proc-pages/scripts/plotting_scripts/plasma_cross_section_plot.py b/documentation/proc-pages/scripts/plotting_scripts/plasma_cross_section_plot.py new file mode 100644 index 0000000000..8d2480e962 --- /dev/null +++ b/documentation/proc-pages/scripts/plotting_scripts/plasma_cross_section_plot.py @@ -0,0 +1,124 @@ +import numpy as np +from bokeh.layouts import column, row +from bokeh.models import ColumnDataSource, CustomJS, Slider, Label +from bokeh.plotting import figure +from bokeh.io import save, output_file +import math + +square = Slider(start=-1.0, end=1.0, value=0.0, step=0.01, title="Squareness") +r0 = Slider(start=0.1, end=10, value=5.0, step=0.1, title="Major radius") +a = Slider(start=0.01, end=10, value=3.0, step=0.01, title="Minor radius") +delta = Slider(start=0.0, end=1, value=0.5, step=0.01, title="Triangularity | delta") +kappa = Slider(start=0.0, end=10, value=2.0, step=0.01, title="Elongation | kappa") + +output_file("plass_shape_plot.html") +x = np.linspace(-np.pi, np.pi, 256) + +# Sauter +R = r0.value + a.value * np.cos(x + delta.value * np.sin(x) - square.value * np.sin(2 * x)) +Z = kappa.value * a.value * np.sin(x + square.value * np.sin(2 * x)) + +# Mirror the Sauter plot +R_mirror = -R + +# PROCESS +x1 = (2.0 * r0.value * (1.0 + delta.value) - a.value * (delta.value**2 + kappa.value**2 - 1.0)) / ( + 2.0 * (1.0 + delta.value) +) +x2 = (2.0 * r0.value * (delta.value - 1.0) - a.value * (delta.value**2 + kappa.value**2 - 1.0)) / ( + 2.0 * (delta.value - 1.0) +) +r1 = 0.5 * math.sqrt( + (a.value**2 * ((delta.value + 1.0) ** 2 + kappa.value**2) ** 2) / ((delta.value + 1.0) ** 2) +) +r2 = 0.5 * math.sqrt( + (a.value**2 * ((delta.value - 1.0) ** 2 + kappa.value**2) ** 2) / ((delta.value - 1.0) ** 2) +) +theta1 = np.arcsin((kappa.value * a.value) / r1) +theta2 = np.arcsin((kappa.value * a.value) / r2) + +inang = 1.0 / r1 +outang = 1.5 / r2 + +angs1 = np.linspace(-theta1 + np.pi, (inang + theta1) + np.pi, 256, endpoint=True) +angs2 = np.linspace(-(outang + theta2), theta2, 256, endpoint=True) + +xs1 = -(r1 * np.cos(angs1) - x1) +ys1 = r1 * np.sin(angs1) +xs2 = -(r2 * np.cos(angs2) - x2) +ys2 = r2 * np.sin(angs2) + +# Mirror the PROCESS plot +xs1_mirror = -xs1 +xs2_mirror = -xs2 + +source = ColumnDataSource(data=dict(x=R, y=Z, x_mirror=R_mirror, y_mirror=Z, x1=xs1, y1=ys1, x2=xs2, y2=ys2, x1_mirror=xs1_mirror, y1_mirror=ys1, x2_mirror=xs2_mirror, y2_mirror=ys2, linspace=x)) + +plot = figure(x_range=(-10, 10), y_range=(-10, 10), width=800, height=800, title="Plasma Shape") +plot.xaxis.axis_label = r"Radius" +plot.yaxis.axis_label = r"Height" + +plot.line('x', 'y', source=source, line_width=3, line_alpha=0.6, legend_label="Sauter") +plot.line('x_mirror', 'y_mirror', source=source, line_width=3, line_alpha=0.6) +plot.line('x1', 'y1', source=source, line_width=3, line_alpha=0.6, color="red", legend_label="PROCESS") +plot.line('x1_mirror', 'y1_mirror', source=source, line_width=3, line_alpha=0.6, color="red") +plot.line('x2', 'y2', source=source, line_width=3, line_alpha=0.6, color="red") +plot.line('x2_mirror', 'y2_mirror', source=source, line_width=3, line_alpha=0.6, color="red") + +plot.legend.location = "top_left" + +callback = CustomJS(args=dict(source=source, r0=r0, a=a, delta=delta, kappa=kappa, square=square), + code=""" + const A = r0.value; + const B = a.value; + const D = delta.value; + const K = kappa.value; + const S = square.value; + const x = source.data['linspace']; + const R = source.data['x']; + const Z = source.data['y']; + const R_mirror = source.data['x_mirror']; + const Z_mirror = source.data['y_mirror']; + const x1 = (2.0 * A * (1.0 + D) - B * (D**2 + K**2 - 1.0)) / (2.0 * (1.0 + D)); + const x2 = (2.0 * A * (D - 1.0) - B * (D**2 + K**2 - 1.0)) / (2.0 * (D - 1.0)); + const r1 = 0.5 * Math.sqrt((B**2 * ((D + 1.0) ** 2 + K**2) ** 2) / ((D + 1.0) ** 2)); + const r2 = 0.5 * Math.sqrt((B**2 * ((D - 1.0) ** 2 + K**2) ** 2) / ((D - 1.0) ** 2)); + const theta1 = Math.asin((K * B) / r1); + const theta2 = Math.asin((K * B) / r2); + const inang = 1.0 / r1; + const outang = 1.5 / r2; + const angs1 = Array.from({length: 256}, (_, i) => -theta1 + Math.PI + i * ((inang + 2*theta1) / 255)); + const angs2 = Array.from({length: 256}, (_, i) => -(outang + theta2) + i * ((theta2 + (outang + theta2)) / 255)); + const xs1 = source.data['x1']; + const ys1 = source.data['y1']; + const xs2 = source.data['x2']; + const ys2 = source.data['y2']; + const xs1_mirror = source.data['x1_mirror']; + const ys1_mirror = source.data['y1_mirror']; + const xs2_mirror = source.data['x2_mirror']; + const ys2_mirror = source.data['y2_mirror']; + for (let i = 0; i < x.length; i++) { + R[i] = A + B * Math.cos(x[i] + D * Math.sin(x[i]) - S * Math.sin(2 * x[i])); + Z[i] = K * B * Math.sin(x[i] + S * Math.sin(2 * x[i])); + R_mirror[i] = -R[i]; + Z_mirror[i] = Z[i]; + xs1[i] = -(r1 * Math.cos(angs1[i]) - x1); + ys1[i] = r1 * Math.sin(angs1[i]); + xs2[i] = -(r2 * Math.cos(angs2[i]) - x2); + ys2[i] = r2 * Math.sin(angs2[i]); + xs1_mirror[i] = -xs1[i]; + ys1_mirror[i] = ys1[i]; + xs2_mirror[i] = -xs2[i]; + ys2_mirror[i] = ys2[i]; + } + source.change.emit(); +""") + +r0.js_on_change('value', callback) +a.js_on_change('value', callback) +delta.js_on_change('value', callback) +kappa.js_on_change('value', callback) +square.js_on_change('value', callback) + +# Save the plot as HTML +save(row(plot, column(r0, a, delta, kappa, square)), filename="./plasma_plot.html") From 620c7a233e6381588cd29eda2f35c27d1724700c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 13:39:06 +0000 Subject: [PATCH 23/38] :sparkle: A new plasma_square variable --- .../plasma_cross_section_plot.py | 102 +++++++++++++----- process/physics.py | 13 ++- process/plasma_geometry.py | 5 +- source/fortran/input.f90 | 7 +- source/fortran/physics_variables.f90 | 4 + 5 files changed, 99 insertions(+), 32 deletions(-) diff --git a/documentation/proc-pages/scripts/plotting_scripts/plasma_cross_section_plot.py b/documentation/proc-pages/scripts/plotting_scripts/plasma_cross_section_plot.py index 8d2480e962..37c33ce4c1 100644 --- a/documentation/proc-pages/scripts/plotting_scripts/plasma_cross_section_plot.py +++ b/documentation/proc-pages/scripts/plotting_scripts/plasma_cross_section_plot.py @@ -1,9 +1,10 @@ +import math + import numpy as np +from bokeh.io import output_file, save from bokeh.layouts import column, row -from bokeh.models import ColumnDataSource, CustomJS, Slider, Label +from bokeh.models import ColumnDataSource, CustomJS, Slider from bokeh.plotting import figure -from bokeh.io import save, output_file -import math square = Slider(start=-1.0, end=1.0, value=0.0, step=0.01, title="Squareness") r0 = Slider(start=0.1, end=10, value=5.0, step=0.1, title="Major radius") @@ -15,24 +16,30 @@ x = np.linspace(-np.pi, np.pi, 256) # Sauter -R = r0.value + a.value * np.cos(x + delta.value * np.sin(x) - square.value * np.sin(2 * x)) +R = r0.value + a.value * np.cos( + x + delta.value * np.sin(x) - square.value * np.sin(2 * x) +) Z = kappa.value * a.value * np.sin(x + square.value * np.sin(2 * x)) # Mirror the Sauter plot R_mirror = -R # PROCESS -x1 = (2.0 * r0.value * (1.0 + delta.value) - a.value * (delta.value**2 + kappa.value**2 - 1.0)) / ( - 2.0 * (1.0 + delta.value) -) -x2 = (2.0 * r0.value * (delta.value - 1.0) - a.value * (delta.value**2 + kappa.value**2 - 1.0)) / ( - 2.0 * (delta.value - 1.0) -) +x1 = ( + 2.0 * r0.value * (1.0 + delta.value) + - a.value * (delta.value**2 + kappa.value**2 - 1.0) +) / (2.0 * (1.0 + delta.value)) +x2 = ( + 2.0 * r0.value * (delta.value - 1.0) + - a.value * (delta.value**2 + kappa.value**2 - 1.0) +) / (2.0 * (delta.value - 1.0)) r1 = 0.5 * math.sqrt( - (a.value**2 * ((delta.value + 1.0) ** 2 + kappa.value**2) ** 2) / ((delta.value + 1.0) ** 2) + (a.value**2 * ((delta.value + 1.0) ** 2 + kappa.value**2) ** 2) + / ((delta.value + 1.0) ** 2) ) r2 = 0.5 * math.sqrt( - (a.value**2 * ((delta.value - 1.0) ** 2 + kappa.value**2) ** 2) / ((delta.value - 1.0) ** 2) + (a.value**2 * ((delta.value - 1.0) ** 2 + kappa.value**2) ** 2) + / ((delta.value - 1.0) ** 2) ) theta1 = np.arcsin((kappa.value * a.value) / r1) theta2 = np.arcsin((kappa.value * a.value) / r2) @@ -52,23 +59,61 @@ xs1_mirror = -xs1 xs2_mirror = -xs2 -source = ColumnDataSource(data=dict(x=R, y=Z, x_mirror=R_mirror, y_mirror=Z, x1=xs1, y1=ys1, x2=xs2, y2=ys2, x1_mirror=xs1_mirror, y1_mirror=ys1, x2_mirror=xs2_mirror, y2_mirror=ys2, linspace=x)) +source = ColumnDataSource( + data={ + "x": R, + "y": Z, + "x_mirror": R_mirror, + "y_mirror": Z, + "x1": xs1, + "y1": ys1, + "x2": xs2, + "y2": ys2, + "x1_mirror": xs1_mirror, + "y1_mirror": ys1, + "x2_mirror": xs2_mirror, + "y2_mirror": ys2, + "linspace": x, + } +) -plot = figure(x_range=(-10, 10), y_range=(-10, 10), width=800, height=800, title="Plasma Shape") +plot = figure( + x_range=(-10, 10), y_range=(-10, 10), width=800, height=800, title="Plasma Shape" +) plot.xaxis.axis_label = r"Radius" plot.yaxis.axis_label = r"Height" -plot.line('x', 'y', source=source, line_width=3, line_alpha=0.6, legend_label="Sauter") -plot.line('x_mirror', 'y_mirror', source=source, line_width=3, line_alpha=0.6) -plot.line('x1', 'y1', source=source, line_width=3, line_alpha=0.6, color="red", legend_label="PROCESS") -plot.line('x1_mirror', 'y1_mirror', source=source, line_width=3, line_alpha=0.6, color="red") -plot.line('x2', 'y2', source=source, line_width=3, line_alpha=0.6, color="red") -plot.line('x2_mirror', 'y2_mirror', source=source, line_width=3, line_alpha=0.6, color="red") +plot.line("x", "y", source=source, line_width=3, line_alpha=0.6, legend_label="Sauter") +plot.line("x_mirror", "y_mirror", source=source, line_width=3, line_alpha=0.6) +plot.line( + "x1", + "y1", + source=source, + line_width=3, + line_alpha=0.6, + color="red", + legend_label="PROCESS", +) +plot.line( + "x1_mirror", "y1_mirror", source=source, line_width=3, line_alpha=0.6, color="red" +) +plot.line("x2", "y2", source=source, line_width=3, line_alpha=0.6, color="red") +plot.line( + "x2_mirror", "y2_mirror", source=source, line_width=3, line_alpha=0.6, color="red" +) plot.legend.location = "top_left" -callback = CustomJS(args=dict(source=source, r0=r0, a=a, delta=delta, kappa=kappa, square=square), - code=""" +callback = CustomJS( + args={ + "source": source, + "r0": r0, + "a": a, + "delta": delta, + "kappa": kappa, + "square": square, + }, + code=""" const A = r0.value; const B = a.value; const D = delta.value; @@ -112,13 +157,14 @@ ys2_mirror[i] = ys2[i]; } source.change.emit(); -""") +""", +) -r0.js_on_change('value', callback) -a.js_on_change('value', callback) -delta.js_on_change('value', callback) -kappa.js_on_change('value', callback) -square.js_on_change('value', callback) +r0.js_on_change("value", callback) +a.js_on_change("value", callback) +delta.js_on_change("value", callback) +kappa.js_on_change("value", callback) +square.js_on_change("value", callback) # Save the plot as HTML save(row(plot, column(r0, a, delta, kappa, square)), filename="./plasma_plot.html") diff --git a/process/physics.py b/process/physics.py index 151c0d7aab..48d944fa13 100644 --- a/process/physics.py +++ b/process/physics.py @@ -3342,6 +3342,10 @@ def outplas(self): ) po.osubhd(self.outfile, "Plasma Geometry :") + if physics_variables.i_plasma_shape == 0: + po.osubhd(self.outfile, "Classic PROCESS plasma shape model is used :") + elif physics_variables.i_plasma_shape == 1: + po.osubhd(self.outfile, "Sauter plasma shape model is used :") po.ovarrf( self.outfile, "Major radius (m)", "(rmajor)", physics_variables.rmajor ) @@ -3353,7 +3357,14 @@ def outplas(self): "OP ", ) po.ovarrf(self.outfile, "Aspect ratio", "(aspect)", physics_variables.aspect) - + if physics_variables.i_plasma_shape == 1: + po.ovarrf( + self.outfile, + "Plasma squareness", + "(plasma_square)", + physics_variables.plasma_square, + "IP", + ) if stellarator_variables.istell == 0: if physics_variables.i_plasma_geometry in [0, 6, 8]: po.ovarrf( diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index a4fefcb5b9..ee60f305f3 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -261,7 +261,10 @@ def plasma_geometry(self) -> None: # ====================================================================== # i_plasma_current = 8 specifies use of the Sauter geometry as well as plasma current. - if physics_variables.i_plasma_current == 8: + if ( + physics_variables.i_plasma_current == 8 + or physics_variables.i_plasma_shape == 1 + ): ( physics_variables.len_plasma_poloidal, physics_variables.a_plasma_surface, diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 0380421cc0..be81907618 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -311,7 +311,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) i_beta_fast_alpha, tauee_in, alphaj, alphat, i_plasma_current, q, ti, tesep, rli, triang, & itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & teped, f_helium3, iwalld, gamma, f_alpha_plasma, fgwped, tbeta, i_bootstrap_current, & - iradloss, te, alphan, rmajor, kappa, iinvqd, fkzohm, beamfus0, & + iradloss, te, alphan, rmajor, plasma_square, kappa, iinvqd, fkzohm, beamfus0, & tauratio, i_density_limit, bt, i_plasma_wall_gap, ipnlaws, beta_max, beta_min, & i_diamagnetic_current, i_pfirsch_schluter_current, m_s_limit, burnup_in use pf_power_variables, only: iscenr, maxpoloidalpower @@ -681,7 +681,10 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('iwalld') call parse_int_variable('iwalld', iwalld, 1, 2, & 'Switch for wall load calculation') - case ('kappa') + case ('plasma_square') + call parse_real_variable('plasma_square', plasma_square, -5.0D0, 5.0D0, & + 'Plasma squareness') + case ('kappa') call parse_real_variable('kappa', kappa, 0.99D0, 5.0D0, & 'Plasma separatrix elongation') case ('kappa95') diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 3fb83480ed..a68773ecb9 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -569,6 +569,9 @@ module physics_variables !! - =1 use scaled plasma surface area !! - =2 use first wall area directly + real(dp) :: plasma_square + !! plasma squareness used by Sauter plasma shape + real(dp) :: kappa !! plasma separatrix elongation (calculated if `i_plasma_geometry = 1-5, 7 or 9-10`) @@ -1054,6 +1057,7 @@ subroutine init_physics_variables itart = 0 itartpf = 0 iwalld = 1 + plasma_square = 0.0D0 kappa = 1.792D0 kappa95 = 1.6D0 kappaa = 0.0D0 From 1b2663249fe2dfb1f5c68dae1c54c4261c32b2aa Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 13:44:46 +0000 Subject: [PATCH 24/38] =?UTF-8?q?=E2=9C=85=20Refactor=20test=20parameters:?= =?UTF-8?q?=20rename=20kap=20to=20kappa=20and=20tri=20to=20triang=20for=20?= =?UTF-8?q?clarity=20update=20expected=20surface=20area=20variable=20in=20?= =?UTF-8?q?stellarator=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/test_plasma_geom.py | 4 ++-- tests/unit/test_stellarator.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_plasma_geom.py b/tests/unit/test_plasma_geom.py index 81450370f0..266acb43d2 100644 --- a/tests/unit/test_plasma_geom.py +++ b/tests/unit/test_plasma_geom.py @@ -74,8 +74,8 @@ def test_plasma_angles_arcs(plasmaanglesarcsparam, monkeypatch, plasma): xi, thetai, xo, thetao = plasma.plasma_angles_arcs( a=plasmaanglesarcsparam.a, - kap=plasmaanglesarcsparam.kap, - tri=plasmaanglesarcsparam.tri, + kappa=plasmaanglesarcsparam.kap, + triang=plasmaanglesarcsparam.tri, ) assert xi == pytest.approx(plasmaanglesarcsparam.expected_xi) diff --git a/tests/unit/test_stellarator.py b/tests/unit/test_stellarator.py index db0c80c83e..944c15aa43 100644 --- a/tests/unit/test_stellarator.py +++ b/tests/unit/test_stellarator.py @@ -181,7 +181,7 @@ def test_stgeom(stgeomparam, monkeypatch, stellarator): stellarator.stgeom() assert physics_variables.a_plasma_surface == pytest.approx( - stgeomparam.expected_sarea + stgeomparam.expected_a_plasma_surface ) assert physics_variables.a_plasma_surface_outboard == pytest.approx( From 3b36aae531bc908c49ed062ee3e44edb808939b0 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 14:28:48 +0000 Subject: [PATCH 25/38] Update plotting in plot_proc for new Sauter geometry --- process/geometry/plasma_geometry.py | 116 +++++++++++++++++----------- process/io/plot_proc.py | 44 ++++++----- process/physics.py | 25 +++--- 3 files changed, 111 insertions(+), 74 deletions(-) diff --git a/process/geometry/plasma_geometry.py b/process/geometry/plasma_geometry.py index e7ba9c1850..57aeaed2b5 100644 --- a/process/geometry/plasma_geometry.py +++ b/process/geometry/plasma_geometry.py @@ -21,59 +21,83 @@ class PlasmaGeometry: def plasma_geometry( - r_0: float, a: float, triang_95: float, kappa_95: float, i_single_null: bool + rmajor: float, + rminor: float, + triang_95: float, + kappa_95: float, + i_single_null: int, + i_plasma_shape: int, + square: float, ) -> PlasmaGeometry: - """Calculates radial and vertical distances and plasma elongation for the geometry of the plasma - - :param r_0: plasma major radius - :type r_0: float - :param a: plasma minor radius - :type a: float - :param triang_95: plasma triangularity at 95% surface - :type triang_95: float - :param kappa_95: plasma elongation at 95% surface - :type kappa_95: float - :param i_single_null: switch for single null / double null plasma - :type i_single_null: bool - :return: dataclass returning plasma elongation and radial and vertical coordinates of the plasma - :rtype: PlasmaGeometry + """ + Calculates radial and vertical distances and plasma elongation for the geometry of the plasma. + + This function computes the radial and vertical coordinates of the plasma boundary, as well as the plasma elongation, + based on the given major radius, minor radius, triangularity, and elongation at 95% of the plasma surface. It also + considers whether the plasma configuration is single null or double null. + + :param rmajor: Plasma major radius. + :param rminor: Plasma minor radius. + :param triang_95: Plasma triangularity at 95% surface. + :param kappa_95: Plasma elongation at 95% surface. + :param i_single_null: Switch for single null (True) or double null (False) plasma configuration. + :return: A dataclass containing the plasma elongation and the radial and vertical coordinates of the plasma. + + The returned PlasmaGeometry dataclass contains: + - rs: List of radial coordinates for the inner and outer plasma boundaries. + - zs: List of vertical coordinates for the inner and outer plasma boundaries. + - kappa: Calculated plasma elongation. """ delta = 1.5 * triang_95 kappa = (1.1 * kappa_95) + 0.04 - x1 = (2.0 * r_0 * (1.0 + delta) - a * (delta**2 + kappa**2 - 1.0)) / ( - 2.0 * (1.0 + delta) - ) - x2 = (2.0 * r_0 * (delta - 1.0) - a * (delta**2 + kappa**2 - 1.0)) / ( - 2.0 * (delta - 1.0) - ) - r1 = 0.5 * math.sqrt( - (a**2 * ((delta + 1.0) ** 2 + kappa**2) ** 2) / ((delta + 1.0) ** 2) - ) - r2 = 0.5 * math.sqrt( - (a**2 * ((delta - 1.0) ** 2 + kappa**2) ** 2) / ((delta - 1.0) ** 2) - ) - theta1 = np.arcsin((kappa * a) / r1) - theta2 = np.arcsin((kappa * a) / r2) - inang = 1.0 / r1 - outang = 1.5 / r2 - if i_single_null == 0: - angs1 = np.linspace( - -(inang + theta1) + np.pi, (inang + theta1) + np.pi, 256, endpoint=True + # Original PROCESS double arc plasma shape + if i_plasma_shape == 0: + x1 = (2.0 * rmajor * (1.0 + delta) - rminor * (delta**2 + kappa**2 - 1.0)) / ( + 2.0 * (1.0 + delta) + ) + x2 = (2.0 * rmajor * (delta - 1.0) - rminor * (delta**2 + kappa**2 - 1.0)) / ( + 2.0 * (delta - 1.0) ) - angs2 = np.linspace(-(outang + theta2), (outang + theta2), 256, endpoint=True) - else: - angs1 = np.linspace( - -theta1 + np.pi, (inang + theta1) + np.pi, 256, endpoint=True + r1 = 0.5 * math.sqrt( + (rminor**2 * ((delta + 1.0) ** 2 + kappa**2) ** 2) / ((delta + 1.0) ** 2) ) - angs2 = np.linspace(-(outang + theta2), theta2, 256, endpoint=True) + r2 = 0.5 * math.sqrt( + (rminor**2 * ((delta - 1.0) ** 2 + kappa**2) ** 2) / ((delta - 1.0) ** 2) + ) + theta1 = np.arcsin((kappa * rminor) / r1) + theta2 = np.arcsin((kappa * rminor) / r2) + inang = 1.0 / r1 + outang = 1.5 / r2 + if i_single_null == 0: + angs1 = np.linspace( + -(inang + theta1) + np.pi, (inang + theta1) + np.pi, 256, endpoint=True + ) + angs2 = np.linspace( + -(outang + theta2), (outang + theta2), 256, endpoint=True + ) + else: + angs1 = np.linspace( + -theta1 + np.pi, (inang + theta1) + np.pi, 256, endpoint=True + ) + angs2 = np.linspace(-(outang + theta2), theta2, 256, endpoint=True) + + xs1 = -(r1 * np.cos(angs1) - x1) + ys1 = r1 * np.sin(angs1) + xs2 = -(r2 * np.cos(angs2) - x2) + ys2 = r2 * np.sin(angs2) + + rs = [xs1, xs2] + zs = [ys1, ys2] + + return PlasmaGeometry(rs=rs, zs=zs, kappa=kappa) - xs1 = -(r1 * np.cos(angs1) - x1) - ys1 = r1 * np.sin(angs1) - xs2 = -(r2 * np.cos(angs2) - x2) - ys2 = r2 * np.sin(angs2) + # Sauter plasma shape + if i_plasma_shape == 1: + x = np.linspace(-np.pi, np.pi, 256) - rs = [xs1, xs2] - zs = [ys1, ys2] + # Sauter + R = rmajor + rminor * np.cos(x + delta * np.sin(x) - square * np.sin(2 * x)) + Z = kappa * rminor * np.sin(x + square * np.sin(2 * x)) - return PlasmaGeometry(rs=rs, zs=zs, kappa=kappa) + return PlasmaGeometry(rs=R, zs=Z, kappa=kappa) diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index dd0b194bb1..d564b66895 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -189,32 +189,40 @@ def plot_plasma(axis, mfile_data, scan, colour_scheme): triang_95 = mfile_data.data["triang95"].get_scan(scan) kappa_95 = mfile_data.data["kappa95"].get_scan(scan) i_single_null = mfile_data.data["i_single_null"].get_scan(scan) + i_plasma_shape = mfile_data.data["i_plasma_shape"].get_scan(scan) + plasma_square = mfile_data.data["plasma_square"].get_scan(scan) pg = plasma_geometry( - r_0=r_0, - a=a, + rmajor=r_0, + rminor=a, triang_95=triang_95, kappa_95=kappa_95, i_single_null=i_single_null, + i_plasma_shape=i_plasma_shape, + square=plasma_square, ) + if i_plasma_shape == 0: + axis.plot(pg.rs[0], pg.zs[0], color="black") + axis.plot(pg.rs[1], pg.zs[1], color="black") - axis.plot(pg.rs[0], pg.zs[0], color="black") - axis.plot(pg.rs[1], pg.zs[1], color="black") + # Colour in right side of plasma + axis.fill_between( + x=pg.rs[0], + y1=pg.zs[0], + where=(pg.rs[0] > r_0 - (triang_95 * a * 1.5)), + color=PLASMA_COLOUR[colour_scheme - 1], + ) + # Colour in left side of plasma + axis.fill_between( + x=pg.rs[1], + y1=pg.zs[1], + where=(pg.rs[1] < r_0 - (triang_95 * a * 1.5)), + color=PLASMA_COLOUR[colour_scheme - 1], + ) - # Colour in right side of plasma - axis.fill_between( - x=pg.rs[0], - y1=pg.zs[0], - where=(pg.rs[0] > r_0 - (triang_95 * a * 1.5)), - color=PLASMA_COLOUR[colour_scheme - 1], - ) - # Colour in left side of plasma - axis.fill_between( - x=pg.rs[1], - y1=pg.zs[1], - where=(pg.rs[1] < r_0 - (triang_95 * a * 1.5)), - color=PLASMA_COLOUR[colour_scheme - 1], - ) + elif i_plasma_shape == 1: + axis.plot(pg.rs, pg.zs, color="black") + axis.fill(pg.rs, pg.zs, color=PLASMA_COLOUR[colour_scheme - 1]) def plot_centre_cross(axis, mfile_data, scan): diff --git a/process/physics.py b/process/physics.py index 48d944fa13..724841b2e2 100644 --- a/process/physics.py +++ b/process/physics.py @@ -3326,7 +3326,7 @@ def outplas(self): if stellarator_variables.istell == 0: if physics_variables.itart == 0: physics_module.itart_r = physics_variables.itart - po.ovarrf( + po.ovarin( self.outfile, "Tokamak aspect ratio = Conventional, itart = 0", "(itart)", @@ -3334,7 +3334,7 @@ def outplas(self): ) elif physics_variables.itart == 1: physics_module.itart_r = physics_variables.itart - po.ovarrf( + po.ovarin( self.outfile, "Tokamak aspect ratio = Spherical, itart = 1", "(itart)", @@ -3342,6 +3342,12 @@ def outplas(self): ) po.osubhd(self.outfile, "Plasma Geometry :") + po.ovarin( + self.outfile, + "Plasma shaping model", + "(i_plasma_shape)", + physics_variables.i_plasma_shape, + ) if physics_variables.i_plasma_shape == 0: po.osubhd(self.outfile, "Classic PROCESS plasma shape model is used :") elif physics_variables.i_plasma_shape == 1: @@ -3357,14 +3363,13 @@ def outplas(self): "OP ", ) po.ovarrf(self.outfile, "Aspect ratio", "(aspect)", physics_variables.aspect) - if physics_variables.i_plasma_shape == 1: - po.ovarrf( - self.outfile, - "Plasma squareness", - "(plasma_square)", - physics_variables.plasma_square, - "IP", - ) + po.ovarrf( + self.outfile, + "Plasma squareness", + "(plasma_square)", + physics_variables.plasma_square, + "IP", + ) if stellarator_variables.istell == 0: if physics_variables.i_plasma_geometry in [0, 6, 8]: po.ovarrf( From 7665b175940f1f081918f28e4598f81e88828720 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 14:35:57 +0000 Subject: [PATCH 26/38] :bug: Refactor plasma geometry parameters: rename triang_95 to triang and kappa_95 to kappa for consistency update related plotting functions --- process/geometry/plasma_geometry.py | 28 ++++++++++++++-------------- process/io/plot_proc.py | 12 ++++++++---- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/process/geometry/plasma_geometry.py b/process/geometry/plasma_geometry.py index 57aeaed2b5..9f444297f2 100644 --- a/process/geometry/plasma_geometry.py +++ b/process/geometry/plasma_geometry.py @@ -23,8 +23,8 @@ class PlasmaGeometry: def plasma_geometry( rmajor: float, rminor: float, - triang_95: float, - kappa_95: float, + triang: float, + kappa: float, i_single_null: int, i_plasma_shape: int, square: float, @@ -38,9 +38,11 @@ def plasma_geometry( :param rmajor: Plasma major radius. :param rminor: Plasma minor radius. - :param triang_95: Plasma triangularity at 95% surface. - :param kappa_95: Plasma elongation at 95% surface. - :param i_single_null: Switch for single null (True) or double null (False) plasma configuration. + :param triang: Plasma triangularity at separatrix. + :param kappa: Plasma elongation at separatrix. + :param i_single_null: Switch for single null (1) or double null (0) plasma configuration. + :param i_plasma_shape: Switch for plasma shape (0 for double arc, 1 for Sauter). + :param square: Square term for Sauter plasma shape. :return: A dataclass containing the plasma elongation and the radial and vertical coordinates of the plasma. The returned PlasmaGeometry dataclass contains: @@ -48,22 +50,20 @@ def plasma_geometry( - zs: List of vertical coordinates for the inner and outer plasma boundaries. - kappa: Calculated plasma elongation. """ - delta = 1.5 * triang_95 - kappa = (1.1 * kappa_95) + 0.04 # Original PROCESS double arc plasma shape if i_plasma_shape == 0: - x1 = (2.0 * rmajor * (1.0 + delta) - rminor * (delta**2 + kappa**2 - 1.0)) / ( - 2.0 * (1.0 + delta) + x1 = (2.0 * rmajor * (1.0 + triang) - rminor * (triang**2 + kappa**2 - 1.0)) / ( + 2.0 * (1.0 + triang) ) - x2 = (2.0 * rmajor * (delta - 1.0) - rminor * (delta**2 + kappa**2 - 1.0)) / ( - 2.0 * (delta - 1.0) + x2 = (2.0 * rmajor * (triang - 1.0) - rminor * (triang**2 + kappa**2 - 1.0)) / ( + 2.0 * (triang - 1.0) ) r1 = 0.5 * math.sqrt( - (rminor**2 * ((delta + 1.0) ** 2 + kappa**2) ** 2) / ((delta + 1.0) ** 2) + (rminor**2 * ((triang + 1.0) ** 2 + kappa**2) ** 2) / ((triang + 1.0) ** 2) ) r2 = 0.5 * math.sqrt( - (rminor**2 * ((delta - 1.0) ** 2 + kappa**2) ** 2) / ((delta - 1.0) ** 2) + (rminor**2 * ((triang - 1.0) ** 2 + kappa**2) ** 2) / ((triang - 1.0) ** 2) ) theta1 = np.arcsin((kappa * rminor) / r1) theta2 = np.arcsin((kappa * rminor) / r2) @@ -97,7 +97,7 @@ def plasma_geometry( x = np.linspace(-np.pi, np.pi, 256) # Sauter - R = rmajor + rminor * np.cos(x + delta * np.sin(x) - square * np.sin(2 * x)) + R = rmajor + rminor * np.cos(x + triang * np.sin(x) - square * np.sin(2 * x)) Z = kappa * rminor * np.sin(x + square * np.sin(2 * x)) return PlasmaGeometry(rs=R, zs=Z, kappa=kappa) diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index d564b66895..5b3c3d2bab 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -186,8 +186,8 @@ def plot_plasma(axis, mfile_data, scan, colour_scheme): r_0 = mfile_data.data["rmajor"].get_scan(scan) a = mfile_data.data["rminor"].get_scan(scan) - triang_95 = mfile_data.data["triang95"].get_scan(scan) - kappa_95 = mfile_data.data["kappa95"].get_scan(scan) + triang = mfile_data.data["triang"].get_scan(scan) + kappa = mfile_data.data["kappa"].get_scan(scan) i_single_null = mfile_data.data["i_single_null"].get_scan(scan) i_plasma_shape = mfile_data.data["i_plasma_shape"].get_scan(scan) plasma_square = mfile_data.data["plasma_square"].get_scan(scan) @@ -195,8 +195,8 @@ def plot_plasma(axis, mfile_data, scan, colour_scheme): pg = plasma_geometry( rmajor=r_0, rminor=a, - triang_95=triang_95, - kappa_95=kappa_95, + triang=triang, + kappa=kappa, i_single_null=i_single_null, i_plasma_shape=i_plasma_shape, square=plasma_square, @@ -205,6 +205,10 @@ def plot_plasma(axis, mfile_data, scan, colour_scheme): axis.plot(pg.rs[0], pg.zs[0], color="black") axis.plot(pg.rs[1], pg.zs[1], color="black") + # Set triang_95 to stop plotting plasma past boundary + # Assume IPDG scaling + triang_95 = triang / 1.5 + # Colour in right side of plasma axis.fill_between( x=pg.rs[0], From fed78853a1439909ff656aed0bb01d31fb117e7a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 15:47:29 +0000 Subject: [PATCH 27/38] =?UTF-8?q?=F0=9F=94=84Rename=20xsurf=20to=20plasma?= =?UTF-8?q?=5Fsurface=5Farea=20for=20clarity=20and=20update=20related=20te?= =?UTF-8?q?sts=20and=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../physics-models/plasma_geometry.md | 110 +++++++++--------- process/plasma_geometry.py | 4 +- tests/unit/test_plasma_geom.py | 34 +++--- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index eae187abe9..b645aa7f84 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -351,7 +351,7 @@ $$ ------------------ -### Surface Area | `xsurf()` +### Surface Area | `plasma_surface_area()` This function finds the plasma surface area, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. @@ -395,60 +395,6 @@ $$ ------------------ -### Sauter geoemtry | `sauter_geometry()` - -Plasma geometry based on equations'Geometric formulas for system codes including the effect of negative triangularity'[^7] - -| Input Variable | Description | -|----------|--------------------------------------| -| `rminor`, $a$ | Plasma minor radius [$\text{m}$] | -| `rmajor`, $R$ | Plasma major radius [$\text{m}$] | -| `kappa`, $\kappa$ | Plasma separatrix elongation | -| `triang`, $\delta$ | Plasma separatrix triangularity | - - -| Output Variable | Description | -|----------|--------------------------------------| -| `len_plasma_poloidal` | Plasma Poloidal perimeter length [$\text{m}$] | -| `a_plasma_surface` | Plasma surface area [$\text{m}^2$] | -| `a_plasma_poloidal` | Plasma cross-sectional area [$\text{m}^2$] | -| `vol_plasma` | Plasma volume [$\text{m}^3$] | - -$$ -\mathtt{w07} = 1 -$$ - -$$ -\epsilon = \frac{a}{R} -$$ - -Poloidal perimeter (named Lp in Sauter) - -$$ -\mathtt{len\_plasma\_poloidal} = 2.0\pi a (1 + 0.55 (\kappa - 1))(1 + 0.08 \delta^2)(1 + 0.2 (\mathtt{w07} - 1)) -$$ - -Surface area (named Ap in Sauter) - -$$ -\mathtt{a\_plasma\_surface} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{len\_plasma\_poloidal} -$$ - -Cross-section area (named S_phi in Sauter) - -$$ -\mathtt{a\_plasma\_poloidal} = \pi a^2 \kappa (1 + 0.52 (\mathtt{w07} - 1)) -$$ - -Volume - -$$ -\mathtt{vol\_plasma} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{a\_plasma\_poloidal} -$$ - - ------------------- - ### Poloidal perimeter | `plasma_poloidal_perimeter()` The poloidal plasma perimtere length `len_plasma_poloidal` is calculated as follows: @@ -541,6 +487,60 @@ $$ + \mathtt{xi}^2 \times (\mathtt{thetai} - \cos{(\mathtt{thetai})} \times \sin{(\mathtt{thetai}))} $$ +------------------ + +### Sauter geoemtry | `sauter_geometry()` + +Plasma geometry based on equations'Geometric formulas for system codes including the effect of negative triangularity'[^7] + +| Input Variable | Description | +|----------|--------------------------------------| +| `rminor`, $a$ | Plasma minor radius [$\text{m}$] | +| `rmajor`, $R$ | Plasma major radius [$\text{m}$] | +| `kappa`, $\kappa$ | Plasma separatrix elongation | +| `triang`, $\delta$ | Plasma separatrix triangularity | + + +| Output Variable | Description | +|----------|--------------------------------------| +| `len_plasma_poloidal` | Plasma Poloidal perimeter length [$\text{m}$] | +| `a_plasma_surface` | Plasma surface area [$\text{m}^2$] | +| `a_plasma_poloidal` | Plasma cross-sectional area [$\text{m}^2$] | +| `vol_plasma` | Plasma volume [$\text{m}^3$] | + +$$ +\mathtt{w07} = 1 +$$ + +$$ +\epsilon = \frac{a}{R} +$$ + +Poloidal perimeter (named Lp in Sauter) + +$$ +\mathtt{len\_plasma\_poloidal} = 2.0\pi a (1 + 0.55 (\kappa - 1))(1 + 0.08 \delta^2)(1 + 0.2 (\mathtt{w07} - 1)) +$$ + +Surface area (named Ap in Sauter) + +$$ +\mathtt{a\_plasma\_surface} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{len\_plasma\_poloidal} +$$ + +Cross-section area (named S_phi in Sauter) + +$$ +\mathtt{a\_plasma\_poloidal} = \pi a^2 \kappa (1 + 0.52 (\mathtt{w07} - 1)) +$$ + +Volume + +$$ +\mathtt{vol\_plasma} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{a\_plasma\_poloidal} +$$ + + ------------------ ## Legacy claculations diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index ee60f305f3..f2f0b25a1b 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -248,7 +248,7 @@ def plasma_geometry(self) -> None: # Surface area - inboard and outboard. These are not given by Sauter but # the outboard area is required by DCLL and divertor - xsi, xso = self.xsurf( + xsi, xso = self.plasma_surface_area( physics_variables.rmajor, physics_variables.rminor, xi, @@ -369,7 +369,7 @@ def plasma_poloidal_perimeter( return 2.0e0 * (xo * thetao + xi * thetai) @staticmethod - def xsurf( + def plasma_surface_area( rmajor: float, rminor: float, xi: float, thetai: float, xo: float, thetao: float ) -> tuple[float, float]: """ diff --git a/tests/unit/test_plasma_geom.py b/tests/unit/test_plasma_geom.py index 266acb43d2..b9f250065c 100644 --- a/tests/unit/test_plasma_geom.py +++ b/tests/unit/test_plasma_geom.py @@ -265,7 +265,7 @@ def test_xsect0(a, kap, tri, expected_xsect0): assert pytest.approx(xsect0) == expected_xsect0 -class XsurfParam(NamedTuple): +class SurfaceAreaParam(NamedTuple): rmajor: Any = None rminor: Any = None @@ -284,9 +284,9 @@ class XsurfParam(NamedTuple): @pytest.mark.parametrize( - "xsurfparam", + "surfaceareaparam", ( - XsurfParam( + SurfaceAreaParam( rmajor=8.8901000000000003, rminor=2.8677741935483869, xi=10.510690667870968, @@ -296,7 +296,7 @@ class XsurfParam(NamedTuple): expected_xsi=454.0423505329922, expected_xso=949.22962703393853, ), - XsurfParam( + SurfaceAreaParam( rmajor=8.8901000000000003, rminor=2.8677741935483869, xi=10.510690667870968, @@ -308,31 +308,31 @@ class XsurfParam(NamedTuple): ), ), ) -def test_xsurf(xsurfparam, monkeypatch, plasma): +def test_plasma_surface_area(surfaceareaparam, monkeypatch, plasma): """ - Automatically generated Regression Unit Test for xsurf. + Automatically generated Regression Unit Test for plasma_surface_area(). This test was generated using data from tracking/baseline_2018/baseline_2018_IN.DAT. - :param xsurfparam: the data used to mock and assert in this test. - :type xsurfparam: xsurfparam + :param surfaceareaparam: the data used to mock and assert in this test. + :type surfaceareaparam: surfaceareaparam :param monkeypatch: pytest fixture used to mock module/class variables :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - xsi, xso = plasma.xsurf( - rmajor=xsurfparam.rmajor, - rminor=xsurfparam.rminor, - xi=xsurfparam.xi, - thetai=xsurfparam.thetai, - xo=xsurfparam.xo, - thetao=xsurfparam.thetao, + xsi, xso = plasma.plasma_surface_area( + rmajor=surfaceareaparam.rmajor, + rminor=surfaceareaparam.rminor, + xi=surfaceareaparam.xi, + thetai=surfaceareaparam.thetai, + xo=surfaceareaparam.xo, + thetao=surfaceareaparam.thetao, ) - assert xsi == pytest.approx(xsurfparam.expected_xsi) + assert xsi == pytest.approx(surfaceareaparam.expected_xsi) - assert xso == pytest.approx(xsurfparam.expected_xso) + assert xso == pytest.approx(surfaceareaparam.expected_xso) class SurfaParam(NamedTuple): From 79801628162e230aeb401b59e0b15ba29d897243 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 15:52:24 +0000 Subject: [PATCH 28/38] =?UTF-8?q?=E2=9C=A8=20Add=20plasma=5Fsquare=20param?= =?UTF-8?q?eter=20to=20Sauter=20geometry=20calculations=20for=20enhanced?= =?UTF-8?q?=20plasma=20geometry=20modeling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proc-pages/physics-models/plasma_geometry.md | 3 ++- process/plasma_geometry.py | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index b645aa7f84..af6104febc 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -499,6 +499,7 @@ Plasma geometry based on equations'Geometric formulas for system codes including | `rmajor`, $R$ | Plasma major radius [$\text{m}$] | | `kappa`, $\kappa$ | Plasma separatrix elongation | | `triang`, $\delta$ | Plasma separatrix triangularity | +| `plasma_square`, $\xi$ | Plasma squareness | | Output Variable | Description | @@ -509,7 +510,7 @@ Plasma geometry based on equations'Geometric formulas for system codes including | `vol_plasma` | Plasma volume [$\text{m}^3$] | $$ -\mathtt{w07} = 1 +\mathtt{w07} = \mathtt{plasma\_square} + 1 $$ $$ diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index f2f0b25a1b..a27e417d2d 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -275,6 +275,7 @@ def plasma_geometry(self) -> None: physics_variables.rmajor, physics_variables.kappa, physics_variables.triang, + physics_variables.plasma_square, ) else: @@ -497,7 +498,7 @@ def plasma_cross_section( @staticmethod def sauter_geometry( - a: float, r0: float, kappa: float, triang: float + a: float, r0: float, kappa: float, triang: float, square: float ) -> tuple[float, float, float, float, float]: """ Calculate the plasma geometry parameters using the Sauter geometry model. @@ -507,6 +508,7 @@ def sauter_geometry( r0 (float): Plasma major radius (m) kappa (float): Plasma separatrix elongation triang (float): Plasma separatrix triangularity + square (float): Plasma squareness Returns: tuple: A tuple containing: @@ -524,8 +526,8 @@ def sauter_geometry( """ - # Calculate w07 parameter from paper - w07 = 1 + # Calculate w07 parameter from paper from squareness assuming top-down symmetry + w07 = square + 1 # Inverse aspect ratio eps = a / r0 From e831e5dd83c3efd2af6e690c941e7de9afbdec0a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 16:24:13 +0000 Subject: [PATCH 29/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20cwrmax=20to=20f?= =?UTF-8?q?=5Fr=5Fconducting=5Fwall=20for=20consistency=20in=20documentati?= =?UTF-8?q?on=20and=20code=20update=20related=20tests=20and=20input=20file?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proc-pages/physics-models/error.txt | 6 +-- .../physics-models/plasma_geometry.md | 50 +++++++++++-------- source/fortran/constraint_equations.f90 | 10 ++-- source/fortran/input.f90 | 6 +-- source/fortran/physics_variables.f90 | 4 +- tests/integration/ref_dicts.json | 10 ++-- .../input_files/st_regression.IN.DAT | 4 +- 7 files changed, 50 insertions(+), 40 deletions(-) diff --git a/documentation/proc-pages/physics-models/error.txt b/documentation/proc-pages/physics-models/error.txt index 0d74cee2b7..d69f47881d 100644 --- a/documentation/proc-pages/physics-models/error.txt +++ b/documentation/proc-pages/physics-models/error.txt @@ -182,10 +182,10 @@ significant elongation \footnote{Y. Sakamoto, `Recent progress in vertical stability analysis in JA', Task meeting EU-JA \#16, Fusion for Energy, Garching, 24--25 June 2014}. The maximum distance \(r_{\text{shell, max}}\) of this shell from the centre of the plasma -may be set using input parameter \texttt{cwrmax}, such that -\(r_{\text{shell, max}} =\) \texttt{cwrmax*rminor}. Constraint equation +may be set using input parameter \texttt{f_r_conducting_wall}, such that +\(r_{\text{shell, max}} =\) \texttt{f_r_conducting_wall*rminor}. Constraint equation no. 23 should be turned on with iteration variable no.~104 -(\texttt{fcwr}) to enforce this. (A scaling of \texttt{cwrmax} with +(\texttt{fcwr}) to enforce this. (A scaling of \texttt{f_r_conducting_wall} with elongation should be available shortly.) The plasma surface area, cross-sectional area and volume are calculated diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index af6104febc..c3ceeb8280 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -89,6 +89,12 @@ This subroutine calculates the plasma geometry parameters based on the given inp The plasma geometry parameters include the shaping terms, plasma aspect ratio, elongation, and triangularity. The function uses various scaling laws and formulas to calculate these parameters based on the specified shape type. +If the classic PROCESS plasma shape is used (`i_plasma_shape = 0`) the plasma surface area, cross-sectional area and volume are calculated using +formulations that approximate the LCFS as a revolution of two arcs which +intersect the plasma X-points and the plasma midplane outer and inner +radii. (This is a reasonable assumption for double-null diverted plasmas, but +will be inaccurate for single-null plasmas, `i_single_null = 1`) + ### Elongation & Triangularity ---- @@ -247,23 +253,6 @@ $$ --------------------------------------------------------------------- -An explicit constraint relating to the plasma's vertical stability may be turned on if -required. In principle, the inner surface of the outboard shield could be used -as the location of a conducting shell to mitigate the vertical -displacement growth rate of plasmas with significant elongation [^5]. The -maximum permissible distance $r_{\text{shell, max}}$ of this shell from the geometric -centre of the plasma may be set using input parameter `cwrmax`, such that -$r_{\text{shell, max}} =$ `cwrmax*rminor`. Constraint equation -no. 23 should be turned on with iteration variable no.\ 104 (`fcwr`) to enforce -this - -The plasma surface area, cross-sectional area and volume are calculated using -formulations that approximate the LCFS as a revolution of two arcs which -intersect the plasma X-points and the plasma midplane outer and inner -radii. (This is a reasonable assumption for double-null diverted plasmas, but -will be inaccurate for single-null plasmas, `snull = 1`) - ------------------- ### Plasma-Wall Gap @@ -544,6 +533,24 @@ $$ ------------------ +## Key Constraints + +### Conducting shell radius + +This constraint can be activated by stating `icc = 23` in the input file. + +In principle, the inner surface of the outboard shield could be used +as the location of a conducting shell to mitigate the vertical +displacement growth rate of plasmas with significant elongation [^8]. + +The maximum permissible distance $r_{\text{shell, max}}$ of this shell from the geometric +centre of the plasma may be set using input parameter `f_r_conducting_wall`, such that +$r_{\text{shell, max}} =$ `f_r_conducting_wall*rminor`. + +The scaling value `fcwr` can be varied also. + +--------------------- + ## Legacy claculations ### STAR Code plasma surface area | `surfa()` @@ -605,6 +612,8 @@ $$ \mathtt{sa} = \mathtt{so} + \mathtt{si} $$ +------------------------- + ### Plasma poloidal perimeter calculation | `perim()` This function finds the plasma poloidal perimeter, using the @@ -653,6 +662,7 @@ $$ \mathtt{perim} = 2.0 \times (\mathtt{xlo} \times \mathtt{thetao} + \mathtt{xli} \times \mathtt{thetai}) $$ +------------------------- ### Plasma volume calculation | `fvol()` @@ -706,6 +716,8 @@ $$ \mathtt{fvol} = \mathtt{vout} - \mathtt{vin} $$ +------------------------- + ### Plasma cross sectional area calculation | `xsecto()` This function finds the plasma cross-sectional area, using the @@ -774,9 +786,7 @@ Unpublished internal Oak Ridge document. [^3]: H. Zohm et al, *'On the Physics Guidelines for a Tokamak DEMO'*, FTP/3-3, Proc. IAEA Fusion Energy Conference, October 2012, San Diego [^4]: Menard, J.E. & Brown, T. & El-Guebaly, L. & Boyer, M. & Canik, J. & Colling, Bethany & Raman, Roger & Wang, Z. & Zhai, Yunbo & Buxton, Peter & Covele, B. & D’Angelo, C. & Davis, Andrew & Gerhardt, S. & Gryaznevich, M. & Harb, Moataz & Hender, T.C. & Kaye, S. & Kingham, David & Woolley, R.. (2016). *Fusion nuclear science facilities and pilot plants based on the spherical tokamak.* Nuclear Fusion. 56. 106023. 10.1088/0029-5515/56/10/106023. -[^5]: H.S. Bosch and G.M. Hale, *Improved Formulas for Fusion Cross-sections* -and Thermal Reactivities', Nuclear Fusion 32 (1992) 611 [^6]: J D Galambos, *STAR Code : Spherical Tokamak Analysis and Reactor Code*, unpublished internal Oak Ridge document [^7]: O. Sauter, “Geometric formulas for system codes including the effect of negative triangularity,” Fusion Engineering and Design, vol. 112, pp. 633–645, Nov. 2016, doi: https://doi.org/10.1016/j.fusengdes.2016.04.033. -‌ \ No newline at end of file +[^8]: 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 diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index 48f5f6c630..132be296bc 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -1219,7 +1219,7 @@ subroutine constraint_eqn_023(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! residual error in physical units; output string; units string !! Equation for conducting shell radius / rminor upper limit !! #=# physics - !! #=#=# fcwr, cwrmax + !! #=#=# fcwr, f_r_conducting_wall !! and hence also optional here. !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! rminor : input real : plasma minor radius (m) @@ -1227,8 +1227,8 @@ subroutine constraint_eqn_023(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! fwoth : input real : outboard first wall thickness, initial estimate (m) !! blnkoth : input real : outboard blanket thickness (m) !! fcwr : input real : f-value for conducting wall radius / rminor limit - !! cwrmax : input real : maximum ratio of conducting wall distance to plasma minor radius for vertical stability - use physics_variables, only: rminor, cwrmax + !! f_r_conducting_wall : input real : maximum ratio of conducting wall distance to plasma minor radius for vertical stability + use physics_variables, only: rminor, f_r_conducting_wall use build_variables, only: scraplo, fwoth, blnkoth use constraint_variables, only: fcwr implicit none @@ -1241,8 +1241,8 @@ subroutine constraint_eqn_023(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) real(dp) :: rcw rcw = rminor + scraplo + fwoth + blnkoth - tmp_cc = 1.0D0 - fcwr * cwrmax*rminor / rcw - tmp_con = cwrmax*rminor * (1.0D0 - tmp_cc) + tmp_cc = 1.0D0 - fcwr * f_r_conducting_wall*rminor / rcw + tmp_con = f_r_conducting_wall*rminor * (1.0D0 - tmp_cc) tmp_err = rcw * tmp_cc tmp_symbol = '<' tmp_units = 'm' diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index be81907618..216b581dd4 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -305,7 +305,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) ccl0_ma, ccls_ma, ld_ratio_cst use physics_variables, only: ipedestal, taumax, i_single_null, fvsbrnni, & rhopedt, f_vol_plasma, f_deuterium, ffwal, i_beta_component, itartpf, ilhthresh, & - fpdivlim, beta_poloidal_eps_max, isc, kappa95, aspect, cwrmax, nesep, c_beta, csawth, dene, & + fpdivlim, beta_poloidal_eps_max, isc, kappa95, aspect, f_r_conducting_wall, nesep, c_beta, csawth, dene, & ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, beta_norm_max, & fgwsep, rhopedn, tratio, q0, i_plasma_geometry, i_plasma_shape, fne0, ignite, f_tritium, & i_beta_fast_alpha, tauee_in, alphaj, alphat, i_plasma_current, q, ti, tesep, rli, triang, & @@ -560,8 +560,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('f_vol_plasma') call parse_real_variable('f_vol_plasma', f_vol_plasma, 0.01D0, 10.0D0, & 'Plasma volume multiplier') - case ('cwrmax') - call parse_real_variable('cwrmax', cwrmax, 1.0D0, 3.0D0, & + case ('f_r_conducting_wall') + call parse_real_variable('f_r_conducting_wall', f_r_conducting_wall, 1.0D0, 3.0D0, & 'Max conducting shell to rminor radius') case ('dene') call parse_real_variable('dene', dene, 1.0D18, 1.0D22, & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index a68773ecb9..28a09efbb3 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -128,7 +128,7 @@ module physics_variables real(dp) :: f_vol_plasma !! multiplying factor for the plasma volume (normally=1) - real(dp) :: cwrmax + real(dp) :: f_r_conducting_wall !! maximum ratio of conducting wall distance to plasma minor radius for !! vertical stability (`constraint equation 23`) @@ -984,7 +984,7 @@ subroutine init_physics_variables c_beta = 0.5D0 csawth = 1.0D0 f_vol_plasma = 1.0D0 - cwrmax = 1.35D0 + f_r_conducting_wall = 1.35D0 dene = 9.8D19 deni = 0.0D0 dlamee = 0.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index bf74eb81cd..bb393937e8 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1581,7 +1581,7 @@ "curpfs": 0.0, "curr1_": "e_*vte1_", "f_vol_plasma": 1.0, - "cwrmax": 1.35, + "f_r_conducting_wall": 1.35, "czero": "(0.0_wp_, 0.0_wp_)", "d_vv_bot": 0.07, "d_vv_in": 0.07, @@ -9246,7 +9246,7 @@ "curpfs": "PF coil current array, at end of pulse (MA)\n Indexed by coil number, not group number", "curr1_": "", "f_vol_plasma": "multiplying factor times plasma volume (normally=1)", - "cwrmax": "maximum ratio of conducting wall distance to plasma minor radius for\n vertical stability (`constraint equation 23`)", + "f_r_conducting_wall": "maximum ratio of conducting wall distance to plasma minor radius for\n vertical stability (`constraint equation 23`)", "czero": "", "d_vv_bot": "vacuum vessel underside thickness (TF coil / shield) (m)", "d_vv_in": "vacuum vessel inboard thickness (TF coil / shield) (m)", @@ -12119,7 +12119,7 @@ "lb": 0.01, "ub": 10.0 }, - "cwrmax": { + "f_r_conducting_wall": { "lb": 1.0, "ub": 3.0 }, @@ -19087,7 +19087,7 @@ "bvert", "csawth", "f_vol_plasma", - "cwrmax", + "f_r_conducting_wall", "dene", "deni", "dlamee", @@ -20151,7 +20151,7 @@ "csi": "real_variable", "cturbb": "real_variable", "f_vol_plasma": "real_variable", - "cwrmax": "real_variable", + "f_r_conducting_wall": "real_variable", "d_vv_bot": "real_variable", "d_vv_in": "real_variable", "d_vv_out": "real_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index e258d7e149..cd70b4a03f 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -225,9 +225,9 @@ triang = 0.5 *icc = 23 * DESCRIPTION: Constraint equation for conducting shell radius / rminor upper limit (FW) * JUSTIFICATION: Turned off, dont care about shell radius ratio limit for vertical stability -* VARIABLES: cwrmax calculated in-situ +* VARIABLES: f_r_conducting_wall calculated in-situ -*cwrmax = +*f_r_conducting_wall = * DESCRIPTION: Max conducting shell to rminor radius * JUSTIFICATION: Not using icc = 23 From 84ad56787f6f3c95383c75cf92ed21263aacdb06 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 16:25:13 +0000 Subject: [PATCH 30/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20fcwr=20to=20fr=5F?= =?UTF-8?q?conducting=5Fwall=20for=20consistency=20across=20modules=20and?= =?UTF-8?q?=20update=20related=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/fortran/constraint_equations.f90 | 8 ++++---- source/fortran/constraint_variables.f90 | 4 ++-- source/fortran/input.f90 | 4 ++-- source/fortran/iteration_variables.f90 | 10 +++++----- source/fortran/numerics.f90 | 2 +- tests/integration/ref_dicts.json | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index 132be296bc..22e5bf3d35 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -1219,18 +1219,18 @@ subroutine constraint_eqn_023(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! residual error in physical units; output string; units string !! Equation for conducting shell radius / rminor upper limit !! #=# physics - !! #=#=# fcwr, f_r_conducting_wall + !! #=#=#fr_conducting_wall, f_r_conducting_wall !! and hence also optional here. !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! rminor : input real : plasma minor radius (m) !! scraplo : input real : gap between plasma and first wall, outboard side (m) !! fwoth : input real : outboard first wall thickness, initial estimate (m) !! blnkoth : input real : outboard blanket thickness (m) - !! fcwr : input real : f-value for conducting wall radius / rminor limit + !!fr_conducting_wall : input real : f-value for conducting wall radius / rminor limit !! f_r_conducting_wall : input real : maximum ratio of conducting wall distance to plasma minor radius for vertical stability use physics_variables, only: rminor, f_r_conducting_wall use build_variables, only: scraplo, fwoth, blnkoth - use constraint_variables, only: fcwr + use constraint_variables, only:fr_conducting_wall implicit none real(dp), intent(out) :: tmp_cc real(dp), intent(out) :: tmp_con @@ -1241,7 +1241,7 @@ subroutine constraint_eqn_023(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) real(dp) :: rcw rcw = rminor + scraplo + fwoth + blnkoth - tmp_cc = 1.0D0 - fcwr * f_r_conducting_wall*rminor / rcw + tmp_cc = 1.0D0 -fr_conducting_wall * f_r_conducting_wall*rminor / rcw tmp_con = f_r_conducting_wall*rminor * (1.0D0 - tmp_cc) tmp_err = rcw * tmp_cc tmp_symbol = '<' diff --git a/source/fortran/constraint_variables.f90 b/source/fortran/constraint_variables.f90 index 7acb2d1e9f..f04e9920de 100644 --- a/source/fortran/constraint_variables.f90 +++ b/source/fortran/constraint_variables.f90 @@ -46,7 +46,7 @@ module constraint_variables !! f-value for TF coil current per turn upper limit !! (`constraint equation 77`, `iteration variable 146`) - real(dp) :: fcwr + real(dp) ::fr_conducting_wall !! f-value for conducting wall radius / rminor limit !! (`constraint equation 23`, `iteration variable 104`) @@ -322,7 +322,7 @@ subroutine init_constraint_variables fbeta_max = 1.0D0 fbeta_min = 1.0D0 fcpttf = 1.0D0 - fcwr = 1.0D0 + fr_conducting_wall = 1.0D0 fdene = 1.0D0 fdivcol = 1.0D0 fdtmp = 1.0D0 diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 216b581dd4..80226475c2 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -232,7 +232,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) beta_poloidal_max, fpsepbqar, ftmargtf, fradwall, fptfnuc, fnesep, fportsz, tbrmin, & maxradwallload, pseprmax, fdene, fniterpump, fpinj, pnetelin, powfmax, & fgamcd, ftbr, mvalim, taulimit, walalw, fmva, fradpwr, nflutfmax, fipir, & - fauxmn, fiooic, fcwr, fjohc0, frminor, psepbqarmax, ftpeak, bigqmin, & + fauxmn, fiooic,fr_conducting_wall, fjohc0, frminor, psepbqarmax, ftpeak, bigqmin, & fstrcond, fptemp, ftmargoh, fvs, fbeta_max, vvhealw, fpnetel, ft_burn, & ffuspow, fpsepr, ptfnucmax, fvdump, pdivtlim, ftaulimit, nbshinefmax, & fcqt, fzeffmax, fstrcase, fhldiv, foh_stress, fwalld, gammax, fjprot, & @@ -811,7 +811,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) call parse_real_variable('fecrh_ignition', fecrh_ignition, 0.001D0, 10.0D0, & 'F-value for ecrh ignition constraint') case ('fcwr') - call parse_real_variable('fcwr', fcwr, 0.001D0, 10.0D0, & + call parse_real_variable('fcwr',fr_conducting_wall, 0.001D0, 10.0D0, & 'F-value for conducting wall radius') case ('fdene') call parse_real_variable('fdene', fdene, 0.001D0, 10.0D0, & diff --git a/source/fortran/iteration_variables.f90 b/source/fortran/iteration_variables.f90 index 948a04c024..21b96ed632 100755 --- a/source/fortran/iteration_variables.f90 +++ b/source/fortran/iteration_variables.f90 @@ -2243,7 +2243,7 @@ end subroutine set_itv_103 !--------------------------------- subroutine init_itv_104 - !!
  • (104) fcwr (f-value for equation 23) + !!
  • (104)fr_conducting_wall (f-value for equation 23) use numerics, only: lablxc, boundl, boundu implicit none lablxc(104) = 'fcwr ' @@ -2252,16 +2252,16 @@ subroutine init_itv_104 end subroutine init_itv_104 real(kind(1.d0)) function itv_104() - use constraint_variables, only: fcwr + use constraint_variables, only:fr_conducting_wall implicit none - itv_104 = fcwr + itv_104 =fr_conducting_wall end function itv_104 subroutine set_itv_104(ratio) - use constraint_variables, only: fcwr + use constraint_variables, only:fr_conducting_wall implicit none real(kind(1.d0)) :: ratio - fcwr = ratio + fr_conducting_wall = ratio end subroutine set_itv_104 !--------------------------------- diff --git a/source/fortran/numerics.f90 b/source/fortran/numerics.f90 index bbdadc77c2..0724b5ceef 100755 --- a/source/fortran/numerics.f90 +++ b/source/fortran/numerics.f90 @@ -305,7 +305,7 @@ module numerics !!
  • (101) NOT USED !!
  • (102) fimpvar # OBSOLETE !!
  • (103) flhthresh (f-value for equation 15) - !!
  • (104) fcwr (f-value for equation 23) + !!
  • (104)fr_conducting_wall (f-value for equation 23) !!
  • (105) fnbshinef (f-value for equation 59) !!
  • (106) ftmargoh (f-value for equation 60) !!
  • (107) favail (f-value for equation 61) diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index bb393937e8..28c7958c3d 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -9962,8 +9962,8 @@ "ksic": "power fraction for outboard double-null scrape-off plasma", "lablcc": "lablcc(ipeqns) : labels describing constraint equations (corresponding itvs)
      \n
      \n
    • ( 1) Beta (consistency equation) (itv 5)\n
    • ( 2) Global power balance (consistency equation) (itv 10,1,2,3,4,6,11)\n
    • ( 3) Ion power balance DEPRECATED (itv 10,1,2,3,4,6,11)\n
    • ( 4) Electron power balance DEPRECATED (itv 10,1,2,3,4,6,11)\n
    • ( 5) Density upper limit (itv 9,1,2,3,4,5,6)\n
    • ( 6) (Epsilon x beta poloidal) upper limit (itv 8,1,2,3,4,6)\n
    • ( 7) Beam ion density (NBI) (consistency equation) (itv 7)\n
    • ( 8) Neutron wall load upper limit (itv 14,1,2,3,4,6)\n
    • ( 9) Fusion power upper limit (itv 26,1,2,3,4,6)\n
    • (10) Toroidal field 1/R (consistency equation) (itv 12,1,2,3,13 )\n
    • (11) Radial build (consistency equation) (itv 3,1,13,16,29,42,61)\n
    • (12) Volt second lower limit (STEADY STATE) (itv 15,1,2,3)\n
    • (13) Burn time lower limit (PULSE) (itv 21,1,16,17,29,42,44,61)\n (itv 19,1,2,3,6)\n
    • (14) Neutral beam decay lengths to plasma centre (NBI) (consistency equation)\n
    • (15) LH power threshold limit (itv 103)\n
    • (16) Net electric power lower limit (itv 25,1,2,3)\n
    • (17) Radiation fraction upper limit (itv 28)\n
    • (18) Divertor heat load upper limit (itv 27)\n
    • (19) MVA upper limit (itv 30)\n
    • (20) Neutral beam tangency radius upper limit (NBI) (itv 33,31,3,13)\n
    • (21) Plasma minor radius lower limit (itv 32)\n
    • (22) Divertor collisionality upper limit (itv 34,43)\n
    • (23) Conducting shell to plasma minor radius ratio upper limit\n (itv 104,1,74)\n
    • (24) Beta upper limit (itv 36,1,2,3,4,6,18)\n
    • (25) Peak toroidal field upper limit (itv 35,3,13,29)\n
    • (26) Central solenoid EOF current density upper limit (ipfres=0)\n (itv 38,37,41,12)\n
    • (27) Central solenoid BOP current density upper limit (ipfres=0)\n (itv 39,37,41,12)\n
    • (28) Fusion gain Q lower limit (itv 45,47,40)\n
    • (29) Inboard radial build consistency (itv 3,1,13,16,29,42,61)\n
    • (30) Injection power upper limit (itv 46,47,11)\n
    • (31) TF coil case stress upper limit (SCTF) (itv 48,56,57,58,59,60,24)\n
    • (32) TF coil conduit stress upper limit (SCTF) (itv 49,56,57,58,59,60,24)\n
    • (33) I_op / I_critical (TF coil) (SCTF) (itv 50,56,57,58,59,60,24)\n
    • (34) Dump voltage upper limit (SCTF) (itv 51,52,56,57,58,59,60,24)\n
    • (35) J_winding pack/J_protection upper limit (SCTF) (itv 53,56,57,58,59,60,24)\n
    • (36) TF coil temperature margin lower limit (SCTF) (itv 54,55,56,57,58,59,60,24)\n
    • (37) Current drive gamma upper limit (itv 40,47)\n
    • (38) First wall coolant temperature rise upper limit (itv 62)\n
    • (39) First wall peak temperature upper limit (itv 63)\n
    • (40) Start-up injection power lower limit (PULSE) (itv 64)\n
    • (41) Plasma current ramp-up time lower limit (PULSE) (itv 66,65)\n
    • (42) Cycle time lower limit (PULSE) (itv 17,67,65)\n
    • (43) Average centrepost temperature\n (TART) (consistency equation) (itv 13,20,69,70)\n
    • (44) Peak centrepost temperature upper limit (TART) (itv 68,69,70)\n
    • (45) Edge safety factor lower limit (TART) (itv 71,1,2,3)\n
    • (46) Equation for Ip/Irod upper limit (TART) (itv 72,2,60)\n
    • (47) NOT USED\n
    • (48) Poloidal beta upper limit (itv 79,2,3,18)\n
    • (49) NOT USED\n
    • (50) IFE repetition rate upper limit (IFE)\n
    • (51) Startup volt-seconds consistency (PULSE) (itv 16,29,3,1)\n
    • (52) Tritium breeding ratio lower limit (itv 89,90,91)\n
    • (53) Neutron fluence on TF coil upper limit (itv 92,93,94)\n
    • (54) Peak TF coil nuclear heating upper limit (itv 95,93,94)\n
    • (55) Vacuum vessel helium concentration upper limit iblanket =2 (itv 96,93,94)\n
    • (56) Pseparatrix/Rmajor upper limit (itv 97,1,3)\n
    • (57) NOT USED\n
    • (58) NOT USED\n
    • (59) Neutral beam shine-through fraction upper limit (NBI) (itv 105,6,19,4 )\n
    • (60) Central solenoid temperature margin lower limit (SCTF) (itv 106)\n
    • (61) Minimum availability value (itv 107)\n
    • (62) taup/taueff the ratio of particle to energy confinement times (itv 110)\n
    • (63) The number of ITER-like vacuum pumps niterpump < tfno (itv 111)\n
    • (64) Zeff less than or equal to zeffmax (itv 112)\n
    • (65) Dump time set by VV loads (itv 56, 113)\n
    • (66) Limit on rate of change of energy in poloidal field\n (Use iteration variable 65(t_current_ramp_up), 115)\n
    • (67) Simple Radiation Wall load limit (itv 116, 4,6)\n
    • (68) Psep * Bt / qAR upper limit (itv 117)\n
    • (69) ensure separatrix power = the value from Kallenbach divertor (itv 118)\n
    • (70) ensure that teomp = separatrix temperature in the pedestal profile,\n (itv 119 (tesep))\n
    • (71) ensure that neomp = separatrix density (nesep) x neratio\n
    • (72) central solenoid shear stress limit (Tresca yield criterion) (itv 123 foh_stress)\n
    • (73) Psep >= Plh + Paux (itv 137 (fplhsep))\n
    • (74) TFC quench < tmax_croco (itv 141 (fcqt))\n
    • (75) TFC current/copper area < Maximum (itv 143 f_coppera_m2)\n
    • (76) Eich critical separatrix density\n
    • (77) TF coil current per turn upper limit\n
    • (78) Reinke criterion impurity fraction lower limit (itv 147 freinke)\n
    • (79) Peak CS field upper limit (itv 149 fbmaxcs)\n
    • (80) Divertor power lower limit pdivt (itv 153 fpdivlim)\n
    • (81) Ne(0) > ne(ped) constraint (itv 154 fne0)\n
    • (82) toroidalgap > tftort constraint (itv 171 ftoroidalgap)\n
    • (83) Radial build consistency for stellarators (itv 172 f_avspace)\n
    • (84) Lower limit for beta (itv 173 fbeta_min)\n
    • (85) Constraint for CP lifetime\n
    • (86) Constraint for TF coil turn dimension\n
    • (87) Constraint for cryogenic power\n
    • (88) Constraint for TF coil strain absolute value\n
    • (89) Constraint for CS coil quench protection\n
    • (90) Checking if the design point is ECRH ignitable (itv 164 fecrh_ignition)
    \n\n\n\n", "lablmm": "lablmm(ipnfoms) : labels describing figures of merit:
      \n
      \n
    • ( 1) major radius\n
    • ( 2) not used\n
    • ( 3) neutron wall load\n
    • ( 4) P_tf + P_pf\n
    • ( 5) fusion gain Q\n
    • ( 6) cost of electricity\n
    • ( 7) capital cost (direct cost if ireactor=0,\n constructed cost otherwise)\n
    • ( 8) aspect ratio\n
    • ( 9) divertor heat load\n
    • (10) toroidal field\n
    • (11) total injected power\n
    • (12) hydrogen plant capital cost OBSOLETE\n
    • (13) hydrogen production rate OBSOLETE\n
    • (14) pulse length\n
    • (15) plant availability factor (N.B. requires\n iavail=1 to be set)\n
    • (16) linear combination of major radius (minimised) and pulse length (maximised)\n note: FoM should be minimised only!\n
    • (17) net electrical output\n
    • (18) Null Figure of Merit\n
    • (19) linear combination of big Q and pulse length (maximised)\n note: FoM should be minimised only!
    \n\n\n", - "lablxc": "lablxc(ipnvars) : labels describing iteration variables
      \n
      \n
    • ( 1) aspect\n
    • ( 2) bt\n
    • ( 3) rmajor\n
    • ( 4) te\n
    • ( 5) beta\n
    • ( 6) dene\n
    • ( 7) rnbeam\n
    • ( 8) fbeta_poloidal_eps (f-value for equation 6)\n
    • ( 9) fdene (f-value for equation 5)\n
    • (10) hfact\n
    • (11) pheat\n
    • (12) oacdcp\n
    • (13) tfcth (NOT RECOMMENDED)\n
    • (14) fwalld (f-value for equation 8)\n
    • (15) fvs (f-value for equation 12)\n
    • (16) ohcth\n
    • (17) tdwell\n
    • (18) q\n
    • (19) beam_energy\n
    • (20) tcpav\n
    • (21) ftburn (f-value for equation 13)\n
    • (22) NOT USED\n
    • (23) fcoolcp\n
    • (24) NOT USED\n
    • (25) fpnetel (f-value for equation 16)\n
    • (26) ffuspow (f-value for equation 9)\n
    • (27) fhldiv (f-value for equation 18)\n
    • (28) fradpwr (f-value for equation 17), total radiation fraction\n
    • (29) bore\n
    • (30) fmva (f-value for equation 19)\n
    • (31) gapomin\n
    • (32) frminor (f-value for equation 21)\n
    • (33) fportsz (f-value for equation 20)\n
    • (34) fdivcol (f-value for equation 22)\n
    • (35) fpeakb (f-value for equation 25)\n
    • (36) fbeta_max (f-value for equation 24)\n
    • (37) coheof\n
    • (38) fjohc (f-value for equation 26)\n
    • (39) fjohc0 (f-value for equation 27)\n
    • (40) fgamcd (f-value for equation 37)\n
    • (41) fcohbop\n
    • (42) gapoh\n
    • (43) NOT USED\n
    • (44) fvsbrnni\n
    • (45) fqval (f-value for equation 28)\n
    • (46) fpinj (f-value for equation 30)\n
    • (47) feffcd\n
    • (48) fstrcase (f-value for equation 31)\n
    • (49) fstrcond (f-value for equation 32)\n
    • (50) fiooic (f-value for equation 33)\n
    • (51) fvdump (f-value for equation 34)\n
    • (52) vdalw\n
    • (53) fjprot (f-value for equation 35)\n
    • (54) ftmargtf (f-value for equation 36)\n
    • (55) NOT USED\n
    • (56) tdmptf\n
    • (57) thkcas\n
    • (58) thwcndut\n
    • (59) fcutfsu\n
    • (60) cpttf\n
    • (61) gapds\n
    • (62) fdtmp (f-value for equation 38)\n
    • (63) ftpeak (f-value for equation 39)\n
    • (64) fauxmn (f-value for equation 40)\n
    • (65) tohs\n
    • (66) ftohs (f-value for equation 41)\n
    • (67) ftcycl (f-value for equation 42)\n
    • (68) fptemp (f-value for equation 44)\n
    • (69) rcool\n
    • (70) vcool\n
    • (71) fq (f-value for equation 45)\n
    • (72) fipir (f-value for equation 46)\n
    • (73) scrapli\n
    • (74) scraplo\n
    • (75) tfootfi\n
    • (76) NOT USED\n
    • (77) NOT USED\n
    • (78) NOT USED\n
    • (79) fbeta_poloidal (f-value for equation 48)\n
    • (80) NOT USED\n
    • (81) edrive\n
    • (82) drveff\n
    • (83) tgain\n
    • (84) chrad\n
    • (85) pdrive\n
    • (86) frrmax (f-value for equation 50)\n
    • (87) NOT USED\n
    • (88) NOT USED\n
    • (89) ftbr (f-value for equation 52)\n
    • (90) blbuith\n
    • (91) blbuoth\n
    • (92) fflutf (f-value for equation 53)\n
    • (93) shldith\n
    • (94) shldoth\n
    • (95) fptfnuc (f-value for equation 54)\n
    • (96) fvvhe (f-value for equation 55)\n
    • (97) fpsepr (f-value for equation 56)\n
    • (98) li6enrich\n
    • (99) NOT USED\n
    • (100) NOT USED\n
    • (101) NOT USED\n
    • (102) fimpvar\n
    • (103) flhthresh (f-value for equation 15)\n
    • (104) fcwr (f-value for equation 23)\n
    • (105) fnbshinef (f-value for equation 59)\n
    • (106) ftmargoh (f-value for equation 60)\n
    • (107) favail (f-value for equation 61)\n
    • (108) breeder_f: Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4)\n
    • (109) ralpne: thermal alpha density / electron density\n
    • (110) ftaulimit: Lower limit on taup/taueff the ratio of alpha\n
    • (111) fniterpump: f-value for constraint that number\n
    • (112) fzeffmax: f-value for max Zeff (f-value for equation 64)\n
    • (113) ftaucq: f-value for minimum quench time (f-value for equation 65)\n
    • (114) fw_channel_length: Length of a single first wall channel\n
    • (115) fpoloidalpower: f-value for max rate of change of\n
    • (116) fradwall: f-value for radiation wall load limit (eq. 67)\n
    • (117) fpsepbqar: f-value for Psep*Bt/qar upper limit (eq. 68)\n
    • (118) fpsep: f-value to ensure separatrix power is less than\n
    • (119) tesep: separatrix temperature calculated by the Kallenbach divertor model\n
    • (120) ttarget: Plasma temperature adjacent to divertor sheath [eV]\n
    • (121) neratio: ratio of mean SOL density at OMP to separatrix density at OMP\n
    • (122) oh_steel_frac : streel fraction of Central Solenoid\n
    • (123) foh_stress : f-value for CS coil Tresca yield criterion (f-value for eq. 72)\n
    • (124) qtargettotal : Power density on target including surface recombination [W/m2]\n
    • (125) fimp(3) : Beryllium density fraction relative to electron density\n
    • (126) fimp(4) : Carbon density fraction relative to electron density\n
    • (127) fimp(5) : Nitrogen fraction relative to electron density\n
    • (128) fimp(6) : Oxygen density fraction relative to electron density\n
    • (129) fimp(7) : Neon density fraction relative to electron density\n
    • (130) fimp(8) : Silicon density fraction relative to electron density\n
    • (131) fimp(9) : Argon density fraction relative to electron density\n
    • (132) fimp(10) : Iron density fraction relative to electron density\n
    • (133) fimp(11) : Nickel density fraction relative to electron density\n
    • (134) fimp(12) : Krypton density fraction relative to electron density\n
    • (135) fimp(13) : Xenon density fraction relative to electron density\n
    • (136) fimp(14) : Tungsten density fraction relative to electron density\n
    • (137) fplhsep (f-value for equation 73)\n
    • (138) rebco_thickness : thickness of REBCO layer in tape (m)\n
    • (139) copper_thick : thickness of copper layer in tape (m)\n
    • (140) dr_tf_wp : radial thickness of TFC winding pack (m)\n
    • (141) fcqt : TF coil quench temperature < tmax_croco (f-value for equation 74)\n
    • (142) nesep : electron density at separatrix [m-3]\n
    • (143) f_copperA_m2 : TF coil current / copper area < Maximum value\n
    • (144) fnesep : Eich critical electron density at separatrix\n
    • (145) fgwped : fraction of Greenwald density to set as pedestal-top density\n
    • (146) fcpttf : F-value for TF coil current per turn limit (constraint equation 77)\n
    • (147) freinke : F-value for Reinke detachment criterion (constraint equation 78)\n
    • (148) fzactual : fraction of impurity at SOL with Reinke detachment criterion\n
    • (149) fbmaxcs : F-value for max peak CS field (con. 79, itvar 149)\n
    • (152) fbmaxcs : Ratio of separatrix density to Greenwald density\n
    • (153) fpdivlim : F-value for minimum pdivt (con. 80)\n
    • (154) fne0 : F-value for ne(0) > ne(ped) (con. 81)\n
    • (155) pfusife : IFE input fusion power (MW) (ifedrv=3 only)\n
    • (156) rrin : Input IFE repetition rate (Hz) (ifedrv=3 only)\n
    • (157) fvssu : F-value for available to required start up flux (con. 51)\n
    • (158) croco_thick : Thickness of CroCo copper tube (m)\n
    • (159) ftoroidalgap : F-value for toroidalgap > tftort constraint (con. 82)\n
    • (160) f_avspace (f-value for equation 83)\n
    • (161) fbeta_min (f-value for equation 84)\n
    • (162) r_cp_top : Top outer radius of the centropost (ST only) (m)\n
    • (163) f_t_turn_tf : f-value for TF coils WP trurn squared dimension constraint\n
    • (164) f_crypmw : f-value for cryogenic plant power\n
    • (165) fstr_wp : f-value for TF coil strain absolute value\n
    • (166) f_copperaoh_m2 : CS coil current /copper area < Maximum value\n
    • (167) fecrh_ignition: f-value for equation 90\n
    • (168) EMPTY : Description\n
    • (169) EMPTY : Description\n
    • (170) EMPTY : Description\n
    • (171) EMPTY : Description\n
    • (172) EMPTY : Description\n
    • (173) EMPTY : Description\n
    • (174) EMPTY : Description\n
    • (175) EMPTY : Description\n\n\n\n", - "lablxc": "lablxc(ipnvars) : labels describing iteration variables
        \n
        \n
      • ( 1) aspect\n
      • ( 2) bt\n
      • ( 3) rmajor\n
      • ( 4) te\n
      • ( 5) beta\n
      • ( 6) dene\n
      • ( 7) rnbeam\n
      • ( 8) fbeta_poloidal_eps (f-value for equation 6)\n
      • ( 9) fdene (f-value for equation 5)\n
      • (10) hfact\n
      • (11) pheat\n
      • (12) oacdcp\n
      • (13) tfcth (NOT RECOMMENDED)\n
      • (14) fwalld (f-value for equation 8)\n
      • (15) fvs (f-value for equation 12)\n
      • (16) ohcth\n
      • (17) t_between_pulse\n
      • (18) q\n
      • (19) beam_energy\n
      • (20) tcpav\n
      • (21) ft_burn (f-value for equation 13)\n
      • (22) NOT USED\n
      • (23) fcoolcp\n
      • (24) NOT USED\n
      • (25) fpnetel (f-value for equation 16)\n
      • (26) ffuspow (f-value for equation 9)\n
      • (27) fhldiv (f-value for equation 18)\n
      • (28) fradpwr (f-value for equation 17), total radiation fraction\n
      • (29) bore\n
      • (30) fmva (f-value for equation 19)\n
      • (31) gapomin\n
      • (32) frminor (f-value for equation 21)\n
      • (33) fportsz (f-value for equation 20)\n
      • (34) fdivcol (f-value for equation 22)\n
      • (35) fpeakb (f-value for equation 25)\n
      • (36) fbeta_max (f-value for equation 24)\n
      • (37) coheof\n
      • (38) fjohc (f-value for equation 26)\n
      • (39) fjohc0 (f-value for equation 27)\n
      • (40) fgamcd (f-value for equation 37)\n
      • (41) fcohbop\n
      • (42) gapoh\n
      • (43) NOT USED\n
      • (44) fvsbrnni\n
      • (45) fqval (f-value for equation 28)\n
      • (46) fpinj (f-value for equation 30)\n
      • (47) feffcd\n
      • (48) fstrcase (f-value for equation 31)\n
      • (49) fstrcond (f-value for equation 32)\n
      • (50) fiooic (f-value for equation 33)\n
      • (51) fvdump (f-value for equation 34)\n
      • (52) vdalw\n
      • (53) fjprot (f-value for equation 35)\n
      • (54) ftmargtf (f-value for equation 36)\n
      • (55) NOT USED\n
      • (56) tdmptf\n
      • (57) thkcas\n
      • (58) thwcndut\n
      • (59) fcutfsu\n
      • (60) cpttf\n
      • (61) gapds\n
      • (62) fdtmp (f-value for equation 38)\n
      • (63) ftpeak (f-value for equation 39)\n
      • (64) fauxmn (f-value for equation 40)\n
      • (65) t_current_ramp_up\n
      • (66) ft_current_ramp_up (f-value for equation 41)\n
      • (67) ftcycl (f-value for equation 42)\n
      • (68) fptemp (f-value for equation 44)\n
      • (69) rcool\n
      • (70) vcool\n
      • (71) fq (f-value for equation 45)\n
      • (72) fipir (f-value for equation 46)\n
      • (73) scrapli\n
      • (74) scraplo\n
      • (75) tfootfi\n
      • (76) NOT USED\n
      • (77) NOT USED\n
      • (78) NOT USED\n
      • (79) fbetap (f-value for equation 48)\n
      • (80) NOT USED\n
      • (81) edrive\n
      • (82) drveff\n
      • (83) tgain\n
      • (84) chrad\n
      • (85) pdrive\n
      • (86) frrmax (f-value for equation 50)\n
      • (87) NOT USED\n
      • (88) NOT USED\n
      • (89) ftbr (f-value for equation 52)\n
      • (90) blbuith\n
      • (91) blbuoth\n
      • (92) fflutf (f-value for equation 53)\n
      • (93) shldith\n
      • (94) shldoth\n
      • (95) fptfnuc (f-value for equation 54)\n
      • (96) fvvhe (f-value for equation 55)\n
      • (97) fpsepr (f-value for equation 56)\n
      • (98) li6enrich\n
      • (99) NOT USED\n
      • (100) NOT USED\n
      • (101) NOT USED\n
      • (102) fimpvar\n
      • (103) flhthresh (f-value for equation 15)\n
      • (104) fcwr (f-value for equation 23)\n
      • (105) fnbshinef (f-value for equation 59)\n
      • (106) ftmargoh (f-value for equation 60)\n
      • (107) favail (f-value for equation 61)\n
      • (108) breeder_f: Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4)\n
      • (109) ralpne: thermal alpha density / electron density\n
      • (110) ftaulimit: Lower limit on taup/taueff the ratio of alpha\n
      • (111) fniterpump: f-value for constraint that number\n
      • (112) fzeffmax: f-value for max Zeff (f-value for equation 64)\n
      • (113) ftaucq: f-value for minimum quench time (f-value for equation 65)\n
      • (114) fw_channel_length: Length of a single first wall channel\n
      • (115) fpoloidalpower: f-value for max rate of change of\n
      • (116) fradwall: f-value for radiation wall load limit (eq. 67)\n
      • (117) fpsepbqar: f-value for Psep*Bt/qar upper limit (eq. 68)\n
      • (118) fpsep: f-value to ensure separatrix power is less than\n
      • (119) tesep: separatrix temperature calculated by the Kallenbach divertor model\n
      • (120) ttarget: Plasma temperature adjacent to divertor sheath [eV]\n
      • (121) neratio: ratio of mean SOL density at OMP to separatrix density at OMP\n
      • (122) oh_steel_frac : streel fraction of Central Solenoid\n
      • (123) foh_stress : f-value for CS coil Tresca yield criterion (f-value for eq. 72)\n
      • (124) qtargettotal : Power density on target including surface recombination [W/m2]\n
      • (125) fimp(3) : Beryllium density fraction relative to electron density\n
      • (126) fimp(4) : Carbon density fraction relative to electron density\n
      • (127) fimp(5) : Nitrogen fraction relative to electron density\n
      • (128) fimp(6) : Oxygen density fraction relative to electron density\n
      • (129) fimp(7) : Neon density fraction relative to electron density\n
      • (130) fimp(8) : Silicon density fraction relative to electron density\n
      • (131) fimp(9) : Argon density fraction relative to electron density\n
      • (132) fimp(10) : Iron density fraction relative to electron density\n
      • (133) fimp(11) : Nickel density fraction relative to electron density\n
      • (134) fimp(12) : Krypton density fraction relative to electron density\n
      • (135) fimp(13) : Xenon density fraction relative to electron density\n
      • (136) fimp(14) : Tungsten density fraction relative to electron density\n
      • (137) fplhsep (f-value for equation 73)\n
      • (138) rebco_thickness : thickness of REBCO layer in tape (m)\n
      • (139) copper_thick : thickness of copper layer in tape (m)\n
      • (140) dr_tf_wp : radial thickness of TFC winding pack (m)\n
      • (141) fcqt : TF coil quench temperature < tmax_croco (f-value for equation 74)\n
      • (142) nesep : electron density at separatrix [m-3]\n
      • (143) f_copperA_m2 : TF coil current / copper area < Maximum value\n
      • (144) fnesep : Eich critical electron density at separatrix\n
      • (145) fgwped : fraction of Greenwald density to set as pedestal-top density\n
      • (146) fcpttf : F-value for TF coil current per turn limit (constraint equation 77)\n
      • (147) freinke : F-value for Reinke detachment criterion (constraint equation 78)\n
      • (148) fzactual : fraction of impurity at SOL with Reinke detachment criterion\n
      • (149) fbmaxcs : F-value for max peak CS field (con. 79, itvar 149)\n
      • (152) fbmaxcs : Ratio of separatrix density to Greenwald density\n
      • (153) fpdivlim : F-value for minimum pdivt (con. 80)\n
      • (154) fne0 : F-value for ne(0) > ne(ped) (con. 81)\n
      • (155) pfusife : IFE input fusion power (MW) (ifedrv=3 only)\n
      • (156) rrin : Input IFE repetition rate (Hz) (ifedrv=3 only)\n
      • (157) fvssu : F-value for available to required start up flux (con. 51)\n
      • (158) croco_thick : Thickness of CroCo copper tube (m)\n
      • (159) ftoroidalgap : F-value for toroidalgap > tftort constraint (con. 82)\n
      • (160) f_avspace (f-value for equation 83)\n
      • (161) fbeta_min (f-value for equation 84)\n
      • (162) r_cp_top : Top outer radius of the centropost (ST only) (m)\n
      • (163) f_t_turn_tf : f-value for TF coils WP trurn squared dimension constraint\n
      • (164) f_crypmw : f-value for cryogenic plant power\n
      • (165) fstr_wp : f-value for TF coil strain absolute value\n
      • (166) f_copperaoh_m2 : CS coil current /copper area < Maximum value\n
      • (167) fecrh_ignition: f-value for equation 90\n
      • (168) EMPTY : Description\n
      • (169) EMPTY : Description\n
      • (170) EMPTY : Description\n
      • (171) EMPTY : Description\n
      • (172) EMPTY : Description\n
      • (173) EMPTY : Description\n
      • (174) EMPTY : Description\n
      • (175) EMPTY : Description\n\n\n\n", + "lablxc": "lablxc(ipnvars) : labels describing iteration variables
          \n
          \n
        • ( 1) aspect\n
        • ( 2) bt\n
        • ( 3) rmajor\n
        • ( 4) te\n
        • ( 5) beta\n
        • ( 6) dene\n
        • ( 7) rnbeam\n
        • ( 8) fbeta_poloidal_eps (f-value for equation 6)\n
        • ( 9) fdene (f-value for equation 5)\n
        • (10) hfact\n
        • (11) pheat\n
        • (12) oacdcp\n
        • (13) tfcth (NOT RECOMMENDED)\n
        • (14) fwalld (f-value for equation 8)\n
        • (15) fvs (f-value for equation 12)\n
        • (16) ohcth\n
        • (17) tdwell\n
        • (18) q\n
        • (19) beam_energy\n
        • (20) tcpav\n
        • (21) ftburn (f-value for equation 13)\n
        • (22) NOT USED\n
        • (23) fcoolcp\n
        • (24) NOT USED\n
        • (25) fpnetel (f-value for equation 16)\n
        • (26) ffuspow (f-value for equation 9)\n
        • (27) fhldiv (f-value for equation 18)\n
        • (28) fradpwr (f-value for equation 17), total radiation fraction\n
        • (29) bore\n
        • (30) fmva (f-value for equation 19)\n
        • (31) gapomin\n
        • (32) frminor (f-value for equation 21)\n
        • (33) fportsz (f-value for equation 20)\n
        • (34) fdivcol (f-value for equation 22)\n
        • (35) fpeakb (f-value for equation 25)\n
        • (36) fbeta_max (f-value for equation 24)\n
        • (37) coheof\n
        • (38) fjohc (f-value for equation 26)\n
        • (39) fjohc0 (f-value for equation 27)\n
        • (40) fgamcd (f-value for equation 37)\n
        • (41) fcohbop\n
        • (42) gapoh\n
        • (43) NOT USED\n
        • (44) fvsbrnni\n
        • (45) fqval (f-value for equation 28)\n
        • (46) fpinj (f-value for equation 30)\n
        • (47) feffcd\n
        • (48) fstrcase (f-value for equation 31)\n
        • (49) fstrcond (f-value for equation 32)\n
        • (50) fiooic (f-value for equation 33)\n
        • (51) fvdump (f-value for equation 34)\n
        • (52) vdalw\n
        • (53) fjprot (f-value for equation 35)\n
        • (54) ftmargtf (f-value for equation 36)\n
        • (55) NOT USED\n
        • (56) tdmptf\n
        • (57) thkcas\n
        • (58) thwcndut\n
        • (59) fcutfsu\n
        • (60) cpttf\n
        • (61) gapds\n
        • (62) fdtmp (f-value for equation 38)\n
        • (63) ftpeak (f-value for equation 39)\n
        • (64) fauxmn (f-value for equation 40)\n
        • (65) tohs\n
        • (66) ftohs (f-value for equation 41)\n
        • (67) ftcycl (f-value for equation 42)\n
        • (68) fptemp (f-value for equation 44)\n
        • (69) rcool\n
        • (70) vcool\n
        • (71) fq (f-value for equation 45)\n
        • (72) fipir (f-value for equation 46)\n
        • (73) scrapli\n
        • (74) scraplo\n
        • (75) tfootfi\n
        • (76) NOT USED\n
        • (77) NOT USED\n
        • (78) NOT USED\n
        • (79) fbeta_poloidal (f-value for equation 48)\n
        • (80) NOT USED\n
        • (81) edrive\n
        • (82) drveff\n
        • (83) tgain\n
        • (84) chrad\n
        • (85) pdrive\n
        • (86) frrmax (f-value for equation 50)\n
        • (87) NOT USED\n
        • (88) NOT USED\n
        • (89) ftbr (f-value for equation 52)\n
        • (90) blbuith\n
        • (91) blbuoth\n
        • (92) fflutf (f-value for equation 53)\n
        • (93) shldith\n
        • (94) shldoth\n
        • (95) fptfnuc (f-value for equation 54)\n
        • (96) fvvhe (f-value for equation 55)\n
        • (97) fpsepr (f-value for equation 56)\n
        • (98) li6enrich\n
        • (99) NOT USED\n
        • (100) NOT USED\n
        • (101) NOT USED\n
        • (102) fimpvar\n
        • (103) flhthresh (f-value for equation 15)\n
        • (104)fr_conducting_wall (f-value for equation 23)\n
        • (105) fnbshinef (f-value for equation 59)\n
        • (106) ftmargoh (f-value for equation 60)\n
        • (107) favail (f-value for equation 61)\n
        • (108) breeder_f: Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4)\n
        • (109) ralpne: thermal alpha density / electron density\n
        • (110) ftaulimit: Lower limit on taup/taueff the ratio of alpha\n
        • (111) fniterpump: f-value for constraint that number\n
        • (112) fzeffmax: f-value for max Zeff (f-value for equation 64)\n
        • (113) ftaucq: f-value for minimum quench time (f-value for equation 65)\n
        • (114) fw_channel_length: Length of a single first wall channel\n
        • (115) fpoloidalpower: f-value for max rate of change of\n
        • (116) fradwall: f-value for radiation wall load limit (eq. 67)\n
        • (117) fpsepbqar: f-value for Psep*Bt/qar upper limit (eq. 68)\n
        • (118) fpsep: f-value to ensure separatrix power is less than\n
        • (119) tesep: separatrix temperature calculated by the Kallenbach divertor model\n
        • (120) ttarget: Plasma temperature adjacent to divertor sheath [eV]\n
        • (121) neratio: ratio of mean SOL density at OMP to separatrix density at OMP\n
        • (122) oh_steel_frac : streel fraction of Central Solenoid\n
        • (123) foh_stress : f-value for CS coil Tresca yield criterion (f-value for eq. 72)\n
        • (124) qtargettotal : Power density on target including surface recombination [W/m2]\n
        • (125) fimp(3) : Beryllium density fraction relative to electron density\n
        • (126) fimp(4) : Carbon density fraction relative to electron density\n
        • (127) fimp(5) : Nitrogen fraction relative to electron density\n
        • (128) fimp(6) : Oxygen density fraction relative to electron density\n
        • (129) fimp(7) : Neon density fraction relative to electron density\n
        • (130) fimp(8) : Silicon density fraction relative to electron density\n
        • (131) fimp(9) : Argon density fraction relative to electron density\n
        • (132) fimp(10) : Iron density fraction relative to electron density\n
        • (133) fimp(11) : Nickel density fraction relative to electron density\n
        • (134) fimp(12) : Krypton density fraction relative to electron density\n
        • (135) fimp(13) : Xenon density fraction relative to electron density\n
        • (136) fimp(14) : Tungsten density fraction relative to electron density\n
        • (137) fplhsep (f-value for equation 73)\n
        • (138) rebco_thickness : thickness of REBCO layer in tape (m)\n
        • (139) copper_thick : thickness of copper layer in tape (m)\n
        • (140) dr_tf_wp : radial thickness of TFC winding pack (m)\n
        • (141) fcqt : TF coil quench temperature < tmax_croco (f-value for equation 74)\n
        • (142) nesep : electron density at separatrix [m-3]\n
        • (143) f_copperA_m2 : TF coil current / copper area < Maximum value\n
        • (144) fnesep : Eich critical electron density at separatrix\n
        • (145) fgwped : fraction of Greenwald density to set as pedestal-top density\n
        • (146) fcpttf : F-value for TF coil current per turn limit (constraint equation 77)\n
        • (147) freinke : F-value for Reinke detachment criterion (constraint equation 78)\n
        • (148) fzactual : fraction of impurity at SOL with Reinke detachment criterion\n
        • (149) fbmaxcs : F-value for max peak CS field (con. 79, itvar 149)\n
        • (152) fbmaxcs : Ratio of separatrix density to Greenwald density\n
        • (153) fpdivlim : F-value for minimum pdivt (con. 80)\n
        • (154) fne0 : F-value for ne(0) > ne(ped) (con. 81)\n
        • (155) pfusife : IFE input fusion power (MW) (ifedrv=3 only)\n
        • (156) rrin : Input IFE repetition rate (Hz) (ifedrv=3 only)\n
        • (157) fvssu : F-value for available to required start up flux (con. 51)\n
        • (158) croco_thick : Thickness of CroCo copper tube (m)\n
        • (159) ftoroidalgap : F-value for toroidalgap > tftort constraint (con. 82)\n
        • (160) f_avspace (f-value for equation 83)\n
        • (161) fbeta_min (f-value for equation 84)\n
        • (162) r_cp_top : Top outer radius of the centropost (ST only) (m)\n
        • (163) f_t_turn_tf : f-value for TF coils WP trurn squared dimension constraint\n
        • (164) f_crypmw : f-value for cryogenic plant power\n
        • (165) fstr_wp : f-value for TF coil strain absolute value\n
        • (166) f_copperaoh_m2 : CS coil current /copper area < Maximum value\n
        • (167) fecrh_ignition: f-value for equation 90\n
        • (168) EMPTY : Description\n
        • (169) EMPTY : Description\n
        • (170) EMPTY : Description\n
        • (171) EMPTY : Description\n
        • (172) EMPTY : Description\n
        • (173) EMPTY : Description\n
        • (174) EMPTY : Description\n
        • (175) EMPTY : Description\n\n\n\n", + "lablxc": "lablxc(ipnvars) : labels describing iteration variables
            \n
            \n
          • ( 1) aspect\n
          • ( 2) bt\n
          • ( 3) rmajor\n
          • ( 4) te\n
          • ( 5) beta\n
          • ( 6) dene\n
          • ( 7) rnbeam\n
          • ( 8) fbeta_poloidal_eps (f-value for equation 6)\n
          • ( 9) fdene (f-value for equation 5)\n
          • (10) hfact\n
          • (11) pheat\n
          • (12) oacdcp\n
          • (13) tfcth (NOT RECOMMENDED)\n
          • (14) fwalld (f-value for equation 8)\n
          • (15) fvs (f-value for equation 12)\n
          • (16) ohcth\n
          • (17) t_between_pulse\n
          • (18) q\n
          • (19) beam_energy\n
          • (20) tcpav\n
          • (21) ft_burn (f-value for equation 13)\n
          • (22) NOT USED\n
          • (23) fcoolcp\n
          • (24) NOT USED\n
          • (25) fpnetel (f-value for equation 16)\n
          • (26) ffuspow (f-value for equation 9)\n
          • (27) fhldiv (f-value for equation 18)\n
          • (28) fradpwr (f-value for equation 17), total radiation fraction\n
          • (29) bore\n
          • (30) fmva (f-value for equation 19)\n
          • (31) gapomin\n
          • (32) frminor (f-value for equation 21)\n
          • (33) fportsz (f-value for equation 20)\n
          • (34) fdivcol (f-value for equation 22)\n
          • (35) fpeakb (f-value for equation 25)\n
          • (36) fbeta_max (f-value for equation 24)\n
          • (37) coheof\n
          • (38) fjohc (f-value for equation 26)\n
          • (39) fjohc0 (f-value for equation 27)\n
          • (40) fgamcd (f-value for equation 37)\n
          • (41) fcohbop\n
          • (42) gapoh\n
          • (43) NOT USED\n
          • (44) fvsbrnni\n
          • (45) fqval (f-value for equation 28)\n
          • (46) fpinj (f-value for equation 30)\n
          • (47) feffcd\n
          • (48) fstrcase (f-value for equation 31)\n
          • (49) fstrcond (f-value for equation 32)\n
          • (50) fiooic (f-value for equation 33)\n
          • (51) fvdump (f-value for equation 34)\n
          • (52) vdalw\n
          • (53) fjprot (f-value for equation 35)\n
          • (54) ftmargtf (f-value for equation 36)\n
          • (55) NOT USED\n
          • (56) tdmptf\n
          • (57) thkcas\n
          • (58) thwcndut\n
          • (59) fcutfsu\n
          • (60) cpttf\n
          • (61) gapds\n
          • (62) fdtmp (f-value for equation 38)\n
          • (63) ftpeak (f-value for equation 39)\n
          • (64) fauxmn (f-value for equation 40)\n
          • (65) t_current_ramp_up\n
          • (66) ft_current_ramp_up (f-value for equation 41)\n
          • (67) ftcycl (f-value for equation 42)\n
          • (68) fptemp (f-value for equation 44)\n
          • (69) rcool\n
          • (70) vcool\n
          • (71) fq (f-value for equation 45)\n
          • (72) fipir (f-value for equation 46)\n
          • (73) scrapli\n
          • (74) scraplo\n
          • (75) tfootfi\n
          • (76) NOT USED\n
          • (77) NOT USED\n
          • (78) NOT USED\n
          • (79) fbetap (f-value for equation 48)\n
          • (80) NOT USED\n
          • (81) edrive\n
          • (82) drveff\n
          • (83) tgain\n
          • (84) chrad\n
          • (85) pdrive\n
          • (86) frrmax (f-value for equation 50)\n
          • (87) NOT USED\n
          • (88) NOT USED\n
          • (89) ftbr (f-value for equation 52)\n
          • (90) blbuith\n
          • (91) blbuoth\n
          • (92) fflutf (f-value for equation 53)\n
          • (93) shldith\n
          • (94) shldoth\n
          • (95) fptfnuc (f-value for equation 54)\n
          • (96) fvvhe (f-value for equation 55)\n
          • (97) fpsepr (f-value for equation 56)\n
          • (98) li6enrich\n
          • (99) NOT USED\n
          • (100) NOT USED\n
          • (101) NOT USED\n
          • (102) fimpvar\n
          • (103) flhthresh (f-value for equation 15)\n
          • (104)fr_conducting_wall (f-value for equation 23)\n
          • (105) fnbshinef (f-value for equation 59)\n
          • (106) ftmargoh (f-value for equation 60)\n
          • (107) favail (f-value for equation 61)\n
          • (108) breeder_f: Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4)\n
          • (109) ralpne: thermal alpha density / electron density\n
          • (110) ftaulimit: Lower limit on taup/taueff the ratio of alpha\n
          • (111) fniterpump: f-value for constraint that number\n
          • (112) fzeffmax: f-value for max Zeff (f-value for equation 64)\n
          • (113) ftaucq: f-value for minimum quench time (f-value for equation 65)\n
          • (114) fw_channel_length: Length of a single first wall channel\n
          • (115) fpoloidalpower: f-value for max rate of change of\n
          • (116) fradwall: f-value for radiation wall load limit (eq. 67)\n
          • (117) fpsepbqar: f-value for Psep*Bt/qar upper limit (eq. 68)\n
          • (118) fpsep: f-value to ensure separatrix power is less than\n
          • (119) tesep: separatrix temperature calculated by the Kallenbach divertor model\n
          • (120) ttarget: Plasma temperature adjacent to divertor sheath [eV]\n
          • (121) neratio: ratio of mean SOL density at OMP to separatrix density at OMP\n
          • (122) oh_steel_frac : streel fraction of Central Solenoid\n
          • (123) foh_stress : f-value for CS coil Tresca yield criterion (f-value for eq. 72)\n
          • (124) qtargettotal : Power density on target including surface recombination [W/m2]\n
          • (125) fimp(3) : Beryllium density fraction relative to electron density\n
          • (126) fimp(4) : Carbon density fraction relative to electron density\n
          • (127) fimp(5) : Nitrogen fraction relative to electron density\n
          • (128) fimp(6) : Oxygen density fraction relative to electron density\n
          • (129) fimp(7) : Neon density fraction relative to electron density\n
          • (130) fimp(8) : Silicon density fraction relative to electron density\n
          • (131) fimp(9) : Argon density fraction relative to electron density\n
          • (132) fimp(10) : Iron density fraction relative to electron density\n
          • (133) fimp(11) : Nickel density fraction relative to electron density\n
          • (134) fimp(12) : Krypton density fraction relative to electron density\n
          • (135) fimp(13) : Xenon density fraction relative to electron density\n
          • (136) fimp(14) : Tungsten density fraction relative to electron density\n
          • (137) fplhsep (f-value for equation 73)\n
          • (138) rebco_thickness : thickness of REBCO layer in tape (m)\n
          • (139) copper_thick : thickness of copper layer in tape (m)\n
          • (140) dr_tf_wp : radial thickness of TFC winding pack (m)\n
          • (141) fcqt : TF coil quench temperature < tmax_croco (f-value for equation 74)\n
          • (142) nesep : electron density at separatrix [m-3]\n
          • (143) f_copperA_m2 : TF coil current / copper area < Maximum value\n
          • (144) fnesep : Eich critical electron density at separatrix\n
          • (145) fgwped : fraction of Greenwald density to set as pedestal-top density\n
          • (146) fcpttf : F-value for TF coil current per turn limit (constraint equation 77)\n
          • (147) freinke : F-value for Reinke detachment criterion (constraint equation 78)\n
          • (148) fzactual : fraction of impurity at SOL with Reinke detachment criterion\n
          • (149) fbmaxcs : F-value for max peak CS field (con. 79, itvar 149)\n
          • (152) fbmaxcs : Ratio of separatrix density to Greenwald density\n
          • (153) fpdivlim : F-value for minimum pdivt (con. 80)\n
          • (154) fne0 : F-value for ne(0) > ne(ped) (con. 81)\n
          • (155) pfusife : IFE input fusion power (MW) (ifedrv=3 only)\n
          • (156) rrin : Input IFE repetition rate (Hz) (ifedrv=3 only)\n
          • (157) fvssu : F-value for available to required start up flux (con. 51)\n
          • (158) croco_thick : Thickness of CroCo copper tube (m)\n
          • (159) ftoroidalgap : F-value for toroidalgap > tftort constraint (con. 82)\n
          • (160) f_avspace (f-value for equation 83)\n
          • (161) fbeta_min (f-value for equation 84)\n
          • (162) r_cp_top : Top outer radius of the centropost (ST only) (m)\n
          • (163) f_t_turn_tf : f-value for TF coils WP trurn squared dimension constraint\n
          • (164) f_crypmw : f-value for cryogenic plant power\n
          • (165) fstr_wp : f-value for TF coil strain absolute value\n
          • (166) f_copperaoh_m2 : CS coil current /copper area < Maximum value\n
          • (167) fecrh_ignition: f-value for equation 90\n
          • (168) EMPTY : Description\n
          • (169) EMPTY : Description\n
          • (170) EMPTY : Description\n
          • (171) EMPTY : Description\n
          • (172) EMPTY : Description\n
          • (173) EMPTY : Description\n
          • (174) EMPTY : Description\n
          • (175) EMPTY : Description\n\n\n\n", "lambda_EU": "Decay length in EUROFER [cm]", "lambda_He_VV": "Decay length [cm]", "lambda_n_BZ_IB": "Decay length in IB BZ [cm]", From 879441a04a2877f637729eff45191b2254464bf2 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 16:30:20 +0000 Subject: [PATCH 31/38] =?UTF-8?q?=F0=9F=94=84=20Update=20obsolete=5Fvars.p?= =?UTF-8?q?y:=20rename=20fcwr,=20cvol,=20cwrmax,=20ishape,=20and=20iscrp?= =?UTF-8?q?=20for=20consistency=20across=20the=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/io/obsolete_vars.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index 2977be7ce0..fd8a19c8a9 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -148,6 +148,11 @@ "betalim": "beta_max", "betalim_lower": "beta_min", "fbeta": "fbeta_poloidal_eps", + "fcwr": "fr_conducting_wall", + "cvol": "f_vol_plasma", + "cwrmax": "f_r_conducting_wall", + "ishape": "i_plasma_geometry", + "iscrp": "i_plasma_wall_gap", } OBS_VARS_HELP = { From 695f84d96a93c52aa8a2d70139fc67990fec2745 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 21 Jan 2025 16:33:59 +0000 Subject: [PATCH 32/38] =?UTF-8?q?=F0=9F=94=84=20Rename=20snull=20to=20i=5F?= =?UTF-8?q?single=5Fnull=20in=20documentation=20and=20error=20messages=20f?= =?UTF-8?q?or=20consistency=20across=20the=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documentation/proc-pages/eng-models/divertor.md | 4 ++-- documentation/proc-pages/eng-models/pf-coil.md | 2 +- documentation/proc-pages/fusion-devices/spherical-tokamak.md | 4 ++-- process/init.py | 2 +- process/utilities/errorlist.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/proc-pages/eng-models/divertor.md b/documentation/proc-pages/eng-models/divertor.md index 52d6ebfed2..7f021df02c 100644 --- a/documentation/proc-pages/eng-models/divertor.md +++ b/documentation/proc-pages/eng-models/divertor.md @@ -5,9 +5,9 @@ The principal outputs from the code are the divertor heat load, used to determine its lifetime, and its peak temperature. The divertor is cooled either by gaseous helium or by pressurised water. -Switch `snull` controls the overall plasma configuration. Setting `snull = 0` +Switch `i_single_null` controls the overall plasma configuration. Setting `i_single_null= 0` corresponds to an up-down symmetric, double null configuration, while -`snull = 1` (the default) assumes a single null plasma with the divertor at the +`i_single_null= 1` (the default) assumes a single null plasma with the divertor at the bottom of the machine. The vertical build and PF coil current scaling algorithms take the value of this switch into account, although not the plasma geometry at present. diff --git a/documentation/proc-pages/eng-models/pf-coil.md b/documentation/proc-pages/eng-models/pf-coil.md index c39dd85aec..f0be5f399b 100644 --- a/documentation/proc-pages/eng-models/pf-coil.md +++ b/documentation/proc-pages/eng-models/pf-coil.md @@ -25,7 +25,7 @@ values for `rpf1`, `rpf2`, `zref(j)` and `routr` should be adjusted by the user coils accurately. The three possible values of `ipfloc(j)` correspond to the following PF coil positions: (Redo taking -into account snull and other recent changes e.g. rclsnorm) +into account `i_single_null` and other recent changes e.g. rclsnorm) `ipfloc(j)` = 1: PF coils are placed above the central solenoid (one group only); *R* = `rohc` + `rpf1`
            diff --git a/documentation/proc-pages/fusion-devices/spherical-tokamak.md b/documentation/proc-pages/fusion-devices/spherical-tokamak.md index 5cf6f7fe6f..14a6dd0365 100644 --- a/documentation/proc-pages/fusion-devices/spherical-tokamak.md +++ b/documentation/proc-pages/fusion-devices/spherical-tokamak.md @@ -10,7 +10,7 @@ title="Schematic diagram of the Power Core radial build" width="650" height="100" />

            -
            Figure 1: Schematic diagram of the fusion power core of a typical tokamak power plant modelled by `PROCESS`, showing the relative positions of the components. A double null plasma is assumed (`snull=0`) - compare Figure 2, and the first wall, blanket, shield and vacuum vessel are D-shaped in cross-section (chosen by setting switch `fwbsshape=1`) - compare Figure 3. Also shown are the code variables used to define the thicknesses of the components. The arrowed labels adjacent to the axes are the total 'builds' to that point. The precise locations and sizes of the PF coils are calculated within the code. +
            Figure 1: Schematic diagram of the fusion power core of a typical tokamak power plant modelled by `PROCESS`, showing the relative positions of the components. A double null plasma is assumed (`i_single_null=0`) - compare Figure 2, and the first wall, blanket, shield and vacuum vessel are D-shaped in cross-section (chosen by setting switch `fwbsshape=1`) - compare Figure 3. Also shown are the code variables used to define the thicknesses of the components. The arrowed labels adjacent to the axes are the total 'builds' to that point. The precise locations and sizes of the PF coils are calculated within the code.

            @@ -55,7 +55,7 @@ Switch `itart` provides overall control of the ST switches within the code, and title="Schematic diagram of the Power Core radial build" width="650" height="100" />

            -
            Figure 2: Schematic diagram of the fusion power core of a typical tokamak power plant modelled by `PROCESS`, showing the relative positions of the components. A single null plasma is assumed ('snull=1') - compare Figure 3. The radial build is the same as for a double null configuration; shown along the vertical axis are the code variables used to define the vertical thicknesses of the components. The arrow labels adjacent to the axis are the total 'builds' (distance from the midplane, Z=0) to that point. The precise locations and sizes of the PF coils are calculated within the code. +
            Figure 2: Schematic diagram of the fusion power core of a typical tokamak power plant modelled by `PROCESS`, showing the relative positions of the components. A single null plasma is assumed ('i_single_null=1') - compare Figure 3. The radial build is the same as for a double null configuration; shown along the vertical axis are the code variables used to define the vertical thicknesses of the components. The arrow labels adjacent to the axis are the total 'builds' (distance from the midplane, Z=0) to that point. The precise locations and sizes of the PF coils are calculated within the code.

            diff --git a/process/init.py b/process/init.py index fc1d261b50..91f2c45bd6 100644 --- a/process/init.py +++ b/process/init.py @@ -676,7 +676,7 @@ def check_process(): ) if fortran.physics_variables.i_single_null == 1 and j < 2: raise ProcessValidationError( - "If snull=1, use 2 individual divertor coils (ipfloc = 2, 2; ncls = 1, 1)" + "If i_single_null=1, use 2 individual divertor coils (ipfloc = 2, 2; ncls = 1, 1)" ) # Constraint 10 is dedicated to ST designs with demountable joints diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index 1d996c0952..6209fe800c 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -228,7 +228,7 @@ { "no": 44, "level": 3, - "message": "CHECK: If snull=1, use 2 individual divertor coils (ipfloc = 2, 2; ncls = 1, 1)" + "message": "CHECK: If i_single_null=1, use 2 individual divertor coils (ipfloc = 2, 2; ncls = 1, 1)" }, { "no": 45, From 3b0810e66697da51970a9e38d2c615fd72a68077 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 23 Jan 2025 11:21:16 +0000 Subject: [PATCH 33/38] :sparkle: review changes --- .../physics-models/plasma_geometry.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_geometry.md b/documentation/proc-pages/physics-models/plasma_geometry.md index c3ceeb8280..af1b5fe69c 100644 --- a/documentation/proc-pages/physics-models/plasma_geometry.md +++ b/documentation/proc-pages/physics-models/plasma_geometry.md @@ -13,7 +13,7 @@ required using certain switch conditions of `i_plasma_geometry`: The setting of the `i_plasma_shape` switch determines what type of plasma shaping formula to use. - - `i_plasma_shape = 0`: Default PROCESS plasma shape is used wich models the plasma as 2-intersecting arcs (DEFAULT). + - `i_plasma_shape = 0`: Default PROCESS plasma shape is used which models the plasma as 2-intersecting arcs (DEFAULT). - `i_plasma_shape = 1`: The Sauter geometry is used which includes the squareness $(\xi)$ parameter. The different parameterisations of the plasma shape can be experimented with in the plot below. @@ -478,9 +478,9 @@ $$ ------------------ -### Sauter geoemtry | `sauter_geometry()` +### Sauter geometry | `sauter_geometry()` -Plasma geometry based on equations'Geometric formulas for system codes including the effect of negative triangularity'[^7] +This function calculates the plasma volumes, areas, perimeter and shapes based on the Sauter formulation[^7]. | Input Variable | Description | |----------|--------------------------------------| @@ -506,38 +506,37 @@ $$ \epsilon = \frac{a}{R} $$ -Poloidal perimeter (named Lp in Sauter) +Poloidal perimeter (named $L_p$ in Sauter) $$ \mathtt{len\_plasma\_poloidal} = 2.0\pi a (1 + 0.55 (\kappa - 1))(1 + 0.08 \delta^2)(1 + 0.2 (\mathtt{w07} - 1)) $$ -Surface area (named Ap in Sauter) +Surface area (named $A_p$ in Sauter) $$ \mathtt{a\_plasma\_surface} = 2.0\pi R (1 - 0.32 \delta \epsilon) \mathtt{len\_plasma\_poloidal} $$ -Cross-section area (named S_phi in Sauter) +Cross-section area (named $S_{\phi}$ in Sauter) $$ \mathtt{a\_plasma\_poloidal} = \pi a^2 \kappa (1 + 0.52 (\mathtt{w07} - 1)) $$ -Volume +Volume (named $V$ in Sauter) $$ \mathtt{vol\_plasma} = 2.0\pi R (1 - 0.25 \delta \epsilon) \mathtt{a\_plasma\_poloidal} $$ - ------------------ ## Key Constraints ### Conducting shell radius -This constraint can be activated by stating `icc = 23` in the input file. +This constraint equation can be activated by stating `icc = 23` in the input file. In principle, the inner surface of the outboard shield could be used as the location of a conducting shell to mitigate the vertical From 6e4845a594ea8e24535dfda9540720ddca06db07 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 24 Jan 2025 11:14:56 +0000 Subject: [PATCH 34/38] =?UTF-8?q?=F0=9F=94=84=20Update=20docstrings=20in?= =?UTF-8?q?=20plasma=5Fgeometry.py,=20plot=5Fproc.py,=20and=20physics.py?= =?UTF-8?q?=20for=20improved=20clarity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/geometry/plasma_geometry.py | 25 +++++++++++-------------- process/io/plot_proc.py | 1 + process/physics.py | 16 ++++++++++------ process/plasma_geometry.py | 20 ++++++++++---------- 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/process/geometry/plasma_geometry.py b/process/geometry/plasma_geometry.py index 9f444297f2..28b95b009e 100644 --- a/process/geometry/plasma_geometry.py +++ b/process/geometry/plasma_geometry.py @@ -36,19 +36,16 @@ def plasma_geometry( based on the given major radius, minor radius, triangularity, and elongation at 95% of the plasma surface. It also considers whether the plasma configuration is single null or double null. - :param rmajor: Plasma major radius. - :param rminor: Plasma minor radius. - :param triang: Plasma triangularity at separatrix. - :param kappa: Plasma elongation at separatrix. - :param i_single_null: Switch for single null (1) or double null (0) plasma configuration. - :param i_plasma_shape: Switch for plasma shape (0 for double arc, 1 for Sauter). - :param square: Square term for Sauter plasma shape. - :return: A dataclass containing the plasma elongation and the radial and vertical coordinates of the plasma. - - The returned PlasmaGeometry dataclass contains: - - rs: List of radial coordinates for the inner and outer plasma boundaries. - - zs: List of vertical coordinates for the inner and outer plasma boundaries. - - kappa: Calculated plasma elongation. + :param float rmajor: Plasma major radius. + :param float rminor: Plasma minor radius. + :param float triang: Plasma triangularity at separatrix. + :param float kappa: Plasma elongation at separatrix. + :param int i_single_null: Switch for single null (1) or double null (0) plasma configuration. + :param int i_plasma_shape: Switch for plasma shape (0 for double arc, 1 for Sauter). + :param float square: Square term for Sauter plasma shape. + :returns: A dataclass containing the plasma elongation and the radial and vertical coordinates of the plasma. + :rtype: PlasmaGeometry + """ # Original PROCESS double arc plasma shape @@ -93,7 +90,7 @@ def plasma_geometry( return PlasmaGeometry(rs=rs, zs=zs, kappa=kappa) # Sauter plasma shape - if i_plasma_shape == 1: + elif i_plasma_shape == 1: x = np.linspace(-np.pi, np.pi, 256) # Sauter diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 5b3c3d2bab..0eb8cd6fb7 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -202,6 +202,7 @@ def plot_plasma(axis, mfile_data, scan, colour_scheme): square=plasma_square, ) if i_plasma_shape == 0: + # Plot the 2 plasma outline arcs. axis.plot(pg.rs[0], pg.zs[0], color="black") axis.plot(pg.rs[1], pg.zs[1], color="black") diff --git a/process/physics.py b/process/physics.py index 724841b2e2..ca5135b708 100644 --- a/process/physics.py +++ b/process/physics.py @@ -301,13 +301,17 @@ def calculate_current_coefficient_peng( """ Calculate the plasma current scaling coefficient for the Peng scaling from the STAR code. - Parameters: - - eps: float, plasma inverse aspect ratio - - len_plasma_poloidal: float, plasma poloidal perimeter length [m] - - rminor: float, plasma minor radius [m] + :param eps: Plasma inverse aspect ratio. + :type eps: float + :param len_plasma_poloidal: Plasma poloidal perimeter length [m]. + :type len_plasma_poloidal: float + :param rminor: Plasma minor radius [m]. + :type rminor: float - References: - - None + :return: The plasma current scaling coefficient. + :rtype: float + + :references: None """ return ( diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index a27e417d2d..9899a2efac 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -244,8 +244,6 @@ def plasma_geometry(self) -> None: physics_variables.triang, ) - # ====================================================================== - # Surface area - inboard and outboard. These are not given by Sauter but # the outboard area is required by DCLL and divertor xsi, xso = self.plasma_surface_area( @@ -315,25 +313,27 @@ def plasma_angles_arcs( Routine to find parameters used for calculating geometrical properties for double-null plasmas. - Author: P J Knight, CCFE, Culham Science Centre + :author: P J Knight, CCFE, Culham Science Centre - Parameters: - a (float): Plasma minor radius (m) - kappa (float): Plasma separatrix elongation - tri (float): Plasma separatrix triangularity + :param a: Plasma minor radius (m) + :type a: float + :param kappa: Plasma separatrix elongation + :type kappa: float + :param tri: Plasma separatrix triangularity + :type tri: float - Returns: - tuple: A tuple containing: + :returns: A tuple containing: - xi (float): Radius of arc describing inboard surface (m) - thetai (float): Half-angle of arc describing inboard surface - xo (float): Radius of arc describing outboard surface (m) - thetao (float): Half-angle of arc describing outboard surface + :rtype: tuple This function finds plasma geometrical parameters, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - References: + :references: - F/MI/PJK/LOGBOOK14, p.42 - F/PL/PJK/PROCESS/CODE/047 """ From 04b026dbb84593f10791f8d4c207b3576972942b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 24 Jan 2025 15:31:54 +0000 Subject: [PATCH 35/38] :art: Re-write docstring in plasma_geometry.py to reStructuredText style --- process/plasma_geometry.py | 252 +++++++++++++++++++++++-------------- 1 file changed, 157 insertions(+), 95 deletions(-) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 9899a2efac..5d52104acc 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -14,19 +14,19 @@ def __init__(self): def plasma_geometry(self) -> None: """ Plasma geometry parameters - author: P J Knight, CCFE, Culham Science Centre + + :author: P J Knight, CCFE, Culham Science Centre This method calculates the plasma geometry parameters based on various shaping terms and input values. It updates the `physics_variables` with calculated values for kappa, triangularity, surface area, volume, etc. - References: - - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, - unpublished internal Oak Ridge document - - H. Zohm et al, On the Physics Guidelines for a Tokamak DEMO, - FTP/3-3, Proc. IAEA Fusion Energy Conference, October 2012, San Diego + :references: + - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, + unpublished internal Oak Ridge document + - H. Zohm et al, On the Physics Guidelines for a Tokamak DEMO, + FTP/3-3, Proc. IAEA Fusion Energy Conference, October 2012, San Diego - Returns: - None + :returns: None """ xsi = 0.0e0 @@ -358,14 +358,17 @@ def plasma_poloidal_perimeter( """ Calculate the poloidal perimeter of the plasma. - Parameters: - xi (float): Radius of arc describing inboard surface (m) - thetai (float): Half-angle of arc describing inboard surface - xo (float): Radius of arc describing outboard surface (m) - thetao (float): Half-angle of arc describing outboard surface - - Returns: - float: Poloidal perimeter (m) + :param xi: Radius of arc describing inboard surface (m) + :type xi: float + :param thetai: Half-angle of arc describing inboard surface + :type thetai: float + :param xo: Radius of arc describing outboard surface (m) + :type xo: float + :param thetao: Half-angle of arc describing outboard surface + :type thetao: float + + :returns: Poloidal perimeter (m) + :rtype: float """ return 2.0e0 * (xo * thetao + xi * thetai) @@ -375,26 +378,31 @@ def plasma_surface_area( ) -> tuple[float, float]: """ Plasma surface area calculation - author: P J Knight, CCFE, Culham Science Centre - - Parameters: - rmajor (float): Plasma major radius (m) - rminor (float): Plasma minor radius (m) - xi (float): Radius of arc describing inboard surface (m) - thetai (float): Half-angle of arc describing inboard surface - xo (float): Radius of arc describing outboard surface (m) - thetao (float): Half-angle of arc describing outboard surface - - Returns: - tuple: A tuple containing: + :author: P J Knight, CCFE, Culham Science Centre + + :param rmajor: Plasma major radius (m) + :type rmajor: float + :param rminor: Plasma minor radius (m) + :type rminor: float + :param xi: Radius of arc describing inboard surface (m) + :type xi: float + :param thetai: Half-angle of arc describing inboard surface + :type thetai: float + :param xo: Radius of arc describing outboard surface (m) + :type xo: float + :param thetao: Half-angle of arc describing outboard surface + :type thetao: float + + :returns: A tuple containing: - xsi (float): Inboard surface area (m^2) - xso (float): Outboard surface area (m^2) + :rtype: tuple This function finds the plasma surface area, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - References: + :references: - F/MI/PJK/LOGBOOK14, p.43 """ fourpi = 4.0e0 * np.pi @@ -411,24 +419,29 @@ def plasma_surface_area( def plasma_volume(rmajor, rminor, xi, thetai, xo, thetao): """ Plasma volume calculation - author: P J Knight, CCFE, Culham Science Centre - - Parameters: - rmajor (float): Plasma major radius (m) - rminor (float): Plasma minor radius (m) - xi (float): Radius of arc describing inboard surface (m) - thetai (float): Half-angle of arc describing inboard surface - xo (float): Radius of arc describing outboard surface (m) - thetao (float): Half-angle of arc describing outboard surface + :author: P J Knight, CCFE, Culham Science Centre - Returns: - float: Plasma volume (m^3) + :param rmajor: Plasma major radius (m) + :type rmajor: float + :param rminor: Plasma minor radius (m) + :type rminor: float + :param xi: Radius of arc describing inboard surface (m) + :type xi: float + :param thetai: Half-angle of arc describing inboard surface + :type thetai: float + :param xo: Radius of arc describing outboard surface (m) + :type xo: float + :param thetao: Half-angle of arc describing outboard surface + :type thetao: float + + :returns: Plasma volume (m^3) + :rtype: float This function finds the plasma volume, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - References: + :references: - F/MI/PJK/LOGBOOK14, p.43 """ @@ -471,22 +484,25 @@ def plasma_cross_section( ) -> float: """ Plasma cross-sectional area calculation - author: P J Knight, CCFE, Culham Science Centre + :author: P J Knight, CCFE, Culham Science Centre - Parameters: - xi (float): Radius of arc describing inboard surface (m) - thetai (float): Half-angle of arc describing inboard surface - xo (float): Radius of arc describing outboard surface (m) - thetao (float): Half-angle of arc describing outboard surface + :param xi: Radius of arc describing inboard surface (m) + :type xi: float + :param thetai: Half-angle of arc describing inboard surface + :type thetai: float + :param xo: Radius of arc describing outboard surface (m) + :type xo: float + :param thetao: Half-angle of arc describing outboard surface + :type thetao: float - Returns: - float: Plasma cross-sectional area (m^2) + :returns: Plasma cross-sectional area (m^2) + :rtype: float This function finds the plasma cross-sectional area, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - References: + :references: - F/MI/PJK/LOGBOOK14, p.41 """ @@ -503,27 +519,30 @@ def sauter_geometry( """ Calculate the plasma geometry parameters using the Sauter geometry model. - Parameters: - a (float): Plasma minor radius (m) - r0 (float): Plasma major radius (m) - kappa (float): Plasma separatrix elongation - triang (float): Plasma separatrix triangularity - square (float): Plasma squareness + :param a: Plasma minor radius (m) + :type a: float + :param r0: Plasma major radius (m) + :type r0: float + :param kappa: Plasma separatrix elongation + :type kappa: float + :param triang: Plasma separatrix triangularity + :type triang: float + :param square: Plasma squareness + :type square: float - Returns: - tuple: A tuple containing: + :returns: A tuple containing: - len_plasma_poloidal (float): Poloidal perimeter - a_plasma_surface (float): Surface area - a_plasma_poloidal (float): Cross-section area - vol_plasma (float): Plasma volume + :rtype: tuple - Notes: + :notes: - Refrences: + :references: - O. Sauter, “Geometric formulas for system codes including the effect of negative triangularity,” Fusion Engineering and Design, vol. 112, pp. 633–645, Nov. 2016, doi: https://doi.org/10.1016/j.fusengdes.2016.04.033. - """ # Calculate w07 parameter from paper from squareness assuming top-down symmetry @@ -566,22 +585,34 @@ def sauter_geometry( # -------------------------------- -def surfa(a, r, k, d): +def surfa(a: float, r: float, k: float, d: float) -> tuple[float, float]: """ Plasma surface area calculation - author: P J Knight, CCFE, Culham Science Centre - a : input real : plasma minor radius (m) - r : input real : plasma major radius (m) - k : input real : plasma separatrix elongation - d : input real : plasma separatrix triangularity - sa : output real : plasma total surface area (m2) - so : output real : plasma outboard surface area (m2) + + :author: P J Knight, CCFE, Culham Science Centre + + :param a: Plasma minor radius (m) + :type a: float + :param r: Plasma major radius (m) + :type r: float + :param k: Plasma separatrix elongation + :type k: float + :param d: Plasma separatrix triangularity + :type d: float + + :returns: A tuple containing: + - sa (float): Plasma total surface area (m^2) + - so (float): Plasma outboard surface area (m^2) + :rtype: tuple + This function finds the plasma surface area, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. It was the original method in PROCESS. - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, - unpublished internal Oak Ridge document + + :references: + - J D Galambos, STAR Code : Spherical Tokamak Analysis and Reactor Code, + unpublished internal Oak Ridge document """ radco = a * (1.0e0 + (k**2 + d**2 - 1.0e0) / (2.0e0 * (1.0e0 + d))) b = k * a @@ -599,17 +630,28 @@ def surfa(a, r, k, d): return sa, so -def perim(a, kap, tri): +def perim(a: float, kap: float, tri: float) -> float: """ Plasma poloidal perimeter calculation - author: P J Knight, CCFE, Culham Science Centre - a : input real : plasma minor radius (m) - kap : input real : plasma separatrix elongation - tri : input real : plasma separatrix triangularity + + :author: P J Knight, CCFE, Culham Science Centre + + :param a: Plasma minor radius (m) + :type a: float + :param kap: Plasma separatrix elongation + :type kap: float + :param tri: Plasma separatrix triangularity + :type tri: float + + :returns: Plasma poloidal perimeter (m) + :rtype: float + This function finds the plasma poloidal perimeter, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - F/PL/PJK/PROCESS/CODE/047 + + :references: + - F/PL/PJK/PROCESS/CODE/047 """ # Inboard arc @@ -629,19 +671,31 @@ def perim(a, kap, tri): return perim -def fvol(r, a, kap, tri): +def fvol(r: float, a: float, kap: float, tri: float) -> float: """ Plasma volume calculation - author: P J Knight, CCFE, Culham Science Centre - r : input real : plasma major radius (m) - a : input real : plasma minor radius (m) - kap : input real : plasma separatrix elongation - tri : input real : plasma separatrix triangularity + + :author: P J Knight, CCFE, Culham Science Centre + + :param r: Plasma major radius (m) + :type r: float + :param a: Plasma minor radius (m) + :type a: float + :param kap: Plasma separatrix elongation + :type kap: float + :param tri: Plasma separatrix triangularity + :type tri: float + + :returns: Plasma volume (m^3) + :rtype: float + This function finds the plasma volume, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - F/MI/PJK/LOGBOOK14, p.41 - F/PL/PJK/PROCESS/CODE/047 + + :references: + - F/MI/PJK/LOGBOOK14, p.41 + - F/PL/PJK/PROCESS/CODE/047 """ zn = kap * a @@ -673,21 +727,29 @@ def fvol(r, a, kap, tri): return fvol -def xsect0(a, kap, tri): +def xsect0(a: float, kap: float, tri: float) -> float: """ Plasma cross-sectional area calculation - author: P J Knight, CCFE, Culham Science Centre - a : input real : plasma minor radius (m) - kap : input real : plasma separatrix elongation - tri : input real : plasma separatrix triangularity + + :author: P J Knight, CCFE, Culham Science Centre + + :param a: Plasma minor radius (m) + :type a: float + :param kap: Plasma separatrix elongation + :type kap: float + :param tri: Plasma separatrix triangularity + :type tri: float + + :returns: Plasma cross-sectional area (m^2) + :rtype: float + This function finds the plasma cross-sectional area, using the revolution of two intersecting arcs around the device centreline. This calculation is appropriate for plasmas with a separatrix. - The method for finding the arc radii and angles are copied from - routine PERIM, and are thought to be - by Peng. - F/MI/PJK/LOGBOOK14, p.41 - F/PL/PJK/PROCESS/CODE/047 + + :references: + - F/MI/PJK/LOGBOOK14, p.41 + - F/PL/PJK/PROCESS/CODE/047 """ denomi = (tri**2 + kap**2 - 1.0e0) / (2.0e0 * (1.0e0 - tri)) + tri From 9d720469eba090adf396bbef4119128c8a23b6b9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 27 Jan 2025 13:52:07 +0000 Subject: [PATCH 36/38] =?UTF-8?q?=F0=9F=94=84=20Update=20parameter=20docum?= =?UTF-8?q?entation=20in=20plasma=5Fgeometry.py=20to=20include=20type=20an?= =?UTF-8?q?notations=20for=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/geometry/plasma_geometry.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/process/geometry/plasma_geometry.py b/process/geometry/plasma_geometry.py index 28b95b009e..4fef97ac83 100644 --- a/process/geometry/plasma_geometry.py +++ b/process/geometry/plasma_geometry.py @@ -36,13 +36,20 @@ def plasma_geometry( based on the given major radius, minor radius, triangularity, and elongation at 95% of the plasma surface. It also considers whether the plasma configuration is single null or double null. - :param float rmajor: Plasma major radius. - :param float rminor: Plasma minor radius. - :param float triang: Plasma triangularity at separatrix. - :param float kappa: Plasma elongation at separatrix. - :param int i_single_null: Switch for single null (1) or double null (0) plasma configuration. - :param int i_plasma_shape: Switch for plasma shape (0 for double arc, 1 for Sauter). - :param float square: Square term for Sauter plasma shape. + :param rmajor: Plasma major radius. + :type rmajor: float + :param rminor: Plasma minor radius. + :type rminor: float + :param triang: Plasma triangularity at separatrix. + :type triang: float + :param kappa: Plasma elongation at separatrix. + :type kappa: float + :param i_single_null: Switch for single null (1) or double null (0) plasma configuration. + :type i_single_null: int + :param i_plasma_shape: Switch for plasma shape (0 for double arc, 1 for Sauter). + :type i_plasma_shape: int + :param square: Square term for Sauter plasma shape. + :type square: float :returns: A dataclass containing the plasma elongation and the radial and vertical coordinates of the plasma. :rtype: PlasmaGeometry From b9db016c106769a899d04acddb86b47cba991c8b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 27 Jan 2025 14:15:18 +0000 Subject: [PATCH 37/38] =?UTF-8?q?=F0=9F=94=84=20Add=20type=20annotations?= =?UTF-8?q?=20to=20plasma=5Fvolume=20method=20in=20plasma=5Fgeometry.py=20?= =?UTF-8?q?for=20improved=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/plasma_geometry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index 5d52104acc..c65792c327 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -416,7 +416,9 @@ def plasma_surface_area( return xsi, xso @staticmethod - def plasma_volume(rmajor, rminor, xi, thetai, xo, thetao): + def plasma_volume( + rmajor: float, rminor: float, xi: float, thetai: float, xo: float, thetao: float + ) -> float: """ Plasma volume calculation :author: P J Knight, CCFE, Culham Science Centre From dc7142904383668b112ba23975eb5ad10a07322a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 27 Jan 2025 14:23:20 +0000 Subject: [PATCH 38/38] Update to new `ruff` rules from main --- process/geometry/plasma_geometry.py | 5 ++++- process/physics_functions.py | 4 +--- process/plasma_geometry.py | 27 ++++++++------------------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/process/geometry/plasma_geometry.py b/process/geometry/plasma_geometry.py index 4fef97ac83..3c5f1070a9 100644 --- a/process/geometry/plasma_geometry.py +++ b/process/geometry/plasma_geometry.py @@ -97,7 +97,7 @@ def plasma_geometry( return PlasmaGeometry(rs=rs, zs=zs, kappa=kappa) # Sauter plasma shape - elif i_plasma_shape == 1: + if i_plasma_shape == 1: x = np.linspace(-np.pi, np.pi, 256) # Sauter @@ -105,3 +105,6 @@ def plasma_geometry( Z = kappa * rminor * np.sin(x + square * np.sin(2 * x)) return PlasmaGeometry(rs=R, zs=Z, kappa=kappa) + + # Explicit return statement at the end of the function + return None diff --git a/process/physics_functions.py b/process/physics_functions.py index fa08b0346b..65c1b70355 100644 --- a/process/physics_functions.py +++ b/process/physics_functions.py @@ -659,9 +659,7 @@ def psync_albajar_fidone(): # psyncpv should be per unit volume; Albajar gives it as total - psyncpv = psync / physics_variables.vol_plasma - - return psyncpv + return psync / physics_variables.vol_plasma @dataclass diff --git a/process/plasma_geometry.py b/process/plasma_geometry.py index c65792c327..c0f30bd238 100644 --- a/process/plasma_geometry.py +++ b/process/plasma_geometry.py @@ -475,10 +475,7 @@ def plasma_volume( ) ) - xvol = vout - vin - xvol = xvol - - return xvol + return vout - vin @staticmethod def plasma_cross_section( @@ -508,11 +505,9 @@ def plasma_cross_section( - F/MI/PJK/LOGBOOK14, p.41 """ - plasma_cross_section = xo**2 * ( - thetao - np.cos(thetao) * np.sin(thetao) - ) + xi**2 * (thetai - np.cos(thetai) * np.sin(thetai)) - - return plasma_cross_section + return xo**2 * (thetao - np.cos(thetao) * np.sin(thetao)) + xi**2 * ( + thetai - np.cos(thetai) * np.sin(thetai) + ) @staticmethod def sauter_geometry( @@ -543,7 +538,7 @@ def sauter_geometry( :references: - O. Sauter, “Geometric formulas for system codes including the effect of negative triangularity,” - Fusion Engineering and Design, vol. 112, pp. 633–645, Nov. 2016, + Fusion Engineering and Design, vol. 112, pp. 633-645, Nov. 2016, doi: https://doi.org/10.1016/j.fusengdes.2016.04.033. """ @@ -668,9 +663,7 @@ def perim(a: float, kap: float, tri: float) -> float: thetao = np.arctan(kap / denomo) xlo = a * (denomo + 1.0e0 + tri) - perim = 2.0e0 * (xlo * thetao + xli * thetai) - - return perim + return 2.0e0 * (xlo * thetao + xli * thetai) def fvol(r: float, a: float, kap: float, tri: float) -> float: @@ -724,9 +717,7 @@ def fvol(r: float, a: float, kap: float, tri: float) -> float: * (zn * np.sqrt(rc2**2 - zn**2) + rc2**2 * np.arcsin(zn / rc2)) ) - fvol = vout - vin - - return fvol + return vout - vin def xsect0(a: float, kap: float, tri: float) -> float: @@ -772,6 +763,4 @@ def xsect0(a: float, kap: float, tri: float) -> float: # Find cross-sectional area - xsect0 = xlo**2 * (thetao - cto * sto) + xli**2 * (thetai - cti * sti) - - return xsect0 + return xlo**2 * (thetao - cto * sto) + xli**2 * (thetai - cti * sti)