From 6f7fc486c413bbf062fc2757d659410988ea54e7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 14:55:53 +0000 Subject: [PATCH 01/20] Refactor culblm function to calculate_beta_limit with enhanced documentation and type hints --- process/physics.py | 51 ++++++++++++++++++++++++-------------- tests/unit/test_physics.py | 6 ++--- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/process/physics.py b/process/physics.py index 9afa7f19..adbfddd5 100644 --- a/process/physics.py +++ b/process/physics.py @@ -136,28 +136,43 @@ def vscalc( @nb.jit(nopython=True, cache=True) -def culblm(bt, dnbeta, plasma_current, rminor): - """Beta scaling limit - author: P J Knight, CCFE, Culham Science Centre - bt : input real : toroidal B-field on plasma axis (T) - dnbeta : input real : Troyon-like g coefficient - plasma_current : input real : plasma current (A) - rminor : input real : plasma minor axis (m) - betalim : output real : beta limit as defined below - This subroutine calculates the beta limit, using - the algorithm documented in AEA FUS 172. +def calculate_beta_limit(bt: float, dnbeta: float, plasma_current: float, rminor: float) -> float: + """ + Calculate the beta scaling limit. + + :param bt: Toroidal B-field on plasma axis [T]. + :type bt: float + :param dnbeta: Troyon-like g coefficient. + :type dnbeta: float + :param plasma_current: Plasma current [A]. + :type plasma_current: float + :param rminor: Plasma minor axis [m]. + :type rminor: float + :return: Beta limit as defined below. + :rtype: float + + This subroutine calculates the beta limit using the algorithm documented in AEA FUS 172. The limit applies to beta defined with respect to the total B-field. Switch iculbl determines which components of beta to include. - If iculbl = 0, then the limit is applied to the total beta - If iculbl = 1, then the limit is applied to the thermal beta only - If iculbl = 2, then the limit is applied to the thermal + neutral beam beta components - If iculbl = 3, then the limit is applied to the toroidal beta + Notes: + - If iculbl = 0, then the limit is applied to the total beta. + - If iculbl = 1, then the limit is applied to the thermal beta only. + - If iculbl = 2, then the limit is applied to the thermal + neutral beam beta components. + - If iculbl = 3, then the limit is applied to the toroidal beta. + + - The default value for the g coefficient is dnbeta = 3.5. + + References: + - F. Troyon et.al, “Beta limit in tokamaks. Experimental and computational status,” + Plasma Physics and Controlled Fusion, vol. 30, no. 11, pp. 1597–1609, Oct. 1988, + doi: https://doi.org/10.1088/0741-3335/30/11/019. + + - T.C.Hender et.al., 'Physics Assesment of the European Reactor Study', AEA FUS 172, 1992 - The default value for the g coefficient is dnbeta = 3.5 - AEA FUS 172: Physics Assessment for the European Reactor Study """ + # Multiplied by 0.01 to convert from % to fraction return 0.01 * dnbeta * (plasma_current / 1.0e6) / (rminor * bt) @@ -2203,8 +2218,8 @@ def physics(self): (physics_variables.c_beta / Fp) * (12.5e0 - 3.5e0 * Fp) ) - # culblm returns the betalim for beta - physics_variables.betalim = culblm( + # calculate_beta_limit() returns the betalim for beta + physics_variables.betalim = calculate_beta_limit( physics_variables.bt, physics_variables.dnbeta, physics_variables.plasma_current, diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 81e69354..edd0505f 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -17,7 +17,7 @@ diamagnetic_fraction_hender, ps_fraction_scene, calculate_plasma_current_peng, - culblm, + calculate_beta_limit, calculate_current_coefficient_hastie, vscalc, rether, @@ -821,8 +821,8 @@ def test_calculate_poloidal_field(arguments, expected): assert calculate_poloidal_field(**arguments) == pytest.approx(expected) -def test_culblm(): - assert culblm(12, 4.879, 18300000, 2.5) == pytest.approx(0.0297619) +def test_calculate_beta_limit(): + assert calculate_beta_limit(12, 4.879, 18300000, 2.5) == pytest.approx(0.0297619) def test_conhas(): From efed2dc6c65f148538bd4f5308e2ca030edd5c97 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 15:48:53 +0000 Subject: [PATCH 02/20] Update navigation structure in mkdocs.yml for Beta Limit section. Move the fast alpha pressure contribution into the plasma beta docs section --- .../plasma_alpha_beta_contribution.md} | 0 .../physics-models/{ => plasma_beta}/plasma_beta.md | 0 mkdocs.yml | 5 +++-- process/physics.py | 4 +++- 4 files changed, 6 insertions(+), 3 deletions(-) rename documentation/proc-pages/physics-models/{plasma_alpha.md => plasma_beta/plasma_alpha_beta_contribution.md} (100%) rename documentation/proc-pages/physics-models/{ => plasma_beta}/plasma_beta.md (100%) diff --git a/documentation/proc-pages/physics-models/plasma_alpha.md b/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md similarity index 100% rename from documentation/proc-pages/physics-models/plasma_alpha.md rename to documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md diff --git a/documentation/proc-pages/physics-models/plasma_beta.md b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md similarity index 100% rename from documentation/proc-pages/physics-models/plasma_beta.md rename to documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md diff --git a/mkdocs.yml b/mkdocs.yml index 9389ff36..4ff76e2d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -52,8 +52,9 @@ nav: - Overview: physics-models/fusion_reactions/plasma_reactions.md - Beam reactions: physics-models/fusion_reactions/beam_reactions.md - Bosch-Hale Methods: physics-models/fusion_reactions/plasma_bosch_hale.md - - Beta Limit: physics-models/plasma_beta.md - - Fast Alpha: physics-models/plasma_alpha.md + - Beta Limit: + - Overview: physics-models/plasma_beta/plasma_beta.md + - Fast Alpha: physics-models/plasma_beta/plasma_alpha_beta_contribution.md - Density Limit: physics-models/plasma_density.md - Composition, Impurities & Radiation: physics-models/plasma_radiation_impurities.md - Plasma Current: diff --git a/process/physics.py b/process/physics.py index adbfddd5..aa10a03a 100644 --- a/process/physics.py +++ b/process/physics.py @@ -136,7 +136,9 @@ def vscalc( @nb.jit(nopython=True, cache=True) -def calculate_beta_limit(bt: float, dnbeta: float, plasma_current: float, rminor: float) -> float: +def calculate_beta_limit( + bt: float, dnbeta: float, plasma_current: float, rminor: float +) -> float: """ Calculate the beta scaling limit. From 3cbbb231a643bb9adf09545bbc2487a822c94dff Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 15:54:21 +0000 Subject: [PATCH 03/20] Rename betaft to beta_fast_alpha across the codebase for consistency and clarity --- .../proc-pages/development/standards.md | 4 +-- process/physics.py | 16 ++++++--- process/physics_functions.py | 6 ++-- process/stellarator.py | 4 +-- source/fortran/constraint_equations.f90 | 34 +++++++++---------- source/fortran/physics_variables.f90 | 4 +-- tests/integration/ref_dicts.json | 6 ++-- tests/unit/test_physics_functions.py | 2 +- 8 files changed, 41 insertions(+), 35 deletions(-) diff --git a/documentation/proc-pages/development/standards.md b/documentation/proc-pages/development/standards.md index 59a7b449..cf8f3983 100644 --- a/documentation/proc-pages/development/standards.md +++ b/documentation/proc-pages/development/standards.md @@ -306,7 +306,7 @@ subroutine constraint_eqn_001(args) !! - \( T_i \) -- density weighted average ion temperature [keV] !! - \( B_{tot} \) -- total toroidal + poloidal field [T] - use physics_variables, only: betaft, beta_beam, dene, ten, dnitot, tin, btot, beta + use physics_variables, only: beta_fast_alpha, beta_beam, dene, ten, dnitot, tin, btot, beta use constants, only: electron_charge,rmu0 implicit none @@ -314,7 +314,7 @@ subroutine constraint_eqn_001(args) type(constraint_args_type), intent(out) :: args !! constraint derived type - args%cc = 1.0D0 - (betaft + beta_beam + & + args%cc = 1.0D0 - (beta_fast_alpha + beta_beam + & 2.0D3*rmu0*electron_charge * (dene*ten + dnitot*tin)/btot**2 )/beta args%con = beta * (1.0D0 - args%cc) args%err = beta * args%cc diff --git a/process/physics.py b/process/physics.py index aa10a03a..3c29ce3c 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1708,7 +1708,7 @@ def physics(self): # Wilson scaling uses thermal poloidal beta, not total betpth = ( physics_variables.beta - - physics_variables.betaft + - physics_variables.beta_fast_alpha - physics_variables.beta_beam ) * (physics_variables.btot / physics_variables.bp) ** 2 current_drive_variables.bscf_wilson = ( @@ -1927,7 +1927,7 @@ def physics(self): physics_variables.alpha_power_density_plasma, ) - physics_variables.betaft = physics_funcs.fast_alpha_beta( + physics_variables.beta_fast_alpha = physics_funcs.fast_alpha_beta( physics_variables.bp, physics_variables.bt, physics_variables.dene, @@ -3450,10 +3450,12 @@ def outplas(self): betath = ( physics_variables.beta - - physics_variables.betaft + - physics_variables.beta_fast_alpha - physics_variables.beta_beam ) - gammaft = (physics_variables.betaft + physics_variables.beta_beam) / betath + gammaft = ( + physics_variables.beta_fast_alpha + physics_variables.beta_beam + ) / betath po.ovarre(self.outfile, "Total plasma beta", "(beta)", physics_variables.beta) po.ovarre( @@ -3472,7 +3474,11 @@ def outplas(self): "OP ", ) po.ovarre( - self.outfile, "Fast alpha beta", "(betaft)", physics_variables.betaft, "OP " + self.outfile, + "Fast alpha beta", + "(beta_fast_alpha)", + physics_variables.beta_fast_alpha, + "OP ", ) po.ovarre( self.outfile, diff --git a/process/physics_functions.py b/process/physics_functions.py index 960a9ac9..1e8ade78 100644 --- a/process/physics_functions.py +++ b/process/physics_functions.py @@ -984,12 +984,12 @@ def fast_alpha_beta( fact = max(fact, 0.0) fact2 = alpha_power_density_total / alpha_power_density_plasma - betaft = betath * fact * fact2 + beta_fast_alpha = betath * fact * fact2 else: # negligible alpha production, alpha_power_density = alpha_power_beams = 0 - betaft = 0.0 + beta_fast_alpha = 0.0 - return betaft + return beta_fast_alpha def beam_fusion( diff --git a/process/stellarator.py b/process/stellarator.py index c11f7863..7d1a7d75 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -3890,7 +3890,7 @@ def stphys(self, output): # Set physics_variables.beta as a consequence: # This replaces constraint equation 1 as it is just an equality. physics_variables.beta = ( - physics_variables.betaft + physics_variables.beta_fast_alpha + physics_variables.beta_beam + 2.0e3 * constants.rmu0 @@ -4039,7 +4039,7 @@ def stphys(self, output): physics_variables.alpha_power_density_plasma, ) - physics_variables.betaft = physics_funcs.fast_alpha_beta( + physics_variables.beta_fast_alpha = physics_funcs.fast_alpha_beta( physics_variables.bp, physics_variables.bt, physics_variables.dene, diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index 8860d4a1..98dffee5 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -342,8 +342,8 @@ end subroutine constraint_eqns subroutine constraint_err_001() !! Error in: Relationship between beta, temperature (keV) and density (consistency equation) !! author: P B Lloyd, CCFE, Culham Science Centre - use physics_variables, only: betaft, beta_beam, dene, ten, dnitot, tin, btot, beta - write(*,*) 'betaft = ', betaft + use physics_variables, only: beta_fast_alpha, beta_beam, dene, ten, dnitot, tin, btot, beta + write(*,*) 'beta_fast_alpha = ', beta_fast_alpha write(*,*) 'beta_beam = ', beta_beam write(*,*) 'dene = ', dene write(*,*) 'ten = ', ten @@ -408,7 +408,7 @@ subroutine constraint_eqn_001(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! - \( T_i \) -- density weighted average ion temperature [keV] !! - \( B_{tot} \) -- total toroidal + poloidal field [T] - use physics_variables, only: betaft, beta_beam, dene, ten, dnitot, tin, btot, beta + use physics_variables, only: beta_fast_alpha, beta_beam, dene, ten, dnitot, tin, btot, beta use constants, only: electron_charge,rmu0 implicit none @@ -422,7 +422,7 @@ subroutine constraint_eqn_001(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! constraint derived type - tmp_cc = 1.0D0 - (betaft + beta_beam + & + tmp_cc = 1.0D0 - (beta_fast_alpha + beta_beam + & 2.0D3*rmu0*electron_charge * (dene*ten + dnitot*tin)/btot**2 )/beta tmp_con = beta * (1.0D0 - tmp_cc) tmp_err = beta * tmp_cc @@ -1270,11 +1270,11 @@ subroutine constraint_eqn_024(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! fbetatry : input real : f-value for beta limit !! betalim : input real : allowable beta !! beta : input real : total plasma beta (calculated if ipedestal =3) - !! betaft : input real : fast alpha beta component + !! beta_fast_alpha : input real : fast alpha beta component !! beta_beam : input real : neutral beam beta component !! bt : input real : toroidal field !! btot : input real : total field - use physics_variables, only: iculbl, betalim, beta, beta_beam, betaft, bt, btot + use physics_variables, only: iculbl, betalim, beta, beta_beam, beta_fast_alpha, bt, btot use stellarator_variables, only: istell use constraint_variables, only: fbetatry implicit none @@ -1293,16 +1293,16 @@ subroutine constraint_eqn_024(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) tmp_units = '' ! Here, the beta limit applies to only the thermal component, not the fast alpha or neutral beam parts else if (iculbl == 1) then - tmp_cc = 1.0D0 - fbetatry * betalim/(beta-betaft-beta_beam) + tmp_cc = 1.0D0 - fbetatry * betalim/(beta-beta_fast_alpha-beta_beam) tmp_con = betalim - tmp_err = betalim - (beta-betaft-beta_beam) / fbetatry + tmp_err = betalim - (beta-beta_fast_alpha-beta_beam) / fbetatry tmp_symbol = '<' tmp_units = '' ! Beta limit applies to thermal + neutral beam: components of the total beta, i.e. excludes alphas else if (iculbl == 2) then - tmp_cc = 1.0D0 - fbetatry * betalim/(beta-betaft) + tmp_cc = 1.0D0 - fbetatry * betalim/(beta-beta_fast_alpha) tmp_con = betalim * (1.0D0 - tmp_cc) - tmp_err = (beta-betaft) * tmp_cc + tmp_err = (beta-beta_fast_alpha) * tmp_cc tmp_symbol = '<' tmp_units = '' ! Beta limit applies to toroidal beta @@ -3130,16 +3130,16 @@ subroutine constraint_eqn_084(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! author: J Lion, IPP Greifswald !! args : output structure : residual error; constraint value; !! residual error in physical units; output string; units string - !! (beta-betaft) > betalim_lower + !! (beta-beta_fast_alpha) > betalim_lower !! #=# physics - !! #=#=# betaft, beta, fbetatry_lower + !! #=#=# beta_fast_alpha, beta, fbetatry_lower !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. - !! fbetatry_lower : input real : f-value for constraint beta-betaft > betalim_lower + !! fbetatry_lower : input real : f-value for constraint beta-beta_fast_alpha > betalim_lower !! betalim_lower : input real : Lower limit for beta !! beta : input real : plasma beta - !! betaft : input real : Alpha particle beta + !! beta_fast_alpha : input real : Alpha particle beta - use physics_variables, only: betalim_lower, beta, betaft + use physics_variables, only: betalim_lower, beta, beta_fast_alpha use constraint_variables, only: fbetatry_lower implicit none real(dp), intent(out) :: tmp_cc @@ -3149,9 +3149,9 @@ subroutine constraint_eqn_084(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=10), intent(out) :: tmp_units - tmp_cc = 1.0D0 - fbetatry_lower * (beta-betaft)/betalim_lower + tmp_cc = 1.0D0 - fbetatry_lower * (beta-beta_fast_alpha)/betalim_lower tmp_con = betalim_lower * (1.0D0 - tmp_cc) - tmp_err = (beta-betaft) * tmp_cc + tmp_err = (beta-beta_fast_alpha) * tmp_cc tmp_symbol = '>' tmp_units = '' diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 3d2c2988..82793fa2 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -53,7 +53,7 @@ module physics_variables real(dp) :: beta !! total plasma beta (`iteration variable 5`) (calculated if stellarator) - real(dp) :: betaft + real(dp) :: beta_fast_alpha !! fast alpha beta component real(dp) :: betalim @@ -913,7 +913,7 @@ subroutine init_physics_variables aspect = 2.907D0 beamfus0 = 1.0D0 beta = 0.042D0 - betaft = 0.0D0 + beta_fast_alpha = 0.0D0 betalim = 0.0D0 betalim_lower = 0.0D0 beta_beam = 0.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 948132a6..2a0e97d3 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -295,7 +295,7 @@ "best_sum_so_far": 999.0, "beta": 0.042, "beta_mcdonald": 0.0, - "betaft": 0.0, + "beta_fast_alpha": 0.0, "betai": 1.0, "betalim": 0.0, "betalim_lower": 0.0, @@ -8862,7 +8862,7 @@ "best_sum_so_far": "", "beta": "total plasma beta (`iteration variable 5`) (calculated if `ipedestal=3` or stellarator)", "beta_mcdonald": "", - "betaft": "fast alpha beta component", + "beta_fast_alpha": "fast alpha beta component", "betai": "poloidal plane angle between divertor plate and leg, inboard (rad)", "betalim": "allowable beta", "betalim_lower": "allowable lower beta", @@ -19053,7 +19053,7 @@ "aspect", "beamfus0", "beta", - "betaft", + "beta_fast_alpha", "betalim", "betalim_lower", "beta_beam", diff --git a/tests/unit/test_physics_functions.py b/tests/unit/test_physics_functions.py index 9b1ba97d..5e1e0ae5 100644 --- a/tests/unit/test_physics_functions.py +++ b/tests/unit/test_physics_functions.py @@ -54,7 +54,7 @@ class SetFusionPowersParam(NamedTuple): expected_non_alpha_charged_power: Any = None - expected_betaft: Any = None + expected_beta_fast_alpha: Any = None expected_alpha_power_electron_density: Any = None From 77a09f2a46f36c14fe340449bcc318fe2baa9155 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 16:28:21 +0000 Subject: [PATCH 04/20] Rename switch variable iculbl to i_beta_component for clarity in beta limit scaling --- .../physics-models/plasma_beta/plasma_beta.md | 10 +++++++--- examples/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/large_tokamak_IN.DAT | 2 +- examples/data/scan_example_file_IN.DAT | 2 +- process/physics.py | 14 +++++++------- source/fortran/constraint_equations.f90 | 12 ++++++------ source/fortran/input.f90 | 6 +++--- source/fortran/physics_variables.f90 | 4 ++-- tests/integration/data/large_tokamak_1_MFILE.DAT | 2 +- tests/integration/data/large_tokamak_2_MFILE.DAT | 2 +- tests/integration/data/large_tokamak_3_MFILE.DAT | 2 +- tests/integration/data/large_tokamak_4_MFILE.DAT | 2 +- tests/integration/data/large_tokamak_IN.DAT | 2 +- tests/integration/data/large_tokamak_MFILE.DAT | 2 +- tests/integration/data/scan_2D_MFILE.DAT | 2 +- tests/integration/ref_dicts.json | 10 +++++----- tests/regression/input_files/large_tokamak.IN.DAT | 2 +- .../input_files/large_tokamak_nof.IN.DAT | 2 +- tests/regression/input_files/st_regression.IN.DAT | 2 +- tests/unit/data/large_tokamak_IN.DAT | 2 +- tests/unit/data/large_tokamak_MFILE.DAT | 2 +- 25 files changed, 49 insertions(+), 45 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md index ee64be30..d6999c50 100644 --- a/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md +++ b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md @@ -13,14 +13,14 @@ constraint equation 24 should be turned on with iteration variable 36 By default, $\beta$ is defined with respect to the total equilibrium B-field [^2]. -| `iculbl` | Description | +| `i_beta_component` | Description | | :-: | - | | 0 (default) | Apply the $\beta$ limit to the total plasma beta (including the contribution from fast ions) | | 1 | Apply the $\beta$ limit to only the thermal component of beta | | 2 | Apply the $\beta$ limit to only the thermal plus neutral beam contributions to beta | | 3 | Apply the $\beta$ limit to the total beta (including the contribution from fast ions), calculated using only the toroidal field | -### Setting the Beta $g$ Coefficient +## Setting the Beta $g$ Coefficient Switch `iprofile` determines how the beta $g$ coefficient `dnbeta` should be calculated. @@ -37,13 +37,17 @@ be calculated. Further details on the calculation of `alphaj` and `rli` is given in [Plasma Current](./plasma_current.md). -### Limiting $\epsilon\beta_p$ +## Limiting $\epsilon\beta_p$ To apply a limit to the value of $\epsilon\beta_p$, where $\epsilon = a/R$ is the inverse aspect ratio and $\beta_p$ is the poloidal $\beta$, constraint equation no. 6 should be turned on with iteration variable no. 8 (`fbeta`). The limiting value of $\epsilon\beta_p$ is be set using input parameter `epbetmax`. +## Key Constraints + + + [^1]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', [^2]: D.J. Ward, 'PROCESS Fast Alpha Pressure', Work File Note F/PL/PJK/PROCESS/CODE/050 diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index ac73645d..44d39f1d 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -1571,7 +1571,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index b27363af..adabaaf8 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -1565,7 +1565,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 422e223a..930a8ebd 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -1565,7 +1565,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 53207efe..9585f9e5 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -1565,7 +1565,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index c2cb109c..ef96c7ef 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -1565,7 +1565,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/examples/data/large_tokamak_IN.DAT b/examples/data/large_tokamak_IN.DAT index d686f0f0..286102c7 100644 --- a/examples/data/large_tokamak_IN.DAT +++ b/examples/data/large_tokamak_IN.DAT @@ -375,7 +375,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/examples/data/scan_example_file_IN.DAT b/examples/data/scan_example_file_IN.DAT index 9d42b647..9689fa6d 100644 --- a/examples/data/scan_example_file_IN.DAT +++ b/examples/data/scan_example_file_IN.DAT @@ -375,7 +375,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/process/physics.py b/process/physics.py index 3c29ce3c..8999922c 100644 --- a/process/physics.py +++ b/process/physics.py @@ -155,13 +155,13 @@ def calculate_beta_limit( This subroutine calculates the beta limit using the algorithm documented in AEA FUS 172. The limit applies to beta defined with respect to the total B-field. - Switch iculbl determines which components of beta to include. + Switch i_beta_component determines which components of beta to include. Notes: - - If iculbl = 0, then the limit is applied to the total beta. - - If iculbl = 1, then the limit is applied to the thermal beta only. - - If iculbl = 2, then the limit is applied to the thermal + neutral beam beta components. - - If iculbl = 3, then the limit is applied to the toroidal beta. + - If i_beta_component = 0, then the limit is applied to the total beta. + - If i_beta_component = 1, then the limit is applied to the thermal beta only. + - If i_beta_component = 2, then the limit is applied to the thermal + neutral beam beta components. + - If i_beta_component = 3, then the limit is applied to the toroidal beta. - The default value for the g coefficient is dnbeta = 3.5. @@ -3574,7 +3574,7 @@ def outplas(self): "OP ", ) - if physics_variables.iculbl == 0: + if physics_variables.i_beta_component == 0: po.ovarrf( self.outfile, "Limit on total beta", @@ -3582,7 +3582,7 @@ def outplas(self): physics_variables.betalim, "OP ", ) - elif physics_variables.iculbl == 1: + elif physics_variables.i_beta_component == 1: po.ovarrf( self.outfile, "Limit on thermal beta", diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index 98dffee5..cc97bdca 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -1259,7 +1259,7 @@ subroutine constraint_eqn_024(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! #=#=# fbetatry, betalim !! and hence also optional here. !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. - !! iculbl : input integer : switch for beta limit scaling (constraint equation 24):
    + !! i_beta_component : input integer : switch for beta limit scaling (constraint equation 24):
      !!
    • = 0 apply limit to total beta; !!
    • = 1 apply limit to thermal beta; !!
    • = 2 apply limit to thermal + neutral beam beta @@ -1274,7 +1274,7 @@ subroutine constraint_eqn_024(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! beta_beam : input real : neutral beam beta component !! bt : input real : toroidal field !! btot : input real : total field - use physics_variables, only: iculbl, betalim, beta, beta_beam, beta_fast_alpha, bt, btot + use physics_variables, only: i_beta_component, betalim, beta, beta_beam, beta_fast_alpha, bt, btot use stellarator_variables, only: istell use constraint_variables, only: fbetatry implicit none @@ -1285,28 +1285,28 @@ subroutine constraint_eqn_024(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=10), intent(out) :: tmp_units ! Include all beta components: relevant for both tokamaks and stellarators - if ((iculbl == 0).or.(istell /= 0)) then + if ((i_beta_component == 0).or.(istell /= 0)) then tmp_cc = 1.0D0 - fbetatry * betalim/beta tmp_con = betalim tmp_err = betalim - beta / fbetatry tmp_symbol = '<' tmp_units = '' ! Here, the beta limit applies to only the thermal component, not the fast alpha or neutral beam parts - else if (iculbl == 1) then + else if (i_beta_component == 1) then tmp_cc = 1.0D0 - fbetatry * betalim/(beta-beta_fast_alpha-beta_beam) tmp_con = betalim tmp_err = betalim - (beta-beta_fast_alpha-beta_beam) / fbetatry tmp_symbol = '<' tmp_units = '' ! Beta limit applies to thermal + neutral beam: components of the total beta, i.e. excludes alphas - else if (iculbl == 2) then + else if (i_beta_component == 2) then tmp_cc = 1.0D0 - fbetatry * betalim/(beta-beta_fast_alpha) tmp_con = betalim * (1.0D0 - tmp_cc) tmp_err = (beta-beta_fast_alpha) * tmp_cc tmp_symbol = '<' tmp_units = '' ! Beta limit applies to toroidal beta - else if (iculbl == 3) then + else if (i_beta_component == 3) then tmp_cc = 1.0D0 - fbetatry * betalim/(beta*(btot/bt)**2) tmp_con = betalim tmp_err = betalim - (beta*(btot/bt)**2) / fbetatry diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 35cdb77b..88ddafe6 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, iculbl, itartpf, ilhthresh, & + rhopedt, cvol, f_deuterium, ffwal, i_beta_component, itartpf, ilhthresh, & fpdivlim, epbetmax, isc, kappa95, aspect, cwrmax, nesep, c_beta, csawth, dene, & ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, dnbeta, & fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, f_tritium, & @@ -623,8 +623,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('i_bootstrap_current') call parse_int_variable('i_bootstrap_current', i_bootstrap_current, 1, 5, & 'Switch for bootstrap scaling') - case ('iculbl') - call parse_int_variable('iculbl', iculbl, 0, 3, & + case ('i_beta_component') + call parse_int_variable('i_beta_component', i_beta_component, 0, 3, & 'Switch for beta limit scaling') case ('i_plasma_current') call parse_int_variable('i_plasma_current', i_plasma_current, 1, 9, & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 82793fa2..ceee3cb7 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -254,7 +254,7 @@ module physics_variables !! - =4 for Sauter et al scaling !! - =5 for Sakai et al scaling - integer :: iculbl + integer :: i_beta_component !! switch for beta limit scaling (`constraint equation 24`) !! !! - =0 apply limit to total beta @@ -973,7 +973,7 @@ subroutine init_physics_variables hfact = 1.0D0 taumax = 10.0D0 i_bootstrap_current = 3 - iculbl = 0 + i_beta_component = 0 i_plasma_current = 4 i_diamagnetic_current = 0 idensl = 7 diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 490056a5..e71ce3e2 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -1564,7 +1564,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling 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 de5ea33c..42d9e2d1 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -1565,7 +1565,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling 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 7cbd8d7d..aef8c017 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -1565,7 +1565,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling 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 0696cb91..5396786f 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -1565,7 +1565,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/tests/integration/data/large_tokamak_IN.DAT b/tests/integration/data/large_tokamak_IN.DAT index d686f0f0..286102c7 100644 --- a/tests/integration/data/large_tokamak_IN.DAT +++ b/tests/integration/data/large_tokamak_IN.DAT @@ -375,7 +375,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 340bfe15..f9d9e901 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -1566,7 +1566,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 3c952ebb..64dd70c7 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -17851,7 +17851,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 2a0e97d3..8c93b57e 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -2428,7 +2428,7 @@ 0.0 ], "icode": 0.0, - "iculbl": 0.0, + "i_beta_component": 0.0, "i_plasma_current": 4.0, "idensl": 7.0, "i_diamagnetic_current": 0.0, @@ -9808,7 +9808,7 @@ "icase": "power plant type", "icc": "", "icode": "", - "iculbl": "switch for beta limit scaling (`constraint equation 24`)\n
        \n
      • =0 apply limit to total beta
      • \n
      • =1 apply limit to thermal beta
      • \n
      • =2 apply limit to thermal + neutral beam beta
      • \n
      • =3 apply limit to toroidal beta
      • \n
      ", + "i_beta_component": "switch for beta limit scaling (`constraint equation 24`)\n
        \n
      • =0 apply limit to total beta
      • \n
      • =1 apply limit to thermal beta
      • \n
      • =2 apply limit to thermal + neutral beam beta
      • \n
      • =3 apply limit to toroidal beta
      • \n
      ", "i_plasma_current": "switch for plasma current scaling to use\n
        \n
      • =1 Peng analytic fit
      • \n
      • =2 Peng double null divertor scaling (ST)
      • \n
      • =3 simple ITER scaling (k = 2.2, d = 0.6)
      • \n
      • =4 later ITER scaling, a la Uckan
      • \n
      • =5 Todd empirical scaling I
      • \n
      • =6 Todd empirical scaling II
      • \n
      • =7 Connor-Hastie model
      • \n
      • =8 Sauter scaling allowing negative triangularity
      • \n
      • =9 FIESTA ST fit
      • \n
      ", "idensl": "switch for density limit to enforce (`constraint equation 5`)\n
        \n
      • =1 old ASDEX
      • \n
      • =2 Borrass model for ITER (I)
      • \n
      • =3 Borrass model for ITER (II)
      • \n
      • =4 JET edge radiation
      • \n
      • =5 JET simplified
      • \n
      • =6 Hugill-Murakami Mq limit
      • \n
      • =7 Greenwald limit
      • \n
      ", "i_diamagnetic_current": "switch for diamagnetic current scaling\n
        \n
      • =0 Do not calculate
      • \n
      • =1 Use original TART scaling
      • \n
      • =2 Use SCENE scaling
      • \n
      ", @@ -13322,7 +13322,7 @@ "lb": 1, "ub": 4 }, - "iculbl": { + "i_beta_component": { "lb": 0, "ub": 3 }, @@ -19114,7 +19114,7 @@ "hfact", "taumax", "i_bootstrap_current", - "iculbl", + "i_beta_component", "i_plasma_current", "i_diamagnetic_current", "idensl", @@ -20441,7 +20441,7 @@ "iblnkith": "int_variable", "i_bootstrap_current": "int_variable", "icc": "int_array", - "iculbl": "int_variable", + "i_beta_component": "int_variable", "i_plasma_current": "int_variable", "idensl": "int_variable", "i_diamagnetic_current": "int_variable", diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT index c5282122..cce919c5 100644 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ b/tests/regression/input_files/large_tokamak.IN.DAT @@ -375,7 +375,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index 7b040218..a860358b 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -357,7 +357,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index ffb4ee1b..2d82c136 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -325,7 +325,7 @@ boundu(36) = 1.0 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -iculbl = 3 +i_beta_component = 3 * DESCRIPTION: Switch for Beta Limit Scaling (icc=24) (3: Apply Limit to Toroidal) * JUSTIFICATION: Total beta is used to agree with literature limit * REFERENCE: Ono & Kaita (2015), Physics of Plasmas, 22, 040501 diff --git a/tests/unit/data/large_tokamak_IN.DAT b/tests/unit/data/large_tokamak_IN.DAT index cac0303b..bee77c51 100644 --- a/tests/unit/data/large_tokamak_IN.DAT +++ b/tests/unit/data/large_tokamak_IN.DAT @@ -375,7 +375,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index f991f86e..fa9b141a 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -1566,7 +1566,7 @@ gamma = 0.3 i_bootstrap_current = 4 * Switch for beta limit scaling -iculbl = 1 +i_beta_component = 1 * Switch for plasma current scaling i_plasma_current = 4 From 605b29f6d1de10ccbcb00ff7158a3c1564e6b02e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 16:36:39 +0000 Subject: [PATCH 05/20] Rename betalim to beta_limit_upper for clarity and consistency across the codebase --- process/physics.py | 16 +++++------ process/stellarator.py | 2 +- source/fortran/constraint_equations.f90 | 28 +++++++++---------- source/fortran/input.f90 | 6 ++-- source/fortran/physics_variables.f90 | 6 ++-- source/fortran/scan.f90 | 4 +-- tests/integration/ref_dicts.json | 10 +++---- .../input_files/st_regression.IN.DAT | 2 +- .../regression/input_files/stellarator.IN.DAT | 2 +- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/process/physics.py b/process/physics.py index 8999922c..782c54c3 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2220,8 +2220,8 @@ def physics(self): (physics_variables.c_beta / Fp) * (12.5e0 - 3.5e0 * Fp) ) - # calculate_beta_limit() returns the betalim for beta - physics_variables.betalim = calculate_beta_limit( + # calculate_beta_limit() returns the beta_limit_upper for beta + physics_variables.beta_limit_upper = calculate_beta_limit( physics_variables.bt, physics_variables.dnbeta, physics_variables.plasma_current, @@ -3578,24 +3578,24 @@ def outplas(self): po.ovarrf( self.outfile, "Limit on total beta", - "(betalim)", - physics_variables.betalim, + "(beta_limit_upper)", + physics_variables.beta_limit_upper, "OP ", ) elif physics_variables.i_beta_component == 1: po.ovarrf( self.outfile, "Limit on thermal beta", - "(betalim)", - physics_variables.betalim, + "(beta_limit_upper)", + physics_variables.beta_limit_upper, "OP ", ) else: po.ovarrf( self.outfile, "Limit on thermal + NB beta", - "(betalim)", - physics_variables.betalim, + "(beta_limit_upper)", + physics_variables.beta_limit_upper, "OP ", ) diff --git a/process/stellarator.py b/process/stellarator.py index 7d1a7d75..dbfaeb8c 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -4275,7 +4275,7 @@ def stphys(self, output): ) # Calculate physics_variables.beta limit. Does nothing atm so commented out - # call stblim(physics_variables.betalim) + # call stblim(physics_variables.beta_limit_upper) # Calculate the neoclassical sanity check with PROCESS parameters ( diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index cc97bdca..c31b6cf0 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -1256,7 +1256,7 @@ subroutine constraint_eqn_024(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! residual error in physical units; output string; units string !! Equation for beta upper limit !! #=# physics - !! #=#=# fbetatry, betalim + !! #=#=# fbetatry, beta_limit_upper !! and hence also optional here. !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! i_beta_component : input integer : switch for beta limit scaling (constraint equation 24):
        @@ -1268,13 +1268,13 @@ subroutine constraint_eqn_024(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !!
      • = 0 use tokamak model; !!
      • = 1 use stellarator model
      !! fbetatry : input real : f-value for beta limit - !! betalim : input real : allowable beta + !! beta_limit_upper : input real : allowable beta !! beta : input real : total plasma beta (calculated if ipedestal =3) !! beta_fast_alpha : input real : fast alpha beta component !! beta_beam : input real : neutral beam beta component !! bt : input real : toroidal field !! btot : input real : total field - use physics_variables, only: i_beta_component, betalim, beta, beta_beam, beta_fast_alpha, bt, btot + use physics_variables, only: i_beta_component, beta_limit_upper, beta, beta_beam, beta_fast_alpha, bt, btot use stellarator_variables, only: istell use constraint_variables, only: fbetatry implicit none @@ -1286,30 +1286,30 @@ subroutine constraint_eqn_024(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! Include all beta components: relevant for both tokamaks and stellarators if ((i_beta_component == 0).or.(istell /= 0)) then - tmp_cc = 1.0D0 - fbetatry * betalim/beta - tmp_con = betalim - tmp_err = betalim - beta / fbetatry + tmp_cc = 1.0D0 - fbetatry * beta_limit_upper/beta + tmp_con = beta_limit_upper + tmp_err = beta_limit_upper - beta / fbetatry tmp_symbol = '<' tmp_units = '' ! Here, the beta limit applies to only the thermal component, not the fast alpha or neutral beam parts else if (i_beta_component == 1) then - tmp_cc = 1.0D0 - fbetatry * betalim/(beta-beta_fast_alpha-beta_beam) - tmp_con = betalim - tmp_err = betalim - (beta-beta_fast_alpha-beta_beam) / fbetatry + tmp_cc = 1.0D0 - fbetatry * beta_limit_upper/(beta-beta_fast_alpha-beta_beam) + tmp_con = beta_limit_upper + tmp_err = beta_limit_upper - (beta-beta_fast_alpha-beta_beam) / fbetatry tmp_symbol = '<' tmp_units = '' ! Beta limit applies to thermal + neutral beam: components of the total beta, i.e. excludes alphas else if (i_beta_component == 2) then - tmp_cc = 1.0D0 - fbetatry * betalim/(beta-beta_fast_alpha) - tmp_con = betalim * (1.0D0 - tmp_cc) + tmp_cc = 1.0D0 - fbetatry * beta_limit_upper/(beta-beta_fast_alpha) + tmp_con = beta_limit_upper * (1.0D0 - tmp_cc) tmp_err = (beta-beta_fast_alpha) * tmp_cc tmp_symbol = '<' tmp_units = '' ! Beta limit applies to toroidal beta else if (i_beta_component == 3) then - tmp_cc = 1.0D0 - fbetatry * betalim/(beta*(btot/bt)**2) - tmp_con = betalim - tmp_err = betalim - (beta*(btot/bt)**2) / fbetatry + tmp_cc = 1.0D0 - fbetatry * beta_limit_upper/(beta*(btot/bt)**2) + tmp_con = beta_limit_upper + tmp_err = beta_limit_upper - (beta*(btot/bt)**2) / fbetatry tmp_symbol = '<' tmp_units = '' end if diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 88ddafe6..c7258460 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, idensl, bt, iscrp, ipnlaws, betalim, betalim_lower, & + tauratio, idensl, bt, iscrp, ipnlaws, beta_limit_upper, betalim_lower, & 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 @@ -530,8 +530,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('beta') call parse_real_variable('beta', beta, 0.0D0, 1.0D0, & 'Plasma beta') - case ('betalim') - call parse_real_variable('betalim', betalim, 0.0D0, 1.0D0, & + case ('beta_limit_upper') + call parse_real_variable('beta_limit_upper', beta_limit_upper, 0.0D0, 1.0D0, & 'Plasma beta upper limit') case ('betalim_lower') call parse_real_variable('betalim_lower', betalim_lower, 0.0D0, 1.0D0, & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index ceee3cb7..94eea679 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -56,8 +56,8 @@ module physics_variables real(dp) :: beta_fast_alpha !! fast alpha beta component - real(dp) :: betalim - !! allowable beta + real(dp) :: beta_limit_upper + !! Max allowable beta real(dp) :: betalim_lower !! allowable lower beta @@ -914,7 +914,7 @@ subroutine init_physics_variables beamfus0 = 1.0D0 beta = 0.042D0 beta_fast_alpha = 0.0D0 - betalim = 0.0D0 + beta_limit_upper = 0.0D0 betalim_lower = 0.0D0 beta_beam = 0.0D0 betap = 0.0D0 diff --git a/source/fortran/scan.f90 b/source/fortran/scan.f90 index 66829d01..d2286563 100644 --- a/source/fortran/scan.f90 +++ b/source/fortran/scan.f90 @@ -197,7 +197,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) use fwbs_variables, only: tpeak use physics_variables, only: q, aspect, pradmw, dene, fusion_power, btot, tesep, & pdivt, ralpne, ten, betap, hfac, teped, alpha_power_beams, qlim, rmajor, wallmw, & - beta, betalim, bt, plasma_current + beta, beta_limit_upper, bt, plasma_current use global_variables, only: verbose, maxcal, runtitle, run_tests use constants, only: nout implicit none @@ -229,7 +229,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) outvar(15,iscan) = q outvar(16,iscan) = qlim outvar(17,iscan) = beta - outvar(18,iscan) = betalim + outvar(18,iscan) = beta_limit_upper outvar(19,iscan) = betap / aspect outvar(20,iscan) = ten/10.0D0 outvar(21,iscan) = dene/1.0D20 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 8c93b57e..fc6f8237 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -297,7 +297,7 @@ "beta_mcdonald": 0.0, "beta_fast_alpha": 0.0, "betai": 1.0, - "betalim": 0.0, + "beta_limit_upper": 0.0, "betalim_lower": 0.0, "beta_beam": 0.0, "betao": 1.0, @@ -8864,7 +8864,7 @@ "beta_mcdonald": "", "beta_fast_alpha": "fast alpha beta component", "betai": "poloidal plane angle between divertor plate and leg, inboard (rad)", - "betalim": "allowable beta", + "beta_limit_upper": "allowable beta", "betalim_lower": "allowable lower beta", "beta_beam": "neutral beam beta component", "betao": "poloidal plane angle between divertor plate and leg, outboard (rad)", @@ -11666,7 +11666,7 @@ "lb": 0.0, "ub": 1.5707 }, - "betalim": { + "beta_limit_upper": { "lb": 0.0, "ub": 1.0 }, @@ -19054,7 +19054,7 @@ "beamfus0", "beta", "beta_fast_alpha", - "betalim", + "beta_limit_upper", "betalim_lower", "beta_beam", "betap", @@ -20014,7 +20014,7 @@ "beamwd": "real_variable", "beta": "real_variable", "betai": "real_variable", - "betalim": "real_variable", + "beta_limit_upper": "real_variable", "betalim_lower": "real_variable", "betao": "real_variable", "betbm0": "real_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 2d82c136..e2a65f22 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -305,7 +305,7 @@ icc = 24 * JUSTIFICATION: Limit for plasma stability * VARIABLES: beta calculated in-situ -*betalim +*beta_limit_upper * DESCRIPTION: Plasma beta upper limit * JUSTIFICATION: Turned off, not in use. icc=24. Allow to be calculated in-situ diff --git a/tests/regression/input_files/stellarator.IN.DAT b/tests/regression/input_files/stellarator.IN.DAT index abdfed6d..6ae8c069 100644 --- a/tests/regression/input_files/stellarator.IN.DAT +++ b/tests/regression/input_files/stellarator.IN.DAT @@ -108,7 +108,7 @@ fptfnuc = 1 *f-value neutron heating *----------------Physics Variables-----------------* -betalim = 0.06 * upper beta limit +beta_limit_upper = 0.06 * upper beta limit betalim_lower = 0.01 * lower beta limit bigqmin = 1 * Minimal BigQ From 7906aa9d557a1034e29409f1af10ecb192391084 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 16:41:48 +0000 Subject: [PATCH 06/20] Rename betalim_lower to beta_limit_lower for consistency and clarity across the codebase --- source/fortran/constraint_equations.f90 | 12 ++++++------ source/fortran/input.f90 | 6 +++--- source/fortran/numerics.f90 | 2 +- source/fortran/physics_variables.f90 | 4 ++-- tests/integration/ref_dicts.json | 12 ++++++------ tests/regression/input_files/st_regression.IN.DAT | 4 ++-- tests/regression/input_files/stellarator.IN.DAT | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index c31b6cf0..fc20d9c6 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -3130,16 +3130,16 @@ subroutine constraint_eqn_084(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! author: J Lion, IPP Greifswald !! args : output structure : residual error; constraint value; !! residual error in physical units; output string; units string - !! (beta-beta_fast_alpha) > betalim_lower + !! (beta-beta_fast_alpha) > beta_limit_lower !! #=# physics !! #=#=# beta_fast_alpha, beta, fbetatry_lower !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. - !! fbetatry_lower : input real : f-value for constraint beta-beta_fast_alpha > betalim_lower - !! betalim_lower : input real : Lower limit for beta + !! fbetatry_lower : input real : f-value for constraint beta-beta_fast_alpha > beta_limit_lower + !! beta_limit_lower : input real : Lower limit for beta !! beta : input real : plasma beta !! beta_fast_alpha : input real : Alpha particle beta - use physics_variables, only: betalim_lower, beta, beta_fast_alpha + use physics_variables, only: beta_limit_lower, beta, beta_fast_alpha use constraint_variables, only: fbetatry_lower implicit none real(dp), intent(out) :: tmp_cc @@ -3149,8 +3149,8 @@ subroutine constraint_eqn_084(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=10), intent(out) :: tmp_units - tmp_cc = 1.0D0 - fbetatry_lower * (beta-beta_fast_alpha)/betalim_lower - tmp_con = betalim_lower * (1.0D0 - tmp_cc) + tmp_cc = 1.0D0 - fbetatry_lower * (beta-beta_fast_alpha)/beta_limit_lower + tmp_con = beta_limit_lower * (1.0D0 - tmp_cc) tmp_err = (beta-beta_fast_alpha) * tmp_cc tmp_symbol = '>' tmp_units = '' diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index c7258460..d570d240 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, idensl, bt, iscrp, ipnlaws, beta_limit_upper, betalim_lower, & + tauratio, idensl, bt, iscrp, ipnlaws, beta_limit_upper, beta_limit_lower, & 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 @@ -533,8 +533,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('beta_limit_upper') call parse_real_variable('beta_limit_upper', beta_limit_upper, 0.0D0, 1.0D0, & 'Plasma beta upper limit') - case ('betalim_lower') - call parse_real_variable('betalim_lower', betalim_lower, 0.0D0, 1.0D0, & + case ('beta_limit_lower') + call parse_real_variable('beta_limit_lower', beta_limit_lower, 0.0D0, 1.0D0, & 'Plasma beta lower limit') case ('betbm0') call parse_real_variable('betbm0', betbm0, 0.0D0, 10.0D0, & diff --git a/source/fortran/numerics.f90 b/source/fortran/numerics.f90 index ce82d81d..9e154a22 100755 --- a/source/fortran/numerics.f90 +++ b/source/fortran/numerics.f90 @@ -538,7 +538,7 @@ subroutine init_numerics() 'ne0 > neped ', & 'toroidalgap > tftort ', & 'available_space > required_space ', & - 'beta > betalim_lower ', & + 'beta > beta_limit_lower ', & 'CP lifetime ', & 'TFC turn dimension ', & 'Cryogenic plant power ', & diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 94eea679..4f2ba442 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -59,7 +59,7 @@ module physics_variables real(dp) :: beta_limit_upper !! Max allowable beta - real(dp) :: betalim_lower + real(dp) :: beta_limit_lower !! allowable lower beta real(dp) :: beta_beam @@ -915,7 +915,7 @@ subroutine init_physics_variables beta = 0.042D0 beta_fast_alpha = 0.0D0 beta_limit_upper = 0.0D0 - betalim_lower = 0.0D0 + beta_limit_lower = 0.0D0 beta_beam = 0.0D0 betap = 0.0D0 normalised_total_beta = 0.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index fc6f8237..08acf3cf 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -298,7 +298,7 @@ "beta_fast_alpha": 0.0, "betai": 1.0, "beta_limit_upper": 0.0, - "betalim_lower": 0.0, + "beta_limit_lower": 0.0, "beta_beam": 0.0, "betao": 1.0, "betap": 0.0, @@ -2973,7 +2973,7 @@ "ne0>neped", "toroidalgap>tftort", "available_space>required_space", - "beta>betalim_lower", + "beta>beta_limit_lower", "CPlifetime", "TFCturndimension", "Cryogenicplantpower", @@ -8865,7 +8865,7 @@ "beta_fast_alpha": "fast alpha beta component", "betai": "poloidal plane angle between divertor plate and leg, inboard (rad)", "beta_limit_upper": "allowable beta", - "betalim_lower": "allowable lower beta", + "beta_limit_lower": "allowable lower beta", "beta_beam": "neutral beam beta component", "betao": "poloidal plane angle between divertor plate and leg, outboard (rad)", "betap": "poloidal beta", @@ -11670,7 +11670,7 @@ "lb": 0.0, "ub": 1.0 }, - "betalim_lower": { + "beta_limit_lower": { "lb": 0.0, "ub": 1.0 }, @@ -19055,7 +19055,7 @@ "beta", "beta_fast_alpha", "beta_limit_upper", - "betalim_lower", + "beta_limit_lower", "beta_beam", "betap", "normalised_total_beta", @@ -20015,7 +20015,7 @@ "beta": "real_variable", "betai": "real_variable", "beta_limit_upper": "real_variable", - "betalim_lower": "real_variable", + "beta_limit_lower": "real_variable", "betao": "real_variable", "betbm0": "real_variable", "betpmx": "real_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index e2a65f22..22060fb6 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -352,9 +352,9 @@ dnbeta = 5.0 *icc = 84 * DESCRIPTION: Constraint equation for lower limit of beta * JUSTIFICATION: Turned off, do not require a beta lower limit -* VARIABLES: betalim_lower (Lower limit for beta). beta,betaft calculated in-situ +* VARIABLES: beta_limit_lower (Lower limit for beta). beta,betaft calculated in-situ -*betalim_lower = +*beta_limit_lower = * DESCRIPTION: Plasma beta lower limit * JUSTIFICATION: Turned off, not in use, Used with icc=84 to enforce beta limit diff --git a/tests/regression/input_files/stellarator.IN.DAT b/tests/regression/input_files/stellarator.IN.DAT index 6ae8c069..752ee7ce 100644 --- a/tests/regression/input_files/stellarator.IN.DAT +++ b/tests/regression/input_files/stellarator.IN.DAT @@ -109,7 +109,7 @@ fptfnuc = 1 *f-value neutron heating *----------------Physics Variables-----------------* beta_limit_upper = 0.06 * upper beta limit -betalim_lower = 0.01 * lower beta limit +beta_limit_lower = 0.01 * lower beta limit bigqmin = 1 * Minimal BigQ powfmax = 500. *Maximal Fusion Power From e5ef4fd26001109b81e7c987fc8fdf6e94407b0b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 17:14:27 +0000 Subject: [PATCH 07/20] Initial input of beta type constraint equations to docs --- .../physics-models/plasma_beta/plasma_beta.md | 34 +++++++++++++++++-- examples/data/scan_MFILE.DAT | 2 +- .../data/large_tokamak_once_through.IN.DAT | 2 +- tests/integration/data/ref_IN.DAT | 2 +- tests/integration/data/scan_MFILE.DAT | 2 +- .../data/uncertainties_nonopt_ref_IN.DAT | 2 +- .../integration/data/uncertainties_ref_IN.DAT | 2 +- .../large_tokamak_once_through.IN.DAT | 2 +- 8 files changed, 39 insertions(+), 9 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md index d6999c50..9f5eea1f 100644 --- a/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md +++ b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md @@ -37,16 +37,46 @@ be calculated. Further details on the calculation of `alphaj` and `rli` is given in [Plasma Current](./plasma_current.md). -## Limiting $\epsilon\beta_p$ +---------------------- + +## Key Constraints + +### Beta consistency + +This constraint can be activated by stating `icc = 1` in the input file. + +Relationship between beta, temperature (keV) and density + +**It is highly recommended to always have this constraint on as it is a global consistency checker** + +---------------- + +### Poloidal beta and inverse aspect upper limit + +This constraint can be activated by stating `icc = 6` in the input file. To apply a limit to the value of $\epsilon\beta_p$, where $\epsilon = a/R$ is the inverse aspect ratio and $\beta_p$ is the poloidal $\beta$, constraint equation no. 6 should be turned on with iteration variable no. 8 (`fbeta`). The limiting value of $\epsilon\beta_p$ is be set using input parameter `epbetmax`. -## Key Constraints +-------------------- + +### Beta upper limit + +This constraint can be activated by stating `icc = 24` in the input file. + +-------------------- + +### Poloidal upper limit + +This constraint can be activated by stating `icc = 48` in the input file. + +------------------- +### Beta lower limit +This constraint can be activated by stating `icc = 84` in the input file. [^1]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 85850a9f..8e6eb2e6 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -9239,7 +9239,7 @@ 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) i_bootstrap_current = 4 * Switch for bootstrap current scaling; -iculbl = 1 * Switch for beta limit scaling (constraint equation 24); +i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24); i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; diff --git a/tests/integration/data/large_tokamak_once_through.IN.DAT b/tests/integration/data/large_tokamak_once_through.IN.DAT index 3d379dcd..739e74c4 100644 --- a/tests/integration/data/large_tokamak_once_through.IN.DAT +++ b/tests/integration/data/large_tokamak_once_through.IN.DAT @@ -325,7 +325,7 @@ fvsbrnni = 0.4242184436680697 * fraction of the plasma current produced by non-i gamma = 0.3 * Ejima coefficient for resistive startup V-s formula hfact = 1.185971818905028 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); i_bootstrap_current = 4 * switch for bootstrap current scaling -iculbl = 1 * switch for beta limit scaling (`constraint equation 24`) +i_beta_component = 1 * switch for beta limit scaling (`constraint equation 24`) i_plasma_current = 4 * switch for plasma current scaling to use idensl = 7 * switch for density limit to enforce (`constraint equation 5`) ifalphap = 1 * switch for fast alpha pressure calculation diff --git a/tests/integration/data/ref_IN.DAT b/tests/integration/data/ref_IN.DAT index a6c75e36..a5510703 100644 --- a/tests/integration/data/ref_IN.DAT +++ b/tests/integration/data/ref_IN.DAT @@ -260,7 +260,7 @@ 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) i_bootstrap_current = 4 * Switch for bootstrap current scaling; -iculbl = 1 * Switch for beta limit scaling (constraint equation 24); +i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24); i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 0bf34c26..fa1f0bbd 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -9239,7 +9239,7 @@ 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) i_bootstrap_current = 4 * Switch for bootstrap current scaling; -iculbl = 1 * Switch for beta limit scaling (constraint equation 24); +i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24); i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; diff --git a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT index 346e31e0..b5f1e668 100644 --- a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT +++ b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT @@ -260,7 +260,7 @@ 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) i_bootstrap_current = 4 * Switch for bootstrap current scaling; -iculbl = 1 * Switch for beta limit scaling (constraint equation 24); +i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24); i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; diff --git a/tests/integration/data/uncertainties_ref_IN.DAT b/tests/integration/data/uncertainties_ref_IN.DAT index 6acaad0d..353a89a3 100644 --- a/tests/integration/data/uncertainties_ref_IN.DAT +++ b/tests/integration/data/uncertainties_ref_IN.DAT @@ -260,7 +260,7 @@ 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) i_bootstrap_current = 4 * Switch for bootstrap current scaling; -iculbl = 1 * Switch for beta limit scaling (constraint equation 24); +i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24); i_plasma_current = 4 * Switch for plasma current scaling to use; idensl = 7 * Switch for density limit to enforce (constraint equation 5); ifalphap = 1 * Switch for fast alpha pressure calculation; 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 27f3598b..9561df23 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -325,7 +325,7 @@ fvsbrnni = 0.4242184436680697 * fraction of the plasma current produced by non-i gamma = 0.3 * Ejima coefficient for resistive startup V-s formula hfact = 1.185971818905028 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); i_bootstrap_current = 4 * switch for bootstrap current scaling -iculbl = 1 * switch for beta limit scaling (`constraint equation 24`) +i_beta_component = 1 * switch for beta limit scaling (`constraint equation 24`) i_plasma_current = 4 * switch for plasma current scaling to use idensl = 7 * switch for density limit to enforce (`constraint equation 5`) ifalphap = 1 * switch for fast alpha pressure calculation From d0b8d15045f10e0229c35a9d717b8204a529e12e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 17:17:25 +0000 Subject: [PATCH 08/20] Rename betpmx to beta_poloidal_max for clarity and consistency across the codebase --- source/fortran/constraint_equations.f90 | 10 +++++----- source/fortran/constraint_variables.f90 | 4 ++-- source/fortran/input.f90 | 6 +++--- tests/integration/ref_dicts.json | 10 +++++----- tests/regression/input_files/st_regression.IN.DAT | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index fc20d9c6..afddd1b3 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -2079,13 +2079,13 @@ subroutine constraint_eqn_048(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! residual error in physical units; output string; units string !! Equation for poloidal beta upper limit !! #=# physics - !! #=#=# fbetap, betpmx + !! #=#=# fbetap, beta_poloidal_max !! and hence also optional here. !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! fbetap : input real : rf-value for poloidal beta - !! betpmx : input real : maximum poloidal beta + !! beta_poloidal_max : input real : maximum poloidal beta !! betap : input real : poloidal beta - use constraint_variables, only: fbetap, betpmx + use constraint_variables, only: fbetap, beta_poloidal_max use physics_variables, only: betap implicit none real(dp), intent(out) :: tmp_cc @@ -2094,8 +2094,8 @@ subroutine constraint_eqn_048(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=1), intent(out) :: tmp_symbol character(len=10), intent(out) :: tmp_units - tmp_cc = 1.0D0 - fbetap * betpmx/betap - tmp_con = betpmx * (1.0D0 - tmp_cc) + tmp_cc = 1.0D0 - fbetap * beta_poloidal_max/betap + tmp_con = beta_poloidal_max * (1.0D0 - tmp_cc) tmp_err = betap * tmp_cc tmp_symbol = '<' tmp_units = '' diff --git a/source/fortran/constraint_variables.f90 b/source/fortran/constraint_variables.f90 index de00506c..46a21453 100644 --- a/source/fortran/constraint_variables.f90 +++ b/source/fortran/constraint_variables.f90 @@ -18,7 +18,7 @@ module constraint_variables real(dp) :: auxmin !! minimum auxiliary power (MW) (`constraint equation 40`) - real(dp) :: betpmx + real(dp) :: beta_poloidal_max !! maximum poloidal beta (`constraint equation 48`) real(dp) :: bigqmin @@ -313,7 +313,7 @@ subroutine init_constraint_variables implicit none auxmin = 0.1D0 - betpmx = 0.19D0 + beta_poloidal_max = 0.19D0 bigqmin = 10.0D0 bmxlim = 12.0D0 fauxmn = 1.0D0 diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index d570d240..e3c8b04c 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -229,7 +229,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) warm_shop_h, water_buildings_l, water_buildings_w, water_buildings_h, & workshop_l, workshop_w, workshop_h use constraint_variables, only: flhthresh, fpeakb, fpsep, fdivcol, ftcycl, & - betpmx, fpsepbqar, ftmargtf, fradwall, fptfnuc, fnesep, fportsz, tbrmin, & + 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, & @@ -777,8 +777,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('auxmin') call parse_real_variable('auxmin', auxmin, 0.01D0, 100.0D0, & 'Minimum auxiliary power (MW)') - case ('betpmx') - call parse_real_variable('betpmx', betpmx, 0.01D0, 2.0D0, & + case ('beta_poloidal_max') + call parse_real_variable('beta_poloidal_max', beta_poloidal_max, 0.01D0, 2.0D0, & 'Maximum poloidal beta') case ('bigqmin') call parse_real_variable('bigqmin', bigqmin, 0.01D0, 100.0D0, & diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 08acf3cf..a09289d5 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -303,7 +303,7 @@ "betao": 1.0, "betap": 0.0, "betbm0": 1.5, - "betpmx": 0.19, + "beta_poloidal_max": 0.19, "bfw": 0.0, "bigq": 0.0, "bigqmin": 10.0, @@ -8870,7 +8870,7 @@ "betao": "poloidal plane angle between divertor plate and leg, outboard (rad)", "betap": "poloidal beta", "betbm0": "leading coefficient for NB beta fraction", - "betpmx": "maximum poloidal beta (`constraint equation 48`)", + "beta_poloidal_max": "maximum poloidal beta (`constraint equation 48`)", "bfw": "outer radius of each first wall structural tube (m) (0.5 * average of fwith and fwoth)", "bigq": "Fusion gain; P_fusion / (P_injection + P_ohmic)", "bigqmin": "minimum fusion gain Q (`constraint equation 28`)", @@ -11682,7 +11682,7 @@ "lb": 0.0, "ub": 10.0 }, - "betpmx": { + "beta_poloidal_max": { "lb": 0.01, "ub": 2.0 }, @@ -17379,7 +17379,7 @@ ], "constraint_variables": [ "auxmin", - "betpmx", + "beta_poloidal_max", "bigqmin", "bmxlim", "fauxmn", @@ -20018,7 +20018,7 @@ "beta_limit_lower": "real_variable", "betao": "real_variable", "betbm0": "real_variable", - "betpmx": "real_variable", + "beta_poloidal_max": "real_variable", "bigqmin": "real_variable", "bioshld_thk": "real_variable", "blbmith": "real_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 22060fb6..1ff21bc5 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -363,9 +363,9 @@ dnbeta = 5.0 *icc = 48 * DESCRIPTION: Constraint equation for poloidal beta upper limit * JUSTIFICATION: Turned off, do not care about poloidal beta -* VARIABLES: betpmx, fbetap. betap calculated in-situ +* VARIABLES: beta_poloidal_max, fbetap. betap calculated in-situ -*betpmx = +*beta_poloidal_max = * DESCRIPTION: Maximum poloidal beta (`constraint equation 48`) (default = 0.19) * JUSTIFICATION: Not set, not using icc = 48 From 5eedafc91855735843cc32cf3a93459c77b91f3b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 17:23:31 +0000 Subject: [PATCH 09/20] Rename fbetap to fbeta_poloidal for clarity and consistency across the codebase --- source/fortran/constraint_equations.f90 | 8 +++---- source/fortran/constraint_variables.f90 | 4 ++-- source/fortran/input.f90 | 6 ++--- source/fortran/iteration_variables.f90 | 12 +++++----- source/fortran/numerics.f90 | 2 +- tests/integration/ref_dicts.json | 22 +++++++++---------- .../input_files/st_regression.IN.DAT | 2 +- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index afddd1b3..a5288811 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -2079,13 +2079,13 @@ subroutine constraint_eqn_048(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! residual error in physical units; output string; units string !! Equation for poloidal beta upper limit !! #=# physics - !! #=#=# fbetap, beta_poloidal_max + !! #=#=# fbeta_poloidal, beta_poloidal_max !! and hence also optional here. !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. - !! fbetap : input real : rf-value for poloidal beta + !! fbeta_poloidal : input real : rf-value for poloidal beta !! beta_poloidal_max : input real : maximum poloidal beta !! betap : input real : poloidal beta - use constraint_variables, only: fbetap, beta_poloidal_max + use constraint_variables, only: fbeta_poloidal, beta_poloidal_max use physics_variables, only: betap implicit none real(dp), intent(out) :: tmp_cc @@ -2094,7 +2094,7 @@ subroutine constraint_eqn_048(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=1), intent(out) :: tmp_symbol character(len=10), intent(out) :: tmp_units - tmp_cc = 1.0D0 - fbetap * beta_poloidal_max/betap + tmp_cc = 1.0D0 - fbeta_poloidal * beta_poloidal_max/betap tmp_con = beta_poloidal_max * (1.0D0 - tmp_cc) tmp_err = betap * tmp_cc tmp_symbol = '<' diff --git a/source/fortran/constraint_variables.f90 b/source/fortran/constraint_variables.f90 index 46a21453..3702b24a 100644 --- a/source/fortran/constraint_variables.f90 +++ b/source/fortran/constraint_variables.f90 @@ -33,7 +33,7 @@ module constraint_variables real(dp) :: fbeta !! f-value for epsilon beta-poloidal (`constraint equation 6`, `iteration variable 8`) - real(dp) :: fbetap + real(dp) :: fbeta_poloidal !! f-value for poloidal beta (`constraint equation 48`, `iteration variable 79`) real(dp) :: fbetatry @@ -318,7 +318,7 @@ subroutine init_constraint_variables bmxlim = 12.0D0 fauxmn = 1.0D0 fbeta = 1.0D0 - fbetap = 1.0D0 + fbeta_poloidal = 1.0D0 fbetatry = 1.0D0 fbetatry_lower = 1.0D0 fcpttf = 1.0D0 diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index e3c8b04c..a57c3d79 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -237,7 +237,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) ffuspow, fpsepr, ptfnucmax, fvdump, pdivtlim, ftaulimit, nbshinefmax, & fcqt, fzeffmax, fstrcase, fhldiv, foh_stress, fwalld, gammax, fjprot, & ftohs, tcycmn, auxmin, zeffmax, peakfactrad, fdtmp, fpoloidalpower, & - fnbshinef, freinke, fvvhe, fqval, fq, fmaxvvstress, fbetap, fbeta, fjohc, & + fnbshinef, freinke, fvvhe, fqval, fq, fmaxvvstress, fbeta_poloidal, fbeta, fjohc, & fflutf, bmxlim, tbrnmn, fbetatry_lower, fecrh_ignition, fstr_wp, fncycle use cost_variables, only: ucich, uctfsw, dintrt, ucblbe, uubop, dtlife, & cost_factor_vv, cfind, uccry, fcap0cp, uccase, uuves, cconshtf, conf_mag, & @@ -792,8 +792,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('fbeta') call parse_real_variable('fbeta', fbeta, 0.001D0, 10.0D0, & 'F-value for eps.betap beta limit') - case ('fbetap') - call parse_real_variable('fbetap', fbetap, 0.001D0, 10.0D0, & + case ('fbeta_poloidal') + call parse_real_variable('fbeta_poloidal', fbeta_poloidal, 0.001D0, 10.0D0, & 'F-value for poloidal beta limit') case ('fbetatry') call parse_real_variable('fbetatry', fbetatry, 0.001D0, 10.0D0, & diff --git a/source/fortran/iteration_variables.f90 b/source/fortran/iteration_variables.f90 index 83424619..039c69a9 100755 --- a/source/fortran/iteration_variables.f90 +++ b/source/fortran/iteration_variables.f90 @@ -1788,25 +1788,25 @@ end function itv_78 !--------------------------------- subroutine init_itv_79 - !!
    • (79) fbetap (f-value for equation 48) + !!
    • (79) fbeta_poloidal (f-value for equation 48) use numerics, only: lablxc, boundl, boundu implicit none - lablxc(79) = 'fbetap ' + lablxc(79) = 'fbeta_poloidal ' boundl(79) = 0.001D0 boundu(79) = 1.000D0 end subroutine init_itv_79 real(kind(1.d0)) function itv_79() - use constraint_variables, only: fbetap + use constraint_variables, only: fbeta_poloidal implicit none - itv_79 = fbetap + itv_79 = fbeta_poloidal end function itv_79 subroutine set_itv_79(ratio) - use constraint_variables, only: fbetap + use constraint_variables, only: fbeta_poloidal implicit none real(kind(1.d0)) :: ratio - fbetap = ratio + fbeta_poloidal = ratio end subroutine set_itv_79 !!
    • (80) NOT USED diff --git a/source/fortran/numerics.f90 b/source/fortran/numerics.f90 index 9e154a22..b2ad9e73 100755 --- a/source/fortran/numerics.f90 +++ b/source/fortran/numerics.f90 @@ -280,7 +280,7 @@ module numerics !!
    • (76) NOT USED !!
    • (77) NOT USED !!
    • (78) NOT USED - !!
    • (79) fbetap (f-value for equation 48) + !!
    • (79) fbeta_poloidal (f-value for equation 48) !!
    • (80) NOT USED !!
    • (81) edrive !!
    • (82) drveff diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index a09289d5..7204f74a 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1861,7 +1861,7 @@ "fauxmn": 1.0, "favail": 1.0, "fbeta": 1.0, - "fbetap": 1.0, + "fbeta_poloidal": 1.0, "fbetatry": 1.0, "fbetatry_lower": 1.0, "fblbe": 0.6, @@ -9474,7 +9474,7 @@ "fauxmn": "f-value for minimum auxiliary power (`constraint equation 40`, `iteration variable 64`)", "favail": "F-value for minimum availability (`constraint equation 61`)", "fbeta": "f-value for epsilon beta-poloidal (`constraint equation 6`, `iteration variable 8`)", - "fbetap": "f-value for poloidal beta (`constraint equation 48`, `iteration variable 79`)", + "fbeta_poloidal": "f-value for poloidal beta (`constraint equation 48`, `iteration variable 79`)", "fbetatry": "f-value for beta limit (`constraint equation 24`, `iteration variable 36`)", "fbetatry_lower": "f-value for (lower) beta limit (`constraint equation 84`, `iteration variable 173`)", "fblbe": "beryllium fraction of blanket by volume (if `iblanket=2`, is Be fraction of breeding zone)", @@ -9949,7 +9949,7 @@ "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(tohs), 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 fbetatry_lower)\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 (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) fbetatry (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) 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) fbetatry_lower (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 (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) fbetatry (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) fbetatry_lower (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]", @@ -12474,7 +12474,7 @@ "lb": 0.001, "ub": 10.0 }, - "fbetap": { + "fbeta_poloidal": { "lb": 0.001, "ub": 10.0 }, @@ -15203,7 +15203,7 @@ "lb": 0.001, "ub": 1.0 }, - "fbetap": { + "fbeta_poloidal": { "lb": 0.001, "ub": 1.0 }, @@ -15739,7 +15739,7 @@ "fauxmn": 1.0, "favail": 1.0, "fbeta": 1.0, - "fbetap": 1.0, + "fbeta_poloidal": 1.0, "fbetatry": 1.0, "fbetatry_lower": 1.0, "fbmaxcs": 13.0, @@ -16558,7 +16558,7 @@ }, "79": { "lb": 0.001, - "name": "fbetap", + "name": "fbeta_poloidal", "ub": 1.0 }, "8": { @@ -16793,7 +16793,7 @@ "73": "scrapli", "74": "scraplo", "75": "tfootfi", - "79": "fbetap", + "79": "fbeta_poloidal", "8": "fbeta", "81": "edrive", "82": "drveff", @@ -16840,7 +16840,7 @@ "fauxmn": "64", "favail": "107", "fbeta": "8", - "fbetap": "79", + "fbeta_poloidal": "79", "fbetatry": "36", "fbetatry_lower": "161", "fbmaxcs": "149", @@ -17384,7 +17384,7 @@ "bmxlim", "fauxmn", "fbeta", - "fbetap", + "fbeta_poloidal", "fbetatry", "fbetatry_lower", "fcpttf", @@ -20226,7 +20226,7 @@ "fauxmn": "real_variable", "favail": "real_variable", "fbeta": "real_variable", - "fbetap": "real_variable", + "fbeta_poloidal": "real_variable", "fbetatry": "real_variable", "fbetatry_lower": "real_variable", "fblbe": "real_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 1ff21bc5..d6764c3f 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -363,7 +363,7 @@ dnbeta = 5.0 *icc = 48 * DESCRIPTION: Constraint equation for poloidal beta upper limit * JUSTIFICATION: Turned off, do not care about poloidal beta -* VARIABLES: beta_poloidal_max, fbetap. betap calculated in-situ +* VARIABLES: beta_poloidal_max, fbeta_poloidal. betap calculated in-situ *beta_poloidal_max = * DESCRIPTION: Maximum poloidal beta (`constraint equation 48`) (default = 0.19) From 480b79d6ad8078d42c8ec4ef1a01b4f57636e620 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 17:38:51 +0000 Subject: [PATCH 10/20] Rename betap to beta_poloidal for clarity and consistency across the codebase --- .../data/csv_output_large_tokamak_MFILE.DAT | 4 +- examples/data/large_tokamak_1_MFILE.DAT | 4 +- examples/data/large_tokamak_2_MFILE.DAT | 4 +- examples/data/large_tokamak_3_MFILE.DAT | 4 +- examples/data/large_tokamak_4_MFILE.DAT | 4 +- examples/data/scan_MFILE.DAT | 36 +++++------ process/io/mfile_comparison.py | 2 +- process/io/plot_proc.py | 2 +- process/pfcoil.py | 4 +- process/physics.py | 20 +++---- process/stellarator.py | 2 +- source/fortran/constraint_equations.f90 | 16 ++--- source/fortran/input.f90 | 2 +- source/fortran/physics_variables.f90 | 4 +- 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 +- .../integration/data/large_tokamak_MFILE.DAT | 4 +- tests/integration/data/scan_2D_MFILE.DAT | 60 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 36 +++++------ tests/integration/ref_dicts.json | 6 +- tests/integration/test_pfcoil_int.py | 2 +- .../input_files/st_regression.IN.DAT | 2 +- tests/unit/data/large_tokamak_MFILE.DAT | 4 +- tests/unit/test_physics.py | 22 +++---- 27 files changed, 133 insertions(+), 131 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 44d39f1d..7b149e77 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -343,7 +343,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4251E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8387E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.6055E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2531E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2531E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.7123E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.4814E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -351,7 +351,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.1574E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0974E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.2509E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.1770E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.1770E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7593E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5527E+00 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index adabaaf8..3114ea14 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -344,7 +344,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5961E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9805E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3648E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2857E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4553E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.2236E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -352,7 +352,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9425E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1243E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 3.0215E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.2857E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.2857E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9099E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4977E+00 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 930a8ebd..4d08c6ce 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -344,7 +344,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5961E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9805E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3648E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2857E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4553E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.2236E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -352,7 +352,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9425E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1243E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 3.0215E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.2857E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.2857E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9099E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4977E+00 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 9585f9e5..d7d4ea16 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -344,7 +344,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5961E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9805E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3648E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2857E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4553E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.2236E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -352,7 +352,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9425E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1243E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 3.0215E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.2857E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.2857E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9099E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4977E+00 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index ef96c7ef..27b4d875 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -344,7 +344,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5961E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9805E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3648E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2857E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4553E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.2236E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -352,7 +352,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9425E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1243E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 3.0215E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.2857E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.2857E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9099E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4977E+00 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 8e6eb2e6..3e4faeda 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -199,7 +199,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -207,7 +207,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -1194,7 +1194,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -1202,7 +1202,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -2189,7 +2189,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -2197,7 +2197,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -3184,7 +3184,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -3192,7 +3192,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -4179,7 +4179,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -4187,7 +4187,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -5174,7 +5174,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -5182,7 +5182,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -6169,7 +6169,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -6177,7 +6177,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -7164,7 +7164,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -7172,7 +7172,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -8159,7 +8159,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -8167,7 +8167,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index f3b08b26..539bfc7e 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -60,7 +60,7 @@ "plasma_current_MA", "bt", "q95", - "betap", + "beta_poloidal", "te", "dene", "hfact", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 822202d3..37af1039 100755 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2410,7 +2410,7 @@ def plot_physics_info(axis, mfile_data, scan): ("normalised_thermal_beta", r"$\beta_N$, thermal", "% m T MA$^{-1}$"), ("normalised_toroidal_beta", r"$\beta_N$, toroidal", "% m T MA$^{-1}$"), ("thermal_poloidal_beta", r"$\beta_P$, thermal", ""), - ("betap", r"$\beta_P$, total", ""), + ("beta_poloidal", r"$\beta_P$, total", ""), ("te", r"$< T_e >$", "keV"), ("dene", r"$< n_e >$", "m$^{-3}$"), (nong, r"$< n_{\mathrm{e,line}} >/n_G$", ""), diff --git a/process/pfcoil.py b/process/pfcoil.py index c52299e1..a1db8151 100644 --- a/process/pfcoil.py +++ b/process/pfcoil.py @@ -314,7 +314,7 @@ def pfcoil(self): / pv.rmajor * ( math.log(8.0e0 * pv.aspect) - + pv.betap + + pv.beta_poloidal + (pv.rli / 2.0e0) - 1.5e0 ) @@ -395,7 +395,7 @@ def pfcoil(self): / pv.rmajor * ( math.log(8.0e0 * pv.aspect) - + pv.betap + + pv.beta_poloidal + (pv.rli / 2.0e0) - 1.5e0 ) diff --git a/process/physics.py b/process/physics.py index 782c54c3..0242ec7f 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1570,7 +1570,7 @@ def physics(self): ) # Calculate physics_variables.beta poloidal [-] - physics_variables.betap = beta_poloidal( + physics_variables.beta_poloidal = calculate_poloidal_beta( physics_variables.btot, physics_variables.bp, physics_variables.beta ) @@ -1733,7 +1733,7 @@ def physics(self): current_drive_variables.bscf_sakai = ( current_drive_variables.cboot * self.bootstrap_fraction_sakai( - betap=physics_variables.betap, + beta_poloidal=physics_variables.beta_poloidal, q95=physics_variables.q95, q0=physics_variables.q0, alphan=physics_variables.alphan, @@ -3461,8 +3461,8 @@ def outplas(self): po.ovarre( self.outfile, "Total poloidal beta", - "(betap)", - physics_variables.betap, + "(beta_poloidal)", + physics_variables.beta_poloidal, "OP ", ) po.ovarre( @@ -3514,8 +3514,8 @@ def outplas(self): po.ovarrf( self.outfile, "2nd stability physics_variables.beta : beta_p / (R/a)", - "(eps*betap)", - physics_variables.eps * physics_variables.betap, + "(eps*beta_poloidal)", + physics_variables.eps * physics_variables.beta_poloidal, "OP ", ) po.ovarrf( @@ -5728,7 +5728,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: @staticmethod def bootstrap_fraction_sakai( - betap: float, + beta_poloidal: float, q95: float, q0: float, alphan: float, @@ -5740,7 +5740,7 @@ def bootstrap_fraction_sakai( Calculate the bootstrap fraction using the Sakai formula. Parameters: - betap (float): Plasma poloidal beta. + beta_poloidal (float): Plasma poloidal beta. q95 (float): Safety factor at 95% of the plasma radius. q0 (float): Safety factor at the magnetic axis. alphan (float): Density profile index @@ -5768,7 +5768,7 @@ def bootstrap_fraction_sakai( # So the diamganetic current should not be calculated with this. i_diamagnetic_current = 0 return ( 10 ** (0.951 * eps - 0.948) - * betap ** (1.226 * eps + 1.584) + * beta_poloidal ** (1.226 * eps + 1.584) * rli ** (-0.184 * eps - 0.282) * (q95 / q0) ** (-0.042 * eps - 0.02) * alphan ** (0.13 * eps + 0.05) @@ -6828,7 +6828,7 @@ def pcond( return kappaa, ptrepv, ptripv, tauee, tauei, taueff, powerht -def beta_poloidal(btot, bp, beta): +def calculate_poloidal_beta(btot, bp, beta): """Calculates total poloidal beta Author: James Morris (UKAEA) diff --git a/process/stellarator.py b/process/stellarator.py index dbfaeb8c..1e1a8360 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -3935,7 +3935,7 @@ def stphys(self, output): # Poloidal physics_variables.beta - # betap = physics_variables.beta * ( physics_variables.btot/physics_variables.bp )**2 # Dont need this I think. + # beta_poloidal = physics_variables.beta * ( physics_variables.btot/physics_variables.bp )**2 # Dont need this I think. # Perform auxiliary power calculations diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index a5288811..1938000c 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -676,8 +676,8 @@ subroutine constraint_eqn_006(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! fbeta : input real : f-value for epsilon beta-poloidal !! epbetmax : input real : maximum (eps*beta_poloidal) !! eps : input real : inverse aspect ratio - !! betap : input real : poloidal beta - use physics_variables, only: epbetmax, eps, betap + !! beta_poloidal : input real : poloidal beta + use physics_variables, only: epbetmax, eps, beta_poloidal use constraint_variables, only: fbeta, fbeta implicit none real(dp), intent(out) :: tmp_cc @@ -686,9 +686,9 @@ subroutine constraint_eqn_006(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=1), intent(out) :: tmp_symbol character(len=10), intent(out) :: tmp_units - tmp_cc = 1.0D0 - fbeta * epbetmax/(eps*betap) + tmp_cc = 1.0D0 - fbeta * epbetmax/(eps*beta_poloidal) tmp_con = epbetmax * (1.0D0 - tmp_cc) - tmp_err = (eps*betap) * tmp_cc + tmp_err = (eps*beta_poloidal) * tmp_cc tmp_symbol = '<' tmp_units = '' @@ -2084,9 +2084,9 @@ subroutine constraint_eqn_048(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! Logic change during pre-factoring: err, symbol, units will be assigned only if present. !! fbeta_poloidal : input real : rf-value for poloidal beta !! beta_poloidal_max : input real : maximum poloidal beta - !! betap : input real : poloidal beta + !! beta_poloidal : input real : poloidal beta use constraint_variables, only: fbeta_poloidal, beta_poloidal_max - use physics_variables, only: betap + use physics_variables, only: beta_poloidal implicit none real(dp), intent(out) :: tmp_cc real(dp), intent(out) :: tmp_con @@ -2094,9 +2094,9 @@ subroutine constraint_eqn_048(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) character(len=1), intent(out) :: tmp_symbol character(len=10), intent(out) :: tmp_units - tmp_cc = 1.0D0 - fbeta_poloidal * beta_poloidal_max/betap + tmp_cc = 1.0D0 - fbeta_poloidal * beta_poloidal_max/beta_poloidal tmp_con = beta_poloidal_max * (1.0D0 - tmp_cc) - tmp_err = betap * tmp_cc + tmp_err = beta_poloidal * tmp_cc tmp_symbol = '<' tmp_units = '' diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index a57c3d79..c2ebd592 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -791,7 +791,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) 'F-value for minimum auxiliary power') case ('fbeta') call parse_real_variable('fbeta', fbeta, 0.001D0, 10.0D0, & - 'F-value for eps.betap beta limit') + 'F-value for eps.beta_poloidal beta limit') case ('fbeta_poloidal') call parse_real_variable('fbeta_poloidal', fbeta_poloidal, 0.001D0, 10.0D0, & 'F-value for poloidal beta limit') diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 4f2ba442..685478ff 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -65,7 +65,7 @@ module physics_variables real(dp) :: beta_beam !! neutral beam beta component - real(dp) :: betap + real(dp) :: beta_poloidal !! poloidal beta real(dp) :: normalised_total_beta @@ -917,7 +917,7 @@ subroutine init_physics_variables beta_limit_upper = 0.0D0 beta_limit_lower = 0.0D0 beta_beam = 0.0D0 - betap = 0.0D0 + beta_poloidal = 0.0D0 normalised_total_beta = 0.0D0 betbm0 = 1.5D0 bp = 0.0D0 diff --git a/source/fortran/scan.f90 b/source/fortran/scan.f90 index d2286563..965fb338 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, betap, hfac, teped, alpha_power_beams, qlim, rmajor, wallmw, & + pdivt, ralpne, ten, beta_poloidal, hfac, teped, alpha_power_beams, qlim, rmajor, wallmw, & beta, beta_limit_upper, bt, plasma_current use global_variables, only: verbose, maxcal, runtitle, run_tests use constants, only: nout @@ -230,7 +230,7 @@ subroutine scan_1d_store_output(iscan, ifail, noutvars_, ipnscns_, outvar) outvar(16,iscan) = qlim outvar(17,iscan) = beta outvar(18,iscan) = beta_limit_upper - outvar(19,iscan) = betap / aspect + outvar(19,iscan) = beta_poloidal / aspect outvar(20,iscan) = ten/10.0D0 outvar(21,iscan) = dene/1.0D20 outvar(22,iscan) = hfac(6) diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index e71ce3e2..6aa49ac5 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -343,7 +343,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5961E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9805E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3648E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2857E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4553E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.2236E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -351,7 +351,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9425E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1243E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 3.0215E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.2857E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.2857E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9099E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4977E+00 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 42d9e2d1..f8caa35f 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -344,7 +344,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5961E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9805E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3648E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2857E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4553E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.2236E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -352,7 +352,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9425E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1243E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 3.0215E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.2857E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.2857E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9099E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4977E+00 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index aef8c017..6b2388bb 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -344,7 +344,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5961E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9805E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3648E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2857E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4553E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.2236E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -352,7 +352,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9425E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1243E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 3.0215E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.2857E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.2857E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9099E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4977E+00 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 5396786f..8ec3839f 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -344,7 +344,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5961E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9805E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3648E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2857E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4553E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.2236E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -352,7 +352,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9425E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1243E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 3.0215E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.2857E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.2857E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9099E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4977E+00 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index f9d9e901..4964446e 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -340,7 +340,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.6552E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 3.0295E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3049E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.3036E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.3036E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.3909E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1775E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -348,7 +348,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.8872E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1388E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 2.9623E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.3453E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.3453E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9607E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4911E+00 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 64dd70c7..11512c44 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -345,7 +345,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5455E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9385E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3836E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2577E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2577E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.4772E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.3089E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -353,7 +353,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9527E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0975E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.0344E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.1924E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.1924E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8659E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4711E+00 @@ -1508,7 +1508,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4640E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8709E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.5277E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2532E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2532E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.6299E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.4981E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -1516,7 +1516,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.0779E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0934E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.1671E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.1775E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.1775E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7940E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5167E+00 @@ -2671,7 +2671,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.3859E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8062E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.6750E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2490E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2490E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.7864E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.6810E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -2679,7 +2679,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.2069E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0899E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.3041E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.1634E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.1634E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7239E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5630E+00 @@ -3834,7 +3834,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4009E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8186E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.6920E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2656E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2656E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.8030E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.7217E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -3842,7 +3842,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.2198E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1037E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.3166E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.2186E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.2186E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7374E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5848E+00 @@ -4997,7 +4997,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4701E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8760E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.5537E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2668E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2668E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.6562E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.5538E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -5005,7 +5005,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.0983E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1044E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.1877E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.2226E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.2226E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7994E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5378E+00 @@ -6160,7 +6160,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5501E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9423E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.4141E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2722E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2722E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.5083E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.3887E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -6168,7 +6168,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9752E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1087E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.0573E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.2407E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.2407E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8699E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4932E+00 @@ -7323,7 +7323,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5648E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9545E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.4304E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2886E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2886E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.5242E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.4272E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -7331,7 +7331,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.9877E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1223E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.0694E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.2955E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.2955E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8828E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5140E+00 @@ -8486,7 +8486,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4926E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8947E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.5652E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2870E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2870E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.6667E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.5983E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -8494,7 +8494,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.1053E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1210E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.1938E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.2899E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.2899E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8194E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5601E+00 @@ -9649,7 +9649,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4301E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8429E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.6985E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2891E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2891E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.8077E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.7692E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -9657,7 +9657,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.2216E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1228E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.3167E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.2969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.2969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7637E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.6084E+00 @@ -10812,7 +10812,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4346E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8466E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.7250E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.3016E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.3016E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.8348E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.8179E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -10820,7 +10820,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.2432E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1332E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.3388E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.3386E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.3386E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7677E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.6293E+00 @@ -11975,7 +11975,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4923E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8944E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.5948E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2974E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2974E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.6972E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.6479E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -11983,7 +11983,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.1300E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1297E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.2192E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.3248E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.3248E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8191E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5802E+00 @@ -13138,7 +13138,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5636E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9535E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.4601E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2989E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2989E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.5548E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.4786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -13146,7 +13146,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.0123E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1308E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.0947E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.3298E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.3298E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8817E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5338E+00 @@ -14301,7 +14301,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5702E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9590E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.4830E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.3122E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.3122E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.5780E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.5223E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -14309,7 +14309,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.0308E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1419E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.1135E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.3741E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.3741E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8874E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.5541E+00 @@ -15464,7 +15464,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4884E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8912E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.6278E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.3066E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.3066E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.7314E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.7011E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -15472,7 +15472,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.1577E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1373E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.2479E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.3552E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.3552E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8157E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.6001E+00 @@ -16627,7 +16627,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4067E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8235E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.7817E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.3007E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.3007E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.8950E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.8907E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -16635,7 +16635,7 @@ Thermal_beta____________________________________________________________ ______________________________ 3.2927E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1325E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.3913E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.3356E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.3356E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7427E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.6478E+00 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index fa1f0bbd..8c9dbb99 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -199,7 +199,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -207,7 +207,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -1194,7 +1194,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -1202,7 +1202,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -2189,7 +2189,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -2197,7 +2197,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -3184,7 +3184,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -3192,7 +3192,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -4179,7 +4179,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -4187,7 +4187,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -5174,7 +5174,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -5182,7 +5182,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -6169,7 +6169,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -6177,7 +6177,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -7164,7 +7164,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -7172,7 +7172,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 @@ -8159,7 +8159,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.5000E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.9256E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.0698E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2080E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -8167,7 +8167,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.6519E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0436E+00 OP Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 2.7211E-02 OP - 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 3.8969E-01 + 2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 3.8969E-01 2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.8522E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.2870E+00 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 7204f74a..40077807 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -301,7 +301,7 @@ "beta_limit_lower": 0.0, "beta_beam": 0.0, "betao": 1.0, - "betap": 0.0, + "beta_poloidal": 0.0, "betbm0": 1.5, "beta_poloidal_max": 0.19, "bfw": 0.0, @@ -8868,7 +8868,7 @@ "beta_limit_lower": "allowable lower beta", "beta_beam": "neutral beam beta component", "betao": "poloidal plane angle between divertor plate and leg, outboard (rad)", - "betap": "poloidal beta", + "beta_poloidal": "poloidal beta", "betbm0": "leading coefficient for NB beta fraction", "beta_poloidal_max": "maximum poloidal beta (`constraint equation 48`)", "bfw": "outer radius of each first wall structural tube (m) (0.5 * average of fwith and fwoth)", @@ -19057,7 +19057,7 @@ "beta_limit_upper", "beta_limit_lower", "beta_beam", - "betap", + "beta_poloidal", "normalised_total_beta", "betbm0", "bp", diff --git a/tests/integration/test_pfcoil_int.py b/tests/integration/test_pfcoil_int.py index a9bb842a..8c40d2f8 100644 --- a/tests/integration/test_pfcoil_int.py +++ b/tests/integration/test_pfcoil_int.py @@ -127,7 +127,7 @@ def test_pfcoil(monkeypatch, pfcoil): monkeypatch.setattr(pv, "vsind", 3.497e2) monkeypatch.setattr(pv, "aspect", 3.1) monkeypatch.setattr(pv, "itart", 0) - monkeypatch.setattr(pv, "betap", 6.313e-1) + monkeypatch.setattr(pv, "beta_poloidal", 6.313e-1) monkeypatch.setattr(tfv, "tftmp", 4.750) monkeypatch.setattr(tfv, "dcond", np.full(9, 9.0e3)) monkeypatch.setattr(tfv, "i_tf_sup", 1) diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index d6764c3f..5e64dc18 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -363,7 +363,7 @@ dnbeta = 5.0 *icc = 48 * DESCRIPTION: Constraint equation for poloidal beta upper limit * JUSTIFICATION: Turned off, do not care about poloidal beta -* VARIABLES: beta_poloidal_max, fbeta_poloidal. betap calculated in-situ +* VARIABLES: beta_poloidal_max, fbeta_poloidal. beta_poloidal calculated in-situ *beta_poloidal_max = * DESCRIPTION: Maximum poloidal beta (`constraint equation 48`) (default = 0.19) diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index fa9b141a..bb91a13a 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -340,7 +340,7 @@ Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.6552E+00 ITV Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 3.0295E+00 Total_plasma_beta_______________________________________________________ (beta)________________________ 3.3049E-02 ITV - Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.3036E+00 OP + Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.3036E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.3909E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1775E-03 OP Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP @@ -348,7 +348,7 @@ Thermal_beta____________________________________________________________ ______________________________ 2.8872E-02 OP Thermal_poloidal_beta___________________________________________________ ______________________________ 1.1388E+00 OP Thermal_toroidal_physics_variables.beta_(=_beta-exp)____________________ ______________________________ 2.9623E-02 OP - 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*betap)___________________ 4.3453E-01 + 2nd_stability_physics_variables.beta_:_beta_p_/_(R/a)___________________ (eps*beta_poloidal)___________________ 4.3453E-01 2nd_stability_physics_variables.beta_upper_limit________________________ (epbetmax)____________________ 1.3800E+00 Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.9607E+00 Normalised_thermal_beta_________________________________________________ ______________________________ 2.4911E+00 diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index edd0505f..d1cbfd13 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -21,7 +21,7 @@ calculate_current_coefficient_hastie, vscalc, rether, - beta_poloidal, + calculate_poloidal_beta, res_diff_time, ) from process.plasma_profiles import PlasmaProfile @@ -39,10 +39,10 @@ def physics(): return Physics(PlasmaProfile(), CurrentDrive(PlasmaProfile())) -def test_beta_poloidal(): - """Test beta_poloidal()""" - betap = beta_poloidal(5.347, 0.852, 0.0307) - assert betap == pytest.approx(1.209, abs=0.001) +def test_calculate_poloidal_beta(): + """Test calculate_poloidal_beta()""" + beta_poloidal = calculate_poloidal_beta(5.347, 0.852, 0.0307) + assert beta_poloidal == pytest.approx(1.209, abs=0.001) def test_res_diff_time(): @@ -483,7 +483,7 @@ def test_bootstrap_fraction_sauter(bootstrapfractionsauterparam, monkeypatch, ph class BootstrapFractionSakaiParam(NamedTuple): - betap: Any = None + beta_poloidal: Any = None q95: Any = None @@ -504,7 +504,7 @@ class BootstrapFractionSakaiParam(NamedTuple): "bootstrapfractionsakaiparam", ( BootstrapFractionSakaiParam( - betap=1.3184383457774960, + beta_poloidal=1.3184383457774960, q95=3.5151046634673557, q0=1.0, alphan=1.0, @@ -514,7 +514,7 @@ class BootstrapFractionSakaiParam(NamedTuple): expected_bfs=0.3501274900057279, ), BootstrapFractionSakaiParam( - betap=1.1701245502231756, + beta_poloidal=1.1701245502231756, q95=5.1746754543339177, q0=2.0, alphan=0.9, @@ -539,7 +539,9 @@ def test_bootstrap_fraction_sakai(bootstrapfractionsakaiparam, monkeypatch, phys :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(physics_variables, "betap", bootstrapfractionsakaiparam.betap) + monkeypatch.setattr( + physics_variables, "beta_poloidal", bootstrapfractionsakaiparam.beta_poloidal + ) monkeypatch.setattr(physics_variables, "q95", bootstrapfractionsakaiparam.q95) @@ -554,7 +556,7 @@ def test_bootstrap_fraction_sakai(bootstrapfractionsakaiparam, monkeypatch, phys monkeypatch.setattr(physics_variables, "rli", bootstrapfractionsakaiparam.rli) bfs = physics.bootstrap_fraction_sakai( - betap=bootstrapfractionsakaiparam.betap, + beta_poloidal=bootstrapfractionsakaiparam.beta_poloidal, q95=bootstrapfractionsakaiparam.q95, q0=bootstrapfractionsakaiparam.q0, alphan=bootstrapfractionsakaiparam.alphan, From 9338af910985153869cd7aa18ce5d1bb0cfa579b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 18:30:31 +0000 Subject: [PATCH 11/20] Rename betat to beta_toroidal and add it as a proper physics variable for clarity and consistency across the codebase --- process/physics.py | 31 ++++++++++++++-------------- source/fortran/physics_variables.f90 | 4 ++++ tests/unit/test_physics.py | 6 +++--- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/process/physics.py b/process/physics.py index 0242ec7f..90a55b38 100644 --- a/process/physics.py +++ b/process/physics.py @@ -592,7 +592,7 @@ def _nevins_integral( alphan: float, q0: float, q95: float, - betat: float, + beta_toroidal: float, ) -> float: """ Integrand function for Nevins et al bootstrap current scaling. @@ -609,7 +609,7 @@ def _nevins_integral( - alphan: float, density profile index - q0: float, normalized safety factor at the magnetic axis - q95: float, normalized safety factor at 95% of the plasma radius - - betat: float, Toroidal plasma beta + - beta_toroidal: float, Toroidal plasma beta Returns: - float, the integrand value @@ -654,7 +654,7 @@ def _nevins_integral( # q-profile q = q0 + (q95 - q0) * ((y + y**2 + y**3) / (3.0)) - pratio = (betat - betae) / betae + pratio = (beta_toroidal - betae) / betae return (q / q95) * (al1 * (a1 + (pratio * (a1 + alphai * a2))) + al2 * a2) @@ -1569,6 +1569,12 @@ def physics(self): physics_variables.bt**2 + physics_variables.bp**2 ) + physics_variables.beta_toroidal = ( + physics_variables.beta + * physics_variables.btot**2 + / physics_variables.bt**2 + ) + # Calculate physics_variables.beta poloidal [-] physics_variables.beta_poloidal = calculate_poloidal_beta( physics_variables.btot, physics_variables.bp, physics_variables.beta @@ -1680,19 +1686,13 @@ def physics(self): physics_variables.plasma_volume, ) ) - # Calculate the toroidal beta for the Nevins scaling - betat = ( - physics_variables.beta - * physics_variables.btot**2 - / physics_variables.bt**2 - ) current_drive_variables.bscf_nevins = ( current_drive_variables.cboot * self.bootstrap_fraction_nevins( physics_variables.alphan, physics_variables.alphat, - betat, + physics_variables.beta_toroidal, physics_variables.bt, physics_variables.dene, physics_variables.plasma_current, @@ -3468,9 +3468,8 @@ def outplas(self): po.ovarre( self.outfile, "Total toroidal beta", - " ", - physics_variables.beta - * (physics_variables.btot / physics_variables.bt) ** 2, + "(beta_toroidal)", + physics_variables.beta_toroidal, "OP ", ) po.ovarre( @@ -5488,7 +5487,7 @@ def bootstrap_fraction_wilson( def bootstrap_fraction_nevins( alphan: float, alphat: float, - betat: float, + beta_toroidal: float, bt: float, dene: float, plasma_current: float, @@ -5505,7 +5504,7 @@ def bootstrap_fraction_nevins( Args: alphan (float): Density profile index. alphat (float): Temperature profile index. - betat (float): Toroidal plasma beta. + beta_toroidal (float): Toroidal plasma beta. bt (float): Toroidal field on axis (T). dene (float): Electron density (/m3). plasma_current (float): Plasma current (A). @@ -5559,7 +5558,7 @@ def bootstrap_fraction_nevins( alphan, q0, q95, - betat, + beta_toroidal, ), 0, # Lower bound 1.0, # Upper bound diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 685478ff..f218e8bd 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -68,6 +68,9 @@ module physics_variables real(dp) :: beta_poloidal !! poloidal beta + real(dp) :: beta_toroidal + !! toroidal beta + real(dp) :: normalised_total_beta !! normaised total beta @@ -918,6 +921,7 @@ subroutine init_physics_variables beta_limit_lower = 0.0D0 beta_beam = 0.0D0 beta_poloidal = 0.0D0 + beta_toroidal = 0.0D0 normalised_total_beta = 0.0D0 betbm0 = 1.5D0 bp = 0.0D0 diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index d1cbfd13..6a2c1d71 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -146,7 +146,7 @@ class BootstrapFractionNevinsParam(NamedTuple): alphan: Any = None - betat: Any = None + beta_toroidal: Any = None bt: Any = None @@ -178,7 +178,7 @@ class BootstrapFractionNevinsParam(NamedTuple): te0=24.402321098330372, ne0=8.515060981068918e19, alphan=1.0, - betat=0.03, + beta_toroidal=0.03, bt=5.7, dene=18398455.678867526, plasma_current=18398455.678867526, @@ -213,7 +213,7 @@ def test_bootstrap_fraction_nevins(bootstrapfractionnevinsparam, monkeypatch, ph fibs = physics.bootstrap_fraction_nevins( alphan=bootstrapfractionnevinsparam.alphan, alphat=bootstrapfractionnevinsparam.alphat, - betat=bootstrapfractionnevinsparam.betat, + beta_toroidal=bootstrapfractionnevinsparam.beta_toroidal, bt=bootstrapfractionnevinsparam.bt, dene=bootstrapfractionnevinsparam.dene, plasma_current=bootstrapfractionnevinsparam.plasma_current, From b9aa6159f9a99aaead2c6b80e8b722f4a62ffa9c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 8 Nov 2024 18:37:34 +0000 Subject: [PATCH 12/20] Add comment for normalised total beta calculation and update output label for clarity --- process/physics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/process/physics.py b/process/physics.py index 90a55b38..fbdc220a 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2988,6 +2988,7 @@ def calculate_plasma_current( * (1.0 + kappa**2 * (1.0 + 2.0 * triang**2 - 1.2 * triang**3)) ) + # Normalised beta from Troyon beta limit physics_variables.normalised_total_beta = ( 1.0e8 * physics_variables.beta * rminor * bt / plasma_current ) @@ -3556,7 +3557,7 @@ def outplas(self): po.ovarrf( self.outfile, "Normalised total beta", - " ", + "(normalised_total_beta)", physics_variables.normalised_total_beta, "OP ", ) From cbed206914b8072585c0603a9b8991fab0213d97 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 11 Nov 2024 09:21:54 +0000 Subject: [PATCH 13/20] Rename betath to beta_thermal and add it as a proper physics variable for consistency across the codebase --- process/physics.py | 31 ++++++++++++++++++---------- process/physics_functions.py | 4 ++-- source/fortran/physics_variables.f90 | 4 ++++ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/process/physics.py b/process/physics.py index fbdc220a..1effdf34 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1580,6 +1580,12 @@ def physics(self): physics_variables.btot, physics_variables.bp, physics_variables.beta ) + physics_variables.beta_thermal = ( + physics_variables.beta + - physics_variables.beta_fast_alpha + - physics_variables.beta_beam + ) + # Set PF coil ramp times if pulse_variables.lpulse != 1: if times_variables.tohsin == 0.0e0: @@ -3449,14 +3455,9 @@ def outplas(self): po.osubhd(self.outfile, "Beta Information :") - betath = ( - physics_variables.beta - - physics_variables.beta_fast_alpha - - physics_variables.beta_beam - ) gammaft = ( physics_variables.beta_fast_alpha + physics_variables.beta_beam - ) / betath + ) / physics_variables.beta_thermal po.ovarre(self.outfile, "Total plasma beta", "(beta)", physics_variables.beta) po.ovarre( @@ -3495,19 +3496,27 @@ def outplas(self): "OP ", ) - po.ovarre(self.outfile, "Thermal beta", " ", betath, "OP ") + po.ovarre( + self.outfile, + "Thermal beta", + "(beta_thermal)", + physics_variables.beta_thermal, + "OP ", + ) po.ovarre( self.outfile, "Thermal poloidal beta", " ", - betath * (physics_variables.btot / physics_variables.bp) ** 2, + physics_variables.beta_thermal + * (physics_variables.btot / physics_variables.bp) ** 2, "OP ", ) po.ovarre( self.outfile, "Thermal toroidal physics_variables.beta (= beta-exp)", " ", - betath * (physics_variables.btot / physics_variables.bt) ** 2, + physics_variables.beta_thermal + * (physics_variables.btot / physics_variables.bt) ** 2, "OP ", ) @@ -3547,7 +3556,7 @@ def outplas(self): "Normalised thermal beta", " ", 1.0e8 - * betath + * physics_variables.beta_thermal * physics_variables.rminor * physics_variables.bt / physics_variables.plasma_current, @@ -3604,7 +3613,7 @@ def outplas(self): "Plasma thermal energy (J)", " ", 1.5e0 - * betath + * physics_variables.beta_thermal * physics_variables.btot * physics_variables.btot / (2.0e0 * constants.rmu0) diff --git a/process/physics_functions.py b/process/physics_functions.py index 1e8ade78..c19e5d72 100644 --- a/process/physics_functions.py +++ b/process/physics_functions.py @@ -960,7 +960,7 @@ def fast_alpha_beta( # Determine average fast alpha density if physics_variables.f_deuterium < 1.0: - betath = ( + beta_thermal = ( 2.0e3 * constants.rmu0 * constants.electron_charge @@ -984,7 +984,7 @@ def fast_alpha_beta( fact = max(fact, 0.0) fact2 = alpha_power_density_total / alpha_power_density_plasma - beta_fast_alpha = betath * fact * fact2 + beta_fast_alpha = beta_thermal * fact * fact2 else: # negligible alpha production, alpha_power_density = alpha_power_beams = 0 beta_fast_alpha = 0.0 diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index f218e8bd..4307da23 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -71,6 +71,9 @@ module physics_variables real(dp) :: beta_toroidal !! toroidal beta + real(dp) :: beta_thermal + !! thermal beta + real(dp) :: normalised_total_beta !! normaised total beta @@ -922,6 +925,7 @@ subroutine init_physics_variables beta_beam = 0.0D0 beta_poloidal = 0.0D0 beta_toroidal = 0.0D0 + beta_thermal = 0.0D0 normalised_total_beta = 0.0D0 betbm0 = 1.5D0 bp = 0.0D0 From 40eeb88e65247b6809eb0918c3bfba15d6f7f18b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 11 Nov 2024 09:40:18 +0000 Subject: [PATCH 14/20] Add beta_thermal_poloidal and beta_thermal_toroidal variables for thermal beta calculations --- process/physics.py | 20 +++++++++++++------- source/fortran/physics_variables.f90 | 8 ++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/process/physics.py b/process/physics.py index 1effdf34..d1a811ba 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1586,6 +1586,14 @@ def physics(self): - physics_variables.beta_beam ) + physics_variables.beta_thermal_poloidal = ( + physics_variables.beta_thermal + * (physics_variables.btot / physics_variables.bp) ** 2 + ) + physics_variables.beta_thermal_toroidal = ( + physics_variables.beta_thermal + * (physics_variables.btot / physics_variables.bt) ** 2 + ) # Set PF coil ramp times if pulse_variables.lpulse != 1: if times_variables.tohsin == 0.0e0: @@ -3506,17 +3514,15 @@ def outplas(self): po.ovarre( self.outfile, "Thermal poloidal beta", - " ", - physics_variables.beta_thermal - * (physics_variables.btot / physics_variables.bp) ** 2, + "(beta_thermal_poloidal)", + physics_variables.beta_thermal_poloidal, "OP ", ) po.ovarre( self.outfile, - "Thermal toroidal physics_variables.beta (= beta-exp)", - " ", - physics_variables.beta_thermal - * (physics_variables.btot / physics_variables.bt) ** 2, + "Thermal toroidal beta", + "(beta_thermal_toroidal)", + physics_variables.beta_thermal_toroidal, "OP ", ) diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 4307da23..1228a088 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -74,6 +74,12 @@ module physics_variables real(dp) :: beta_thermal !! thermal beta + real(dp) :: beta_thermal_poloidal + !! poloidal thermal beta + + real(dp) :: beta_thermal_toroidal + !! poloidal thermal beta + real(dp) :: normalised_total_beta !! normaised total beta @@ -926,6 +932,8 @@ subroutine init_physics_variables beta_poloidal = 0.0D0 beta_toroidal = 0.0D0 beta_thermal = 0.0D0 + beta_thermal_poloidal = 0.0D0 + beta_thermal_poloidal = 0.0D0 normalised_total_beta = 0.0D0 betbm0 = 1.5D0 bp = 0.0D0 From 84009f3b2adc79080947fe2796062bcb9933d43f Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 11 Nov 2024 09:56:40 +0000 Subject: [PATCH 15/20] Add norm_beta_thermal variable and update output for normalised thermal beta calculation --- process/physics.py | 16 ++++++++++------ source/fortran/physics_variables.f90 | 4 ++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/process/physics.py b/process/physics.py index d1a811ba..d646df5f 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1594,6 +1594,14 @@ def physics(self): physics_variables.beta_thermal * (physics_variables.btot / physics_variables.bt) ** 2 ) + physics_variables.norm_beta_thermal = ( + 1.0e8 + * physics_variables.beta_thermal + * physics_variables.rminor + * physics_variables.bt + / physics_variables.plasma_current, + ) + # Set PF coil ramp times if pulse_variables.lpulse != 1: if times_variables.tohsin == 0.0e0: @@ -3560,12 +3568,8 @@ def outplas(self): po.ovarrf( self.outfile, "Normalised thermal beta", - " ", - 1.0e8 - * physics_variables.beta_thermal - * physics_variables.rminor - * physics_variables.bt - / physics_variables.plasma_current, + "(norm_beta_thermal) ", + physics_variables.norm_beta_thermal, "OP ", ) diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 1228a088..383bcb04 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -83,6 +83,9 @@ module physics_variables real(dp) :: normalised_total_beta !! normaised total beta + real(dp) :: norm_beta_thermal + !! normaised thermal beta + real(dp) :: betbm0 !! leading coefficient for NB beta fraction @@ -935,6 +938,7 @@ subroutine init_physics_variables beta_thermal_poloidal = 0.0D0 beta_thermal_poloidal = 0.0D0 normalised_total_beta = 0.0D0 + norm_beta_thermal = 0.0D0 betbm0 = 1.5D0 bp = 0.0D0 bt = 5.68D0 From 7b8f4cf993909f64be8ce66add9b01d977b10509 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 11 Nov 2024 11:27:03 +0000 Subject: [PATCH 16/20] Rename normalised_total_beta to norm_beta_total and add norm_beta_toroidal and norm_beta_poloidal to update related calculations and references for consistency --- process/io/mfile_comparison.py | 2 +- process/physics.py | 82 +++++++++++++++------------- source/fortran/physics_variables.f90 | 12 +++- tests/integration/ref_dicts.json | 6 +- tests/unit/test_physics.py | 12 ++-- 5 files changed, 65 insertions(+), 49 deletions(-) diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index 539bfc7e..a0deca58 100755 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -115,7 +115,7 @@ "q95", "beta", "normalised_thermal_beta", - "normalised_total_beta", + "norm_beta_total", "thermal_beta", "thermal_poloidal_beta", "te", diff --git a/process/physics.py b/process/physics.py index d646df5f..5ad14cb8 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1601,6 +1601,14 @@ def physics(self): * physics_variables.bt / physics_variables.plasma_current, ) + physics_variables.norm_beta_toroidal = ( + physics_variables.norm_beta_total + * (physics_variables.btot / physics_variables.bt) ** 2 + ) + physics_variables.norm_beta_poloidal = ( + physics_variables.norm_beta_total + * (physics_variables.btot / physics_variables.bp) ** 2 + ) # Set PF coil ramp times if pulse_variables.lpulse != 1: @@ -3011,7 +3019,7 @@ def calculate_plasma_current( ) # Normalised beta from Troyon beta limit - physics_variables.normalised_total_beta = ( + physics_variables.norm_beta_total = ( 1.0e8 * physics_variables.beta * rminor * bt / plasma_current ) @@ -3470,7 +3478,30 @@ def outplas(self): ) po.osubhd(self.outfile, "Beta Information :") - + if physics_variables.i_beta_component == 0: + po.ovarrf( + self.outfile, + "Limit on total beta", + "(beta_limit_upper)", + physics_variables.beta_limit_upper, + "OP ", + ) + elif physics_variables.i_beta_component == 1: + po.ovarrf( + self.outfile, + "Limit on thermal beta", + "(beta_limit_upper)", + physics_variables.beta_limit_upper, + "OP ", + ) + else: + po.ovarrf( + self.outfile, + "Limit on thermal + NB beta", + "(beta_limit_upper)", + physics_variables.beta_limit_upper, + "OP ", + ) gammaft = ( physics_variables.beta_fast_alpha + physics_variables.beta_beam ) / physics_variables.beta_thermal @@ -3547,7 +3578,7 @@ def outplas(self): "(epbetmax)", physics_variables.epbetmax, ) - + po.osubhd(self.outfile, "Normalised Beta Information :") if stellarator_variables.istell == 0: if physics_variables.iprofile == 1: po.ovarrf( @@ -3564,57 +3595,34 @@ def outplas(self): "(dnbeta)", physics_variables.dnbeta, ) - po.ovarrf( self.outfile, - "Normalised thermal beta", - "(norm_beta_thermal) ", - physics_variables.norm_beta_thermal, + "Normalised total beta", + "(norm_beta_total)", + physics_variables.norm_beta_total, "OP ", ) - po.ovarrf( self.outfile, - "Normalised total beta", - "(normalised_total_beta)", - physics_variables.normalised_total_beta, + "Normalised thermal beta", + "(norm_beta_thermal) ", + physics_variables.norm_beta_thermal, "OP ", ) - normalised_toroidal_beta = ( - physics_variables.normalised_total_beta - * (physics_variables.btot / physics_variables.bt) ** 2 - ) po.ovarrf( self.outfile, "Normalised toroidal beta", - "(normalised_toroidal_beta)", - normalised_toroidal_beta, + "(norm_beta_toroidal) ", + physics_variables.norm_beta_toroidal, "OP ", ) - if physics_variables.i_beta_component == 0: - po.ovarrf( - self.outfile, - "Limit on total beta", - "(beta_limit_upper)", - physics_variables.beta_limit_upper, - "OP ", - ) - elif physics_variables.i_beta_component == 1: po.ovarrf( self.outfile, - "Limit on thermal beta", - "(beta_limit_upper)", - physics_variables.beta_limit_upper, - "OP ", - ) - else: - po.ovarrf( - self.outfile, - "Limit on thermal + NB beta", - "(beta_limit_upper)", - physics_variables.beta_limit_upper, + "Normalised poloidal beta", + "(norm_beta_poloidal) ", + physics_variables.norm_beta_poloidal, "OP ", ) diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 383bcb04..6efc2cf3 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -80,12 +80,18 @@ module physics_variables real(dp) :: beta_thermal_toroidal !! poloidal thermal beta - real(dp) :: normalised_total_beta + real(dp) :: norm_beta_total !! normaised total beta real(dp) :: norm_beta_thermal !! normaised thermal beta + real(dp) :: norm_beta_toroidal + !! normaised toroidal beta + + real(dp) :: norm_beta_poloidal + !! normaised poloidal beta + real(dp) :: betbm0 !! leading coefficient for NB beta fraction @@ -937,8 +943,10 @@ subroutine init_physics_variables beta_thermal = 0.0D0 beta_thermal_poloidal = 0.0D0 beta_thermal_poloidal = 0.0D0 - normalised_total_beta = 0.0D0 + norm_beta_total = 0.0D0 norm_beta_thermal = 0.0D0 + norm_beta_poloidal = 0.0D0 + norm_beta_toroidal = 0.0D0 betbm0 = 1.5D0 bp = 0.0D0 bt = 5.68D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 40077807..8dd7b2e3 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -3407,7 +3407,7 @@ "nnetau": 0.0, "no_roots": 30.0, "nohc": 0.0, - "normalised_total_beta": 0.0, + "norm_beta_total": 0.0, "nout": 11.0, "noutvars": 84.0, "np": 2.0, @@ -10163,7 +10163,7 @@ "nnetau": "", "no_roots": "", "nohc": "number of PF coils (excluding the central solenoid) + 1", - "normalised_total_beta": "normaised total beta", + "norm_beta_total": "normaised total beta", "nout": "Output file unit identifier", "noutvars": "", "np": "Array length", @@ -19058,7 +19058,7 @@ "beta_limit_lower", "beta_beam", "beta_poloidal", - "normalised_total_beta", + "norm_beta_total", "betbm0", "bp", "bt", diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 6a2c1d71..7fef7d0c 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -569,7 +569,7 @@ def test_bootstrap_fraction_sakai(bootstrapfractionsakaiparam, monkeypatch, phys class PlasmaCurrentParam(NamedTuple): - normalised_total_beta: Any = None + norm_beta_total: Any = None beta: Any = None @@ -626,7 +626,7 @@ class PlasmaCurrentParam(NamedTuple): "plasmacurrentparam", ( PlasmaCurrentParam( - normalised_total_beta=0, + norm_beta_total=0, beta=0.030000000000000006, i_plasma_current=4, iprofile=1, @@ -654,7 +654,7 @@ class PlasmaCurrentParam(NamedTuple): expected_plasma_current=18398455.678867526, ), PlasmaCurrentParam( - normalised_total_beta=2.4784688886891844, + norm_beta_total=2.4784688886891844, beta=0.030000000000000006, i_plasma_current=4, iprofile=1, @@ -698,8 +698,8 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): monkeypatch.setattr( physics_variables, - "normalised_total_beta", - plasmacurrentparam.normalised_total_beta, + "norm_beta_total", + plasmacurrentparam.norm_beta_total, ) monkeypatch.setattr(physics_variables, "beta", plasmacurrentparam.beta) @@ -725,7 +725,7 @@ def test_calculate_plasma_current(plasmacurrentparam, monkeypatch, physics): triang95=plasmacurrentparam.triang95, ) - assert physics_variables.normalised_total_beta == pytest.approx( + assert physics_variables.norm_beta_total == pytest.approx( plasmacurrentparam.expected_normalised_total_beta ) From f4eeaf4b5d1098a2bf4c67fc3ca905b707d8c476 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 11 Nov 2024 16:09:47 +0000 Subject: [PATCH 17/20] Enhance plasma beta documentation and update fast alpha beta calculation notes for clarity --- .../plasma_alpha_beta_contribution.md | 101 +++++++++++++++--- .../physics-models/plasma_beta/plasma_beta.md | 96 ++++++++++++++++- process/physics_functions.py | 18 +++- 3 files changed, 197 insertions(+), 18 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md b/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md index e6417fe2..7b1a018b 100644 --- a/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md +++ b/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md @@ -1,20 +1,95 @@ -# Fast Alpha Pressure Contribution +# Fast Alpha Pressure Contribution | `fast_alpha_beta()` -The pressure contribution from the fast alpha particles can be controlled using switch `ifalphap`. -There are two options 1[^1] and 2[^2]: +The pressure contribution from the fast alpha particles can be controlled using switch `ifalphap`. +This sets the value of the physics variable, `beta_fast_alpha`. + +A contribution from fast alphas to the total plasma pressure can be relatively high (~ 10-30%) for fusion temperatures of interest Because the maximum volume-averaged beta achievable in a tokamak is limited by magnetohydrrdynamic (MHD) instabilities (e.g.,ballooning and kink modes), the presence of fast alphas, if $\langle \beta_{\text{tot}} \rangle$ is constant, reduces the background thermal plasma pressure. Furthermore, the energetic alpha population can influence (favorably or unfavorably) the bulk plasma ballooning mode stability boundaries[^2]. + +---------------------- + +## IPDG89 model + +This model can be used by setting: `ifalphap` = 0[^1] + +### Derivation + +Below is the derivation given by Uckan, N. A. et.al. [^2]. + +$$ +\beta_{\alpha} = \frac{2\mu_0 \left(\frac{2n_{\alpha}\langle E_{\alpha}\rangle }{3}\right)}{B^2} +$$ + +Normalizing to the plasma thermal beta $\beta_{\text{th}} = \beta_{\text{i}}+ \beta_{\text{e}}$ + +$$ +\frac{\beta_{\alpha}}{\beta_{\text{th}}} = \frac{\left(\frac{2E_{\alpha,0}}{3T_{\text{e}}}\right) \left(\frac{n_{\alpha}}{n_{\text{e}}}\right) \left(\frac{\langle E_{\alpha} \rangle}{E_{\alpha,0}}\right)}{1+f_{\text{nT}}} +$$ + +where $f_{\text{nT}} = f_{\text{n}}f_{\text{T}} = \left(\frac{n_{\text{i}}}{n_{\text{e}}}\right)\left(\frac{T_{\text{i}}}{T_{\text{e}}}\right)$. For $T_{\text{i}} \approx T_{\text{e}}$ and $Z_{\text{eff}} \approx 1.5$ (with $Z = 6$, carbon), $f_{\text{nT}} \approx 0.9$ ad typical local values of fractional fast alpha density , beta and energy are given in the table below. + +| $T \ [\mathrm{keV}]$ | $\langle\sigma v\rangle_{{D T}} \ \left[\mathrm{m}^3 / \mathrm{s}\right]$ | $n_{\mathrm{\alpha}} / n_{\text{e}} \ [\%]$ | $\beta_{\mathrm{\alpha}} / \beta_{\mathrm{th}} \ [\%]$ | $\langle E_{\alpha}\rangle/ E_{\alpha,0}$ | +| :---: | :---: | :---: | :---: | :---: | +| $5$ | $1.35 \times 10^{-23}$ | $0.01$ | $0.73$ | $0.3$ | +| $10$ | $1.13 \times 10^{-22}$ | $0.9$ | $4.2$ | $0.34$ | +| $20$ | $4.31 \times 10^{-22}$ | $0.8$ | $19$ | $0.39$ | +| $30$ | $6.65 \times 10^{-22}$ | $1.8$ | $31$ | $0.41$ | +| $40$ | $7.93 \times 10^{-22}$ | $2.7$ | $34$ | $0.41$ | +| $50$ | $8.54 \times 10^{-22}$ | $3.45$ | $34$ | $0.4$ | + +Assuming a parabolic profile for temperature and density where $\alpha_{\text{n}} \approx 0.0 - 0.5$ (relatively flat density profile) and $\alpha_{\text{T}} \approx 1$ the above beta ratio becomes: + +$$ +\gamma_{\alpha} = \frac{\beta_{\alpha}}{\beta_{\text{th}}} \approx\frac{ 0.32 f_{\text{DT}}^2\left(\frac{T_{\text{i}}}{T_{\text{e}}}\right) \langle T_{\text{e,10}} \rangle^{5/2} \langle U_{\alpha \text{e}} \rangle}{1+ f_{\text{nT}}} \\ += 0.32 f_{\text{DT}}^2\left(\frac{T_{\text{i}}}{T_{\text{e}}}\right) \langle T_{\text{e,10}} \rangle^{5/2} \left[\frac{2^{5/2}}{(1+f_{\text{nT}})^{7/2}}\right] +$$ + +where $\langle U_{\alpha \text{e}} \rangle$ is the fraction of alpha energy given to the electrons, $\langle T \rangle = \langle n_{\text{e}}T_{\text{e}}+n_{\text{i}}T_{\text{i}} / \langle 2n_{\text{e}} \rangle = \langle T_{\text{e}} \rangle \left(1+f_{\text{nT}}\right)/2$ is the density-weighted average temperature. For analytical simplicity, $\langle \sigma v \rangle_{\text{DT}}$ (the fusion reaction-rate parameter) is approximated as $\langle \sigma v \rangle_{\text{DT}} \approx 1.1 x 10^{-22} \left(T_{\text{i,10}}\right)^2$, which is accurate enough for $T \approx 7-20 \ \mathrm{keV}$. + +For the chosen profiles and $Z_{\text{eff}} \approx 1.5$, the average pressure contribution from fast alphas is $\gamma_{\alpha} \approx 5-20 \%$ for $\langle T \rangle \approx 6-15 \ \mathrm{keV}.$ Direct comparison between the predictions and a large number of 1-1/2-D $\mathtt{WHIST}$ transport code calculations (having similar profile shapes and $Z_{\text{eff}}$ values) shows good agreement (within ±15%) over the temperature range $\left(\langle T \rangle \approx 5-20 \ \mathrm{keV}\right)$ considered. A benchmark between above and $\mathtt{WHIST}$ has resulted in a simple functional fit that is more convenient to use in global analyses: + +$$ +\gamma_{\alpha} \approx 0.2\left(T_{\text{10}}-0.37\right), \ \text{for} \ Z_{\text{eff}} \approx 1.5, T_{\text{i}}/T_{\text{e}} \approx 1, \langle T \rangle \approx 5-20 \text{keV} +$$ + +!!! quote "Fit validity" + + "*To zeroth order, the assumption of different profiles $\left(\alpha_{\text{n}} \approx 0-1.0, \alpha_{\text{T}} \approx 0.5-2.0\right)$ did + not appear to have any significant effect on this simple fit. As expected, significant + deviations from the $\gamma_{\alpha}$ were seen in simulations for anomalous fast alpha diffusion + and energy relaxation. In such cases, however, global analysis is not adequate to describe + the fast alpha behavior*[^2]" + +------------------- + +The above derivation form is not that explicitly given in IPDG89[^1] and `PROCESS`. Terms for the electron and DT fuel ion species have been added back in. The $\left(\langle T_{\text{10}}\rangle-0.37\right)$ term still remains. + +$$ +\frac{\beta_{\alpha}}{\beta_{th}} = 0.29 \, \left( \langle T_{10} \rangle - +0.37 \right) \, \left( \frac{n_{\text{DT}}}{n_{\text{e}}} \right)^2 +$$ + +For $Z_{\text{eff}} \approx 1.5, T_{\text{i}}/T_{\text{e}} \approx 1, \langle T \rangle \approx 5-20 \text{keV}$ + + +----------------------- + +## H.Lux model + +This model can be used by setting: `ifalphap` = 1 (default)[^3] + +$$ +\frac{\beta_{\alpha}}{\beta_{th}} = 0.26 \, \left( \langle T_{10} \rangle - +0.65 \right)^{0.5} \, \left( \frac{n_{DT}}{n_e} \right)^2 +$$ -$$\begin{aligned} -\frac{\beta_{\alpha}}{\beta_{th}} & = 0.29 \, \left( \langle T_{10} \rangle - - 0.37 \right) \, \left( \frac{n_{DT}}{n_e} \right)^2 -\hspace{20mm} \mbox{if alphap = 0} \\ -\frac{\beta_{\alpha}}{\beta_{th}} & = 0.26 \, \left( \langle T_{10} \rangle - - 0.65 \right)^{0.5} \, \left( \frac{n_{DT}}{n_e} \right)^2 -\hspace{16mm} \mbox{if alphap = 1 (default)} -\end{aligned}$$ The latter model is a better estimate at higher temperatures. -[^1]: T. C. Hender et al., 'Physics Assessment for the European Reactor Study', +[^1]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', https://inis.iaea.org/collection/NCLCollectionStore/_Public/21/068/21068960.pdf + + +[^2]: Uckan, N. A., Tolliver, J. S., Houlberg, W. A., and Attenberger, S. E. Influence of fast alpha diffusion and thermal alpha buildup on tokamak reactor performance. United States: N. p., 1987. Web.https://www.osti.gov/servlets/purl/5611706 + -[^2]: H. Lux, R. Kemp, D.J. Ward, M. Sertoli, 'Impurity radiation in DEMO +[^3]: H. Lux, R. Kemp, D.J. Ward, M. Sertoli, 'Impurity radiation in DEMO systems modelling', Fus. Eng. | Des. **101**, 42-51 (2015) \ No newline at end of file diff --git a/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md index 9f5eea1f..bc0d172a 100644 --- a/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md +++ b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md @@ -1,4 +1,96 @@ -# Beta Limit +# Plasma Beta + +## Overview + +The efficiency of confinement of plasma pressure by the magnetic field is represented by the ratio: + +$$ +\beta = \frac{2\mu_0p}{B^2} +$$ + +There are several different measures of this type, arising from different choices of definition and from the need to quantify different equilibrium properties. + +In its expanded form of magnetic field components: + +$$ +\beta = \frac{2\mu_0p}{B^2_{\text{T}}+B^2_{\text{P}}} +$$ + +This is often broken down into separate related quantities knows as the toroidal $\beta_{\text{t}}$ and the poloidal beta $\beta_{\text{p}}$ whose definitions are: + +$$ +\beta_{\text{t}} = \frac{2\mu_0p}{B^2_{\text{T}}} \\ +\beta_{\text{p}} = \frac{2\mu_0p}{B^2_{\text{P}}} +$$ + +The relationship between these quantities can be written as: + +$$ +\frac{1}{\beta} = \frac{1}{\beta_{\text{t}}} + \frac{1}{\beta_{\text{p}}} +$$ + +implying that the total $\beta$ is dominated by the smaller of the two contributions.Observe that by definition $\beta \le 1$. However,either $\beta_{\text{t}}$ or $\beta_{\text{p}}$, but not both, can be greater than unity. + +The above in its simplest form is known as the total thermal beta $\beta_{\text{th}}$ as it only takes into account the pressure produced by the ions and electrons such that: + +$$ +\beta_{\text{th}} = \frac{2\mu_0 \langle n_{\text{e}}T_{\text{e}}+n_{\text{i}}T_{\text{i}}\rangle}{B^2} +$$ + +In future reactors there will be a notable pressure contribution due to the productions of fast alpha particles and that from plasma-beam interactions if used. So the true total beta can be defined as: + +$$ +\beta_{\text{tot}} = \frac{2\mu_0 \langle n_{\text{e}}T_{\text{e}}+n_{\text{i}}T_{\text{i}} + p_{\alpha}+ p_{\text{beam}}\rangle}{B^2} \\ +\beta_{\text{tot}} = \beta_{\text{th}}+\beta_{\alpha}+ \beta_{\text{beam}} +$$ + +Models for the fast alpha particle pressure contribution can be found [here](plasma_alpha_beta_contribution.md). + +---------------- + +## Derivation of plasma beta parameter + +From the lowest order momentum balance equation: + +$$ +\nabla p = \mathbf{j} \times \mathbf{B} +$$ + +as it pertains to plasma equilibrium. The current and the field must also satisfy Maxwell’s equations + +$$ +\mu_0\mathbf{j} = \nabla \times \mathbf{B}, \quad \nabla \cdot \mathbf{B} = 0 +$$ + +A consequence of the above is that the current and magnetic field lie on isobaric surfaces. This follows directly from the observation that $\mathbf{j} \cdot \nabla p = \mathbf{B} \cdot \nabla p = 0$ and $\nabla p$ is everywhere normal to the surface $p = \text{const}$. The force is everywhere normal to the isobaric surface and just balances the pressure gradient force, $-\nabla p$. Although the current and the magnetic field lie in a common flux surface, they can only be parallel in regions where the pressure gradient vanishes. Since currents that are parallel to the field do not contribute to the $\mathbf{j} \times \mathbf{B}$ force, they are known as “force-free currents.” + +Taking the divergence of $\mu_0\mathbf{j} = \nabla \times \mathbf{B}$ yields $\nabla \cdot \mathbf{j} = 0$ which is consistent with the quasineutrality assumption. The vector product of $\mathbf{B}$ with the momentum balance equation leads to an expression for the current perpendicular to $\mathbf{B}$, + +$$ +\mathbf{j}_{\perp} = \frac{\mathbf{B} \times \nabla p}{B^2} +$$ + +We see that there can be no perpendicular current in the absence of a pressure gradient. This leads to a momentum balance expressed in terms of the pressure and magnetic field. + +$$ +\nabla \left(p+\frac{B^2}{2\mu_0}\right) = \frac{1}{\mu_0}\left(\mathbf{B} \cdot \nabla \right)\mathbf{B} +$$ + +The right hand side vanishes when the field lines are straight and parallel, in which case above reduces to a simple statement that the total (kinetic plus magnetic) pressure is constant everywhere within a confined plasma, + +$$ +p + \frac{B^2}{2\mu_0} \equiv \frac{B^2}{2\mu_0}\left(1+\beta \right) = \text{const} +$$ + +where we have introduced the quantity + +$$ +\beta \equiv \frac{2\mu_0p}{B^2} +$$ + +------------------------ + +## Beta Limit The plasma beta limit[^1] is given by @@ -20,7 +112,7 @@ By default, $\beta$ is defined with respect to the total equilibrium B-field [^2 | 2 | Apply the $\beta$ limit to only the thermal plus neutral beam contributions to beta | | 3 | Apply the $\beta$ limit to the total beta (including the contribution from fast ions), calculated using only the toroidal field | -## Setting the Beta $g$ Coefficient +### Setting the Beta $g$ Coefficient Switch `iprofile` determines how the beta $g$ coefficient `dnbeta` should be calculated. diff --git a/process/physics_functions.py b/process/physics_functions.py index c19e5d72..47330d74 100644 --- a/process/physics_functions.py +++ b/process/physics_functions.py @@ -954,16 +954,28 @@ def fast_alpha_beta( Returns: float: Fast alpha beta component. + + Notes: + - For IPDG89 scaling applicability is Z_eff = 1.5, T_i/T_e = 1, = 5-20 keV + + + References: + - N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', + https://inis.iaea.org/collection/NCLCollectionStore/_Public/21/068/21068960.pdf + + - Uckan, N. A., Tolliver, J. S., Houlberg, W. A., and Attenberger, S. E. + Influence of fast alpha diffusion and thermal alpha buildup on tokamak reactor performance. + United States: N. p., 1987. Web.https://www.osti.gov/servlets/purl/5611706 + """ - # Determine average fast alpha density # Determine average fast alpha density if physics_variables.f_deuterium < 1.0: beta_thermal = ( - 2.0e3 + 2.0 * constants.rmu0 - * constants.electron_charge + * constants.kiloelectron_volt * (dene * ten + dnitot * tin) / (bt**2 + bp**2) ) From 85cc16b6f8b562779674938c190eeabf87b3018e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 12 Nov 2024 10:24:20 +0000 Subject: [PATCH 18/20] Add more detail for the alpha beta second model and add graph --- .../plasma_alpha_beta_contribution.md | 101 ++++++++++++++++-- 1 file changed, 91 insertions(+), 10 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md b/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md index 7b1a018b..64fe5391 100644 --- a/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md +++ b/documentation/proc-pages/physics-models/plasma_beta/plasma_alpha_beta_contribution.md @@ -5,6 +5,88 @@ This sets the value of the physics variable, `beta_fast_alpha`. A contribution from fast alphas to the total plasma pressure can be relatively high (~ 10-30%) for fusion temperatures of interest Because the maximum volume-averaged beta achievable in a tokamak is limited by magnetohydrrdynamic (MHD) instabilities (e.g.,ballooning and kink modes), the presence of fast alphas, if $\langle \beta_{\text{tot}} \rangle$ is constant, reduces the background thermal plasma pressure. Furthermore, the energetic alpha population can influence (favorably or unfavorably) the bulk plasma ballooning mode stability boundaries[^2]. +A comaprison between the two avaialbe scalings can be experimented with below: + + + + + + + +My Bokeh Plot + + + + + + + + + + + + + + + + + + + +
          + + + + + + + + + + + + +Both available models are truncated so that they return a value for $\frac{\beta_{\alpha}}{\beta_{\text{th}}}$ no less than 0.3. This value is then multiplied by the internally calcualted value fo the thermal beta $\beta_{\text{th}}$, using the ion and electron desnity weighted temperatures. The value is then scaled by the fraction of total alpha power vs alpha power produced internally by the plasma to account for additional alpha pressure produced by beam-plasma interactions. + ---------------------- ## IPDG89 model @@ -64,8 +146,8 @@ $$ The above derivation form is not that explicitly given in IPDG89[^1] and `PROCESS`. Terms for the electron and DT fuel ion species have been added back in. The $\left(\langle T_{\text{10}}\rangle-0.37\right)$ term still remains. $$ -\frac{\beta_{\alpha}}{\beta_{th}} = 0.29 \, \left( \langle T_{10} \rangle - -0.37 \right) \, \left( \frac{n_{\text{DT}}}{n_{\text{e}}} \right)^2 +\beta_{\alpha} =\beta_{\text{th}}\left[0.29 \, \left( \frac{\langle T_{10} \rangle}{20} - +0.37 \right) \, \left( \frac{n_{\text{DT}}}{n_{\text{e}}} \right)^2\right] $$ For $Z_{\text{eff}} \approx 1.5, T_{\text{i}}/T_{\text{e}} \approx 1, \langle T \rangle \approx 5-20 \text{keV}$ @@ -73,23 +155,22 @@ For $Z_{\text{eff}} \approx 1.5, T_{\text{i}}/T_{\text{e}} \approx 1, \langle T ----------------------- -## H.Lux model +## Ward model This model can be used by setting: `ifalphap` = 1 (default)[^3] +IPDG89[^1] estimates the pressure in the fast alpha particles. Based on transport code modelling however, looking at the data for local values in IPDG89[^1] this expression overestimates at high temperatures. A better fit to the result at higher temperature is: + $$ -\frac{\beta_{\alpha}}{\beta_{th}} = 0.26 \, \left( \langle T_{10} \rangle - -0.65 \right)^{0.5} \, \left( \frac{n_{DT}}{n_e} \right)^2 +\beta_{\alpha} =\beta_{\text{th}} \left[0.26 \, \left( \frac{\langle T_{10} \rangle}{20} - +0.65 \right)^{0.5} \, \left( \frac{n_{\text{DT}}}{n_{\text{e}}} \right)^2\right] $$ +The new fit is much better at higher temperature because it more reliably captures the effect of saturation of fusion cross section with increasing temperature. The new fit cannot be used below peak temperatures of around 15 keV however. -The latter model is a better estimate at higher temperatures. [^1]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', https://inis.iaea.org/collection/NCLCollectionStore/_Public/21/068/21068960.pdf - [^2]: Uckan, N. A., Tolliver, J. S., Houlberg, W. A., and Attenberger, S. E. Influence of fast alpha diffusion and thermal alpha buildup on tokamak reactor performance. United States: N. p., 1987. Web.https://www.osti.gov/servlets/purl/5611706 - -[^3]: H. Lux, R. Kemp, D.J. Ward, M. Sertoli, 'Impurity radiation in DEMO -systems modelling', Fus. Eng. | Des. **101**, 42-51 (2015) \ No newline at end of file +[^3]: D.J. Ward, 'PROCESS Fast Alpha Pressure', Work File Note F/PL/PJK/PROCESS/CODE/050 \ No newline at end of file From be43a4ed038710cd19eab63bb505d9f6dd82bfe0 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 14 Nov 2024 11:14:12 +0000 Subject: [PATCH 19/20] Rename 'betap' to 'beta_poloidal' in BootstrapFraction parameter classes for clarity to account for new bootstrap scalings --- process/physics.py | 48 +++++++++++++++++++------------------- tests/unit/test_physics.py | 36 ++++++++++++++-------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/process/physics.py b/process/physics.py index 0ceee3e8..27dfee6e 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1778,7 +1778,7 @@ def physics(self): current_drive_variables.bscf_aries = ( current_drive_variables.cboot * self.bootstrap_fraction_aries( - betap=physics_variables.betap, + beta_poloidal=physics_variables.beta_poloidal, rli=physics_variables.rli, core_density=physics_variables.ne0, average_density=physics_variables.dene, @@ -1789,7 +1789,7 @@ def physics(self): current_drive_variables.bscf_andrade = ( current_drive_variables.cboot * self.bootstrap_fraction_andrade( - betap=physics_variables.betap, + beta_poloidal=physics_variables.beta_poloidal, core_pressure=physics_variables.p0, average_pressure=physics_variables.vol_avg_pressure, inverse_aspect=physics_variables.eps, @@ -1798,7 +1798,7 @@ def physics(self): current_drive_variables.bscf_hoang = ( current_drive_variables.cboot * self.bootstrap_fraction_hoang( - betap=physics_variables.betap, + beta_poloidal=physics_variables.beta_poloidal, pressure_index=physics_variables.alphap, current_index=physics_variables.alphaj, inverse_aspect=physics_variables.eps, @@ -1807,7 +1807,7 @@ def physics(self): current_drive_variables.bscf_wong = ( current_drive_variables.cboot * self.bootstrap_fraction_wong( - betap=physics_variables.betap, + beta_poloidal=physics_variables.beta_poloidal, density_index=physics_variables.alphan, temperature_index=physics_variables.alphat, inverse_aspect=physics_variables.eps, @@ -1817,7 +1817,7 @@ def physics(self): current_drive_variables.bscf_gi_I = ( current_drive_variables.cboot * self.bootstrap_fraction_gi_I( - betap=physics_variables.betap, + beta_poloidal=physics_variables.beta_poloidal, pressure_index=physics_variables.alphap, temperature_index=physics_variables.alphat, inverse_aspect=physics_variables.eps, @@ -1830,7 +1830,7 @@ def physics(self): current_drive_variables.bscf_gi_II = ( current_drive_variables.cboot * self.bootstrap_fraction_gi_II( - betap=physics_variables.betap, + beta_poloidal=physics_variables.beta_poloidal, pressure_index=physics_variables.alphap, temperature_index=physics_variables.alphat, inverse_aspect=physics_variables.eps, @@ -5990,7 +5990,7 @@ def bootstrap_fraction_sakai( @staticmethod def bootstrap_fraction_aries( - betap: float, + beta_poloidal: float, rli: float, core_density: float, average_density: float, @@ -6000,7 +6000,7 @@ def bootstrap_fraction_aries( Calculate the bootstrap fraction using the ARIES formula. Parameters: - betap (float): Plasma poloidal beta. + beta_poloidal (float): Plasma poloidal beta. rli (float): Plasma normalized internal inductance. core_density (float): Core plasma density. average_density (float): Average plasma density. @@ -6024,11 +6024,11 @@ def bootstrap_fraction_aries( c_bs = a_1 + b_1 * (core_density / average_density) - return c_bs * np.sqrt(inverse_aspect) * betap + return c_bs * np.sqrt(inverse_aspect) * beta_poloidal @staticmethod def bootstrap_fraction_andrade( - betap: float, + beta_poloidal: float, core_pressure: float, average_pressure: float, inverse_aspect: float, @@ -6037,7 +6037,7 @@ def bootstrap_fraction_andrade( Calculate the bootstrap fraction using the Andrade et al formula. Parameters: - betap (float): Plasma poloidal beta. + beta_poloidal (float): Plasma poloidal beta. core_pressure (float): Core plasma pressure. average_pressure (float): Average plasma pressure. inverse_aspect (float): Inverse aspect ratio. @@ -6064,11 +6064,11 @@ def bootstrap_fraction_andrade( # Error +- 0.0007 c_bs = 0.2340 - return c_bs * np.sqrt(inverse_aspect) * betap * c_p**0.8 + return c_bs * np.sqrt(inverse_aspect) * beta_poloidal * c_p**0.8 @staticmethod def bootstrap_fraction_hoang( - betap: float, + beta_poloidal: float, pressure_index: float, current_index: float, inverse_aspect: float, @@ -6077,7 +6077,7 @@ def bootstrap_fraction_hoang( Calculate the bootstrap fraction using the Hoang et al formula. Parameters: - betap (float): Plasma poloidal beta. + beta_poloidal (float): Plasma poloidal beta. pressure_index (float): Pressure profile index. current_index (float): Current profile index. inverse_aspect (float): Inverse aspect ratio. @@ -6110,11 +6110,11 @@ def bootstrap_fraction_hoang( c_bs = np.sqrt((pressure_index + 1) / (current_index + 1)) - return 0.4 * np.sqrt(inverse_aspect) * betap**0.9 * c_bs + return 0.4 * np.sqrt(inverse_aspect) * beta_poloidal**0.9 * c_bs @staticmethod def bootstrap_fraction_wong( - betap: float, + beta_poloidal: float, density_index: float, temperature_index: float, inverse_aspect: float, @@ -6124,7 +6124,7 @@ def bootstrap_fraction_wong( Calculate the bootstrap fraction using the Wong et al formula. Parameters: - betap (float): Plasma poloidal beta. + beta_poloidal (float): Plasma poloidal beta. density_index (float): Density profile index. temperature_index (float): Temperature profile index. inverse_aspect (float): Inverse aspect ratio. @@ -6153,11 +6153,11 @@ def bootstrap_fraction_wong( c_bs = 0.773 + 0.019 * elongation - return c_bs * f_peak**0.25 * betap * np.sqrt(inverse_aspect) + return c_bs * f_peak**0.25 * beta_poloidal * np.sqrt(inverse_aspect) @staticmethod def bootstrap_fraction_gi_I( - betap: float, + beta_poloidal: float, pressure_index: float, temperature_index: float, inverse_aspect: float, @@ -6169,7 +6169,7 @@ def bootstrap_fraction_gi_I( Calculate the bootstrap fraction using the first scaling from the Gi et al formula. Parameters: - betap (float): Plasma poloidal beta. + beta_poloidal (float): Plasma poloidal beta. pressure_index (float): Pressure profile index. temperature_index (float): Temperature profile index. inverse_aspect (float): Inverse aspect ratio. @@ -6207,11 +6207,11 @@ def bootstrap_fraction_gi_I( * (q95 / q0) ** -0.133 ) - return c_bs * np.sqrt(inverse_aspect) * betap + return c_bs * np.sqrt(inverse_aspect) * beta_poloidal @staticmethod def bootstrap_fraction_gi_II( - betap: float, + beta_poloidal: float, pressure_index: float, temperature_index: float, inverse_aspect: float, @@ -6221,7 +6221,7 @@ def bootstrap_fraction_gi_II( Calculate the bootstrap fraction using the second scaling from the Gi et al formula. Parameters: - betap (float): Plasma poloidal beta. + beta_poloidal (float): Plasma poloidal beta. pressure_index (float): Pressure profile index. temperature_index (float): Temperature profile index. inverse_aspect (float): Inverse aspect ratio. @@ -6256,7 +6256,7 @@ def bootstrap_fraction_gi_II( * effective_charge**0.178 ) - return c_bs * np.sqrt(inverse_aspect) * betap + return c_bs * np.sqrt(inverse_aspect) * beta_poloidal def fhfac(self, is_): """Function to find H-factor for power balance diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index e695d9a1..079a1219 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -569,7 +569,7 @@ def test_bootstrap_fraction_sakai(bootstrapfractionsakaiparam, monkeypatch, phys class BootstrapFractionAriesParam(NamedTuple): - betap: Any = None + beta_poloidal: Any = None rli: Any = None @@ -586,7 +586,7 @@ class BootstrapFractionAriesParam(NamedTuple): "bootstrapfractionariesparam", ( BootstrapFractionAriesParam( - betap=1.2708883332338736, + beta_poloidal=1.2708883332338736, rli=1.4279108047138775, core_density=1.0695994460047332e20, average_density=8.1317358967210131e19, @@ -606,7 +606,7 @@ def test_bootstrap_fraction_aries(bootstrapfractionariesparam, physics): """ bfs = physics.bootstrap_fraction_aries( - betap=bootstrapfractionariesparam.betap, + beta_poloidal=bootstrapfractionariesparam.beta_poloidal, rli=bootstrapfractionariesparam.rli, core_density=bootstrapfractionariesparam.core_density, average_density=bootstrapfractionariesparam.average_density, @@ -617,7 +617,7 @@ def test_bootstrap_fraction_aries(bootstrapfractionariesparam, physics): class BootstrapFractionAndradeParam(NamedTuple): - betap: Any = None + beta_poloidal: Any = None core_pressure: Any = None @@ -632,7 +632,7 @@ class BootstrapFractionAndradeParam(NamedTuple): "bootstrapfractionandradeparam", ( BootstrapFractionAndradeParam( - betap=1.2708883332338736, + beta_poloidal=1.2708883332338736, core_pressure=8.3049163275475602e05, average_pressure=2.4072221239268288e05, inverse_aspect=1 / 3, @@ -651,7 +651,7 @@ def test_bootstrap_fraction_andrade(bootstrapfractionandradeparam, physics): """ bfs = physics.bootstrap_fraction_andrade( - betap=bootstrapfractionandradeparam.betap, + beta_poloidal=bootstrapfractionandradeparam.beta_poloidal, core_pressure=bootstrapfractionandradeparam.core_pressure, average_pressure=bootstrapfractionandradeparam.average_pressure, inverse_aspect=bootstrapfractionandradeparam.inverse_aspect, @@ -661,7 +661,7 @@ def test_bootstrap_fraction_andrade(bootstrapfractionandradeparam, physics): class BootstrapFractionHoangParam(NamedTuple): - betap: Any = None + beta_poloidal: Any = None pressure_index: Any = None @@ -676,7 +676,7 @@ class BootstrapFractionHoangParam(NamedTuple): "bootstrapfractionhoangparam", ( BootstrapFractionHoangParam( - betap=1.2708883332338736, + beta_poloidal=1.2708883332338736, pressure_index=2.4500000000000002e00, current_index=2.8314361644755763e00, inverse_aspect=1 / 3, @@ -695,7 +695,7 @@ def test_bootstrap_fraction_hoang(bootstrapfractionhoangparam, physics): """ bfs = physics.bootstrap_fraction_hoang( - betap=bootstrapfractionhoangparam.betap, + beta_poloidal=bootstrapfractionhoangparam.beta_poloidal, pressure_index=bootstrapfractionhoangparam.pressure_index, current_index=bootstrapfractionhoangparam.current_index, inverse_aspect=bootstrapfractionhoangparam.inverse_aspect, @@ -705,7 +705,7 @@ def test_bootstrap_fraction_hoang(bootstrapfractionhoangparam, physics): class BootstrapFractionWongParam(NamedTuple): - betap: Any = None + beta_poloidal: Any = None density_index: Any = None @@ -722,7 +722,7 @@ class BootstrapFractionWongParam(NamedTuple): "bootstrapfractionwongparam", ( BootstrapFractionWongParam( - betap=1.2708883332338736, + beta_poloidal=1.2708883332338736, density_index=1.0000000000000000e00, temperature_index=1.4500000000000000e00, inverse_aspect=1 / 3, @@ -742,7 +742,7 @@ def test_bootstrap_fraction_wong(bootstrapfractionwongparam, physics): """ bfs = physics.bootstrap_fraction_wong( - betap=bootstrapfractionwongparam.betap, + beta_poloidal=bootstrapfractionwongparam.beta_poloidal, density_index=bootstrapfractionwongparam.density_index, temperature_index=bootstrapfractionwongparam.temperature_index, inverse_aspect=bootstrapfractionwongparam.inverse_aspect, @@ -753,7 +753,7 @@ def test_bootstrap_fraction_wong(bootstrapfractionwongparam, physics): class BootstrapFractionGiIParam(NamedTuple): - betap: Any = None + beta_poloidal: Any = None pressure_index: Any = None @@ -774,7 +774,7 @@ class BootstrapFractionGiIParam(NamedTuple): "bootstrapfractiongiiparam", ( BootstrapFractionGiIParam( - betap=1.2708883332338736, + beta_poloidal=1.2708883332338736, pressure_index=2.4500000000000002e00, temperature_index=1.4500000000000000e00, inverse_aspect=1 / 3, @@ -796,7 +796,7 @@ def test_bootstrap_fraction_gi_I(bootstrapfractiongiiparam, physics): """ bfs = physics.bootstrap_fraction_gi_I( - betap=bootstrapfractiongiiparam.betap, + beta_poloidal=bootstrapfractiongiiparam.beta_poloidal, pressure_index=bootstrapfractiongiiparam.pressure_index, temperature_index=bootstrapfractiongiiparam.temperature_index, inverse_aspect=bootstrapfractiongiiparam.inverse_aspect, @@ -809,7 +809,7 @@ def test_bootstrap_fraction_gi_I(bootstrapfractiongiiparam, physics): class BootstrapFractionGiIIParam(NamedTuple): - betap: Any = None + beta_poloidal: Any = None pressure_index: Any = None @@ -826,7 +826,7 @@ class BootstrapFractionGiIIParam(NamedTuple): "bootstrapfractiongiiiparam", ( BootstrapFractionGiIIParam( - betap=1.2708883332338736, + beta_poloidal=1.2708883332338736, pressure_index=2.4500000000000002e00, temperature_index=1.4500000000000000e00, inverse_aspect=1 / 3, @@ -846,7 +846,7 @@ def test_bootstrap_fraction_gi_II(bootstrapfractiongiiiparam, physics): """ bfs = physics.bootstrap_fraction_gi_II( - betap=bootstrapfractiongiiiparam.betap, + beta_poloidal=bootstrapfractiongiiiparam.beta_poloidal, pressure_index=bootstrapfractiongiiiparam.pressure_index, temperature_index=bootstrapfractiongiiiparam.temperature_index, inverse_aspect=bootstrapfractiongiiiparam.inverse_aspect, From 6daf8c56b4116dbb9274a8624815c9b89e79bf72 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 26 Nov 2024 14:29:38 +0000 Subject: [PATCH 20/20] :memo: Update plasma beta documentation to clarify relationships and constraints --- .../physics-models/plasma_beta/plasma_beta.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md index bc0d172a..52ae2227 100644 --- a/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md +++ b/documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md @@ -137,7 +137,11 @@ Further details on the calculation of `alphaj` and `rli` is given in [Plasma Cur This constraint can be activated by stating `icc = 1` in the input file. -Relationship between beta, temperature (keV) and density +Ensures the relationship between $\beta$, density, temperature and total magnetic field is withheld by checking the fixed input or iteration variable $\mathtt{beta}$ is consistent in value with the rest of the physics parameters + +$$ +\mathtt{beta} \equiv \frac{2\mu_0 \langle n_{\text{e}}T_{\text{e}}+n_{\text{i}}T_{\text{i}}\rangle}{B^2} + \beta_{\alpha} + \beta_{\text{beam}} +$$ **It is highly recommended to always have this constraint on as it is a global consistency checker** @@ -145,7 +149,7 @@ Relationship between beta, temperature (keV) and density ### Poloidal beta and inverse aspect upper limit -This constraint can be activated by stating `icc = 6` in the input file. +This constraint can be activated by stating `icc = 6` in the input file [^6]. To apply a limit to the value of $\epsilon\beta_p$, where $\epsilon = a/R$ is the inverse aspect ratio and $\beta_p$ is the poloidal $\beta$, constraint equation no. 6 should be @@ -158,12 +162,20 @@ is be set using input parameter `epbetmax`. This constraint can be activated by stating `icc = 24` in the input file. +It is the general setting of the $\beta$ limit depending on the $\beta_{\text{N}}$ value calculated in the [beta limit](#beta-limit) calculations. + +The upper limit value of beta is calculated by `calculate_beta_limit()`. The scaling value `fbetatry` can be varied also. + +**It is recommended to have this constraint on as it is a plasma stability model** + -------------------- ### Poloidal upper limit This constraint can be activated by stating `icc = 48` in the input file. +The value of `beta_poloidal_max` can be set to the desired maximum poloidal beta. The scaling value `fbeta_poloidal` can be varied also. + ------------------- ### Beta lower limit @@ -179,3 +191,5 @@ This constraint can be activated by stating `icc = 84` in the input file. [^4]: Menard et al. (2016), Nuclear Fusion, 56, 106023 [^5]: Tholerus et al. (2024), arXiv:2403.09460 + +[^6]: M. E. Mauel et al., “Operation at the tokamak equilibrium poloidal beta-limit in TFTR,” Nuclear Fusion, vol. 32, no. 8, pp. 1468–1473, Aug. 1992. doi:10.1088/0029-5515/32/8/i14