diff --git a/documentation/eng-models/heating_and_current_drive/NBI/culham_nb.md b/documentation/eng-models/heating_and_current_drive/NBI/culham_nb.md index c90c3c99b8..46f29d18c4 100644 --- a/documentation/eng-models/heating_and_current_drive/NBI/culham_nb.md +++ b/documentation/eng-models/heating_and_current_drive/NBI/culham_nb.md @@ -71,7 +71,7 @@ plus correction terms outlined in Culham Report AEA FUS 172. | $\mathtt{alphat}$, $\alpha_T$ | temperature profile factor | | $\mathtt{aspect}$, $A$ | aspect ratio | | $\mathtt{nd_plasma_electrons_vol_avg}$, $n_{\text{e}}$ | volume averaged electron density $(\text{m}^{-3})$ | -| $\mathtt{nd_electron_line}$, $n_{\text{e,0}}$ | line averaged electron density $(\text{m}^{-3})$ | +| $\mathtt{nd_plasma_electron_line}$, $n_{\text{e,0}}$ | line averaged electron density $(\text{m}^{-3})$ | | $\mathtt{e_beam_kev}$ | neutral beam energy $(\text{keV})$ | | $\mathtt{f_radius_beam_tangency_rmajor}$ | R_tangent / R_major for neutral beam injection | | $\mathtt{fshine}$ | shine-through fraction of beam | diff --git a/documentation/physics-models/fusion_reactions/beam_reactions.md b/documentation/physics-models/fusion_reactions/beam_reactions.md index 2907706a7c..7b12c755a8 100644 --- a/documentation/physics-models/fusion_reactions/beam_reactions.md +++ b/documentation/physics-models/fusion_reactions/beam_reactions.md @@ -103,8 +103,8 @@ Please see the [H&CD section](../../eng-models/heating_and_current_drive/heating 3. **Set the plasma tritium and ion densities** $$ - \mathtt{deuterium\_density = nd_fuel_ions * f\_deuterium\_plasma} \\ - \mathtt{tritium\_density = nd_fuel_ions * f\_tritium\_plasma} + \mathtt{deuterium\_density = nd_plasma_fuel_ions_vol_avg * f\_deuterium\_plasma} \\ + \mathtt{tritium\_density = nd_plasma_fuel_ions_vol_avg * f\_tritium\_plasma} $$ 4. **Calculate the beam alpha powers, density and deposited energy** diff --git a/documentation/physics-models/fusion_reactions/plasma_reactions.md b/documentation/physics-models/fusion_reactions/plasma_reactions.md index c95515085c..ca3b8922d4 100644 --- a/documentation/physics-models/fusion_reactions/plasma_reactions.md +++ b/documentation/physics-models/fusion_reactions/plasma_reactions.md @@ -55,10 +55,10 @@ profiles ## Setting of plasma fuel composition The fractional composition of the 'fuel' ions ($\text{D}$, $\text{T}$ and $^3\text{He}$) is -controlled using the three variables `f_deuterium`, `f_tritium` and `f_helium3`, respectively. +controlled using the three variables `f_plasma_fuel_deuterium`, `f_plasma_fuel_tritium` and `f_plasma_fuel_helium3`, respectively. More information about setting seeded impurities and simulating first wall sputtering can be found in the [composition and impurities section](../plasma_composition.md). -It is also possible to optimise on the deuterium-tritium fuel mixture ratio. For this, `f_tritium` **must** be set as an iteration variable with `ixc = 173`. More info can be found [here](#fuel-ions-mixture-self-consistency). +It is also possible to optimise on the deuterium-tritium fuel mixture ratio. For this, `f_plasma_fuel_tritium` **must** be set as an iteration variable with `ixc = 173`. More info can be found [here](#fuel-ions-mixture-self-consistency). !!! note "Reactions not calculated" @@ -238,7 +238,7 @@ The value of `big_q_plasma_min` can be set to the minimum desired $Q_{\text{plas This constraint can be activated by stating `icc = 92` in the input file. -This constraint should be activated if the user wishes to allow the ratio of the fuel ions to be iterated upon. For this, `f_tritium` has to be set as an iteration variable with `ixc = 173`. This constraint ensure that the summation of the fuel fractions always sums to 1.0 and will modify the other compositions depending on the value of `f_tritium`. +This constraint should be activated if the user wishes to allow the ratio of the fuel ions to be iterated upon. For this, `f_plasma_fuel_tritium` has to be set as an iteration variable with `ixc = 173`. This constraint ensure that the summation of the fuel fractions always sums to 1.0 and will modify the other compositions depending on the value of `f_plasma_fuel_tritium`. [^1]: H.-S. Bosch and G. M. Hale, “Improved formulas for fusion cross-sections and thermal reactivities,” Nuclear Fusion, vol. 32, no. 4, pp. 611–631, Apr. 1992, doi: https://doi.org/10.1088/0029-5515/32/4/i07. [^2]: I. P. E. G. on E. Drive and I. P. B. Editors, “Chapter 5: Physics of energetic ions,” Nuclear Fusion, vol. 39, no. 12, pp. 2471–2495, Dec. 1999, doi: https://doi.org/10.1088/0029-5515/39/12/305. diff --git a/documentation/physics-models/plasma_beta/plasma_beta.md b/documentation/physics-models/plasma_beta/plasma_beta.md index d49bff6c36..7ae8b4ffef 100644 --- a/documentation/physics-models/plasma_beta/plasma_beta.md +++ b/documentation/physics-models/plasma_beta/plasma_beta.md @@ -5,9 +5,19 @@ The efficiency of confinement of plasma pressure by the magnetic field is represented by the ratio: $$ -\beta = \frac{2\mu_0p}{B^2} +\beta(\rho) = \frac{2\mu_0p(\rho)}{\left(B(\rho)\right)^2} $$ +Where $\beta$ is a function of normalised minor radius across the plasma ($\rho$), due to the change in pressure and magnetic field strength. + +The standard $\beta$ term used for comparison and to represent the plasma as a whole in many calculations is the volume averaged value given by: + +$$ +\langle \beta \rangle = \frac{2\mu_0 \langle p \rangle}{\langle B \rangle^2} +$$ + +Where $\langle p \rangle$ is the volume averaged plasma pressure and $\langle B \rangle$ is the average field. + 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: @@ -92,6 +102,32 @@ $$ ------------------------ +## Definitions + +### Volume averaged thermal toroidal beta + +We define $B_{\text{T,on-axis}}$ as the toroidal field at the plasma major radius, $R_0$ + +$$ +\overbrace{\langle \beta_t \rangle_{\text{V}}}^{\texttt{beta_toroidal_thermal_vol_avg}} = \frac{2\mu_0 \overbrace{\langle p_{\text{thermal}} \rangle}^{\texttt{pres_plasma_thermal_vol_avg}}}{\underbrace{B_{\text{T,on-axis}}^2}_{\texttt{b_plasma_toroidal_on_axis}}} +$$ + +### Volume averaged thermal poloidal beta + + + +$$ +\overbrace{\langle \beta_p \rangle_{\text{V}}}^{\texttt{beta_poloidal_thermal_vol_avg}} = \frac{2\mu_0 \overbrace{\langle p_{\text{thermal}} \rangle}^{\texttt{pres_plasma_thermal_vol_avg}}}{\underbrace{\langle B_{\text{P,average}} \rangle^2}_{\texttt{b_plasma_poloidal_average}}} +$$ + +### Volume averaged thermal beta + +$$ +\overbrace{\langle \beta \rangle_{\text{V}}}^{\texttt{beta_thermal_vol_avg}} = \frac{2\mu_0 \overbrace{\langle p_{\text{thermal}} \rangle}^{\texttt{pres_plasma_thermal_vol_avg}}}{\sqrt{\langle B_{\text{P,average}} \rangle^2+B_{\text{T,on-axis}}^2}} +$$ + +------------------ + ## Troyon Beta Limit The Troyon plasma beta limit is given by[^0][^1]: @@ -350,7 +386,13 @@ This constraint can be activated by stating `icc = 1` in the input file. 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}} +\texttt{beta_total_vol_avg} \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}} +$$ + +Here the calculation of the volume averaged pressure of the ions and electrons has to use the density weighted temperature for each. This is because $\langle nT \rangle_{\text{V}} \neq \langle n \rangle_{\text{V}} \langle T \rangle_{\text{V}}$, where $\text{V}$ denotes the volume averaged value. The true value is, $\langle nT \rangle_{\text{V}} = \langle n \rangle_{\text{V}} \langle T \rangle_{\text{n}}$, where $\text{n}$ is the density weighted averaged. For example: + +$$ +\langle n_{\text{e}}T_{\text{e}} \rangle_{\text{V}} = \overbrace{\langle n_{\text{e}} \rangle_{\text{V}}}^{\texttt{nd_plasma_electrons_vol_avg}} \times \overbrace{\langle T_{\text{e}} \rangle_{\text{n}}}^{\texttt{temp_plasma_electron_density_weighted_kev}} $$ **It is highly recommended to always have this constraint on as it is a global consistency checker** @@ -403,7 +445,7 @@ The value of `beta_poloidal_max` can be set to the desired maximum poloidal beta This constraint can be activated by stating `icc = 84` in the input file. -The value of `beta_min` can be set to the desired minimum total beta. The scaling value `fbeta_min` can be varied also. +The value of `beta_vol_avg_min` can be set to the desired minimum total beta. The scaling value `fbeta_min` can be varied also. [^0]: 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. diff --git a/documentation/physics-models/plasma_composition.md b/documentation/physics-models/plasma_composition.md index 1b6a9faf0d..9abb7f93d6 100644 --- a/documentation/physics-models/plasma_composition.md +++ b/documentation/physics-models/plasma_composition.md @@ -36,7 +36,7 @@ using input array `f_nd_impurity_electrons(1,...,14)`. The available species alo As stated above, the number density fractions for hydrogen (all isotopes) and helium should not be set, as they are calculated by the code. This is to ensure plasma quasi-neutrality taking into account the fuel ratios -`f_deuterium`, `f_tritium` and `f_helium3`, and the alpha particle fraction `f_nd_alpha_electron` which may +`f_plasma_fuel_deuterium`, `f_plasma_fuel_tritium` and `f_plasma_fuel_helium3`, and the alpha particle fraction `f_nd_alpha_electron` which may be input by the user or selected as an iteration variable. !!! note "Location of impurities" @@ -59,7 +59,7 @@ All of the plasma composites are normally given as a fraction of the volume aver 1. **Alpha Ash Portion Calculation** - - Calculate the number density of alpha particles (`nd_alphas`) using the electron density (`nd_plasma_electrons_vol_avg`) and the alpha particle to electron ratio (`f_nd_alpha_electron`). + - Calculate the number density of alpha particles (`nd_plasma_alphas_vol_avg`) using the electron density (`nd_plasma_electrons_vol_avg`) and the alpha particle to electron ratio (`f_nd_alpha_electron`). - `f_nd_alpha_electron` can be set as an iteration variable (`ixc = 109`) or set directly. $$ @@ -68,19 +68,19 @@ All of the plasma composites are normally given as a fraction of the volume aver 2. **Protons Calculation** - - The calculation of proton density (`nd_protons`) depends on whether the alpha rate density has been calculated. This should only happen in the first function call as the rates are calculated later on in the code. + - The calculation of proton density (`nd_plasma_protons_vol_avg`) depends on whether the alpha rate density has been calculated. This should only happen in the first function call as the rates are calculated later on in the code. - If the alpha rate density is not yet calculated, use a rough estimate. $$ - \texttt{nd_protons} | n_{\text{p}} = \\ + \texttt{nd_plasma_protons_vol_avg} | n_{\text{p}} = \\ \text{max}\left[\texttt{f_nd_protium_electrons} \times n_{\text{e}}, n_{\alpha}\times \left(f_{\text{3He}} + 0.001\right)\right] $$ - Otherwise, use the calculated proton rate density. $$ - \texttt{nd_protons} | n_{\text{p}} = \\ + \texttt{nd_plasma_protons_vol_avg} | n_{\text{p}} = \\ \text{max}\left[\texttt{f_nd_protium_electrons} \times n_{\text{e}}, n_{\alpha}\times \frac{r_{\text{p}}}{r_{\alpha,\text{total}}}\right] $$ @@ -116,7 +116,7 @@ All of the plasma composites are normally given as a fraction of the volume aver \mathtt{nd\_fuel\_ions} | n_{\text{i}} = \frac{\mathtt{znfuel}}{1+f_{\text{3He}}} $$ - - Calculate the fuel ion density (`nd_fuel_ions`). + - Calculate the fuel ion density (`nd_plasma_fuel_ions_vol_avg`). 7. **Set Hydrogen and Helium Impurity Fractions** @@ -132,7 +132,7 @@ All of the plasma composites are normally given as a fraction of the volume aver 8. **Total Impurity Density Calculation** - - Calculate the total impurity density (`nd_impurities`). + - Calculate the total impurity density (`nd_plasma_impurities_vol_avg`). $$ \mathtt{nd\_impurities} | n_{\text{impurities}} = \sum_j n_{\text{e}} f_j @@ -140,7 +140,7 @@ All of the plasma composites are normally given as a fraction of the volume aver 9. **Total Ion Density Calculation** - - Calculate the total ion density (`nd_ions_total`). + - Calculate the total ion density (`nd_plasma_ions_total_vol_avg`). $$ \mathtt{nd\_ions\_total} | n_{\text{i,total}} = n_{\text{i}} + n_{\alpha}+n_{\text{protons}}+ n_{\text{beam}}+n_{\text{impurities}} diff --git a/documentation/physics-models/profiles/plasma_density_profile.md b/documentation/physics-models/profiles/plasma_density_profile.md index 867de97cf2..2193f7f8a1 100644 --- a/documentation/physics-models/profiles/plasma_density_profile.md +++ b/documentation/physics-models/profiles/plasma_density_profile.md @@ -13,7 +13,7 @@ The density profile class is organised around a central runner function that is ### Calculate core values | `set_physics_variables()` The core electron density is calculated using the [`ncore`](plasma_density_profile.md#electron-core-density-of-a-pedestalised-profile--ncore) method. -The core ion density is then set from $n_{\text{i}}$ (`nd_ions_total`) which is the total ion density such as: +The core ion density is then set from $n_{\text{i}}$ (`nd_plasma_ions_total_vol_avg`) which is the total ion density such as: $$ n_{\text{i0}} = \left(\frac{n_\text{i}}{n_\text{e}}\right)n_{\text{e0}} diff --git a/documentation/physics-models/profiles/plasma_profiles.md b/documentation/physics-models/profiles/plasma_profiles.md index 136d1927a8..93ca6922e9 100644 --- a/documentation/physics-models/profiles/plasma_profiles.md +++ b/documentation/physics-models/profiles/plasma_profiles.md @@ -282,23 +282,23 @@ The line averaged density is then calculated for the profile paramaters Line averaged electron density is calculated by integrating the profile across the normalised width of the profile and then dividing by the width of the integration bounds $$ -\overbrace{\bar{n_{\text{e}}}}^{\texttt{nd_electron_line}} = \frac{\int^1_0 n_0(1-\rho^2)^{\alpha_n} \ d\rho}{\rho} +\overbrace{\bar{n_{\text{e}}}}^{\texttt{nd_plasma_electron_line}} = \frac{\int^1_0 n_0(1-\rho^2)^{\alpha_n} \ d\rho}{\rho} $$ This can be more easily represented in radial coordinates and returning $\rho = \frac{r}{a}$ $$ -\overbrace{\bar{n_{\text{e}}}}^{\texttt{nd_electron_line}} = \frac{\int^a_0 n_0(1-r^2/a^2)^{\alpha_n} \ dr}{a} +\overbrace{\bar{n_{\text{e}}}}^{\texttt{nd_plasma_electron_line}} = \frac{\int^a_0 n_0(1-r^2/a^2)^{\alpha_n} \ dr}{a} $$ $$ -\overbrace{\bar{n_{\text{e}}}}^{\texttt{nd_electron_line}} = \frac{\left[\frac{an_0}{2}\frac{\Gamma(1/2)\Gamma(\alpha_n+1)}{\Gamma(\alpha_n+3/2)}\right]}{a} +\overbrace{\bar{n_{\text{e}}}}^{\texttt{nd_plasma_electron_line}} = \frac{\left[\frac{an_0}{2}\frac{\Gamma(1/2)\Gamma(\alpha_n+1)}{\Gamma(\alpha_n+3/2)}\right]}{a} $$ $\Gamma$ is the [gamma function](https://en.wikipedia.org/wiki/Gamma_function) and is calculated in the code with [scipy.special.gamma()](https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gamma.html) $$ -\overbrace{\bar{n_{\text{e}}}}^{\texttt{nd_electron_line}} = \frac{n_0}{2}\frac{\Gamma(1/2)\Gamma(\alpha_n+1)}{\Gamma(\alpha_n+3/2)} +\overbrace{\bar{n_{\text{e}}}}^{\texttt{nd_plasma_electron_line}} = \frac{n_0}{2}\frac{\Gamma(1/2)\Gamma(\alpha_n+1)}{\Gamma(\alpha_n+3/2)} $$ This is in agreement with the derivation from the ITER Physics Design 1989 [^2] @@ -385,7 +385,7 @@ $$\begin{aligned} $$\begin{aligned} \texttt{nd_plasma_electron_on_axis} = n_{\text{e}} \times (\alpha_n+1) \\ -\texttt{nd_plasma_ions_on_axis} = \texttt{nd_ions_total} \times (\alpha_n+1) +\texttt{nd_plasma_ions_on_axis} = \texttt{nd_plasma_ions_total_vol_avg} \times (\alpha_n+1) \end{aligned}$$ ----- @@ -605,7 +605,7 @@ $$ Calculate the line averaged electron density by integrating the normalised profile using the class [`integrate_profile_y()`](./plasma_profiles_abstract_class.md#calculate-the-profile-integral-value-integrate_profile_y) function $$ -\texttt{nd_electron_line} = \int_0^1{n(\rho) \ d\rho} +\texttt{nd_plasma_electron_line} = \int_0^1{n(\rho) \ d\rho} $$ A divertor variable `prn1` is set to be equal to the separatrix density over the mean density: diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 5007d37210..88f3853e18 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -342,8 +342,8 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_____________________________________________________ (beta_poloidal)_______________________ 1.2531E+00 OP + Total_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.6055E-02 ITV + Total_poloidal_beta_____________________________________________________ (beta_poloidal_vol_avg)_______________________ 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 @@ -367,16 +367,16 @@ Electron_temp.,_density_weighted_(keV)__________________________________ (temp_plasma_electron_density_weighted_kev)_________________________ 1.3514E+01 Electron_density_(/m3)__________________________________________________ (nd_plasma_electrons_vol_avg)________________________ 8.0995E+19 ITV Electron_density_on_axis_(/m3)__________________________________________ (nd_plasma_electron_on_axis)_________________________ 1.0654E+20 OP - Line-averaged_electron_density_(/m3)____________________________________ (nd_electron_line)________________________ 8.9697E+19 OP + Line-averaged_electron_density_(/m3)____________________________________ (nd_plasma_electron_line)________________________ 8.9697E+19 OP Line-averaged_electron_density_/_Greenwald_density______________________ (dnla_gw)_____________________ 1.2000E+00 OP - Ion_density_(/m3)_______________________________________________________ (nd_ions_total)______________________ 7.2127E+19 OP - Fuel_density_(/m3)______________________________________________________ (nd_fuel_ions)________________________ 6.5392E+19 OP - Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_impurities)_________________________ 4.6024E+16 OP - Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_alphas)_______________________ 6.6709E+18 OP - Proton_density_(/m3)____________________________________________________ (nd_protons)______________________ 1.8502E+16 OP + Ion_density_(/m3)_______________________________________________________ (nd_plasma_ions_total_vol_avg)______________________ 7.2127E+19 OP + Fuel_density_(/m3)______________________________________________________ (nd_plasma_fuel_ions_vol_avgel_ions_vol_avg)________________________ 6.5392E+19 OP + Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_plasma_impurities_vol_avg)_________________________ 4.6024E+16 OP + Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_plasma_alphas_vol_avg_alphas_vol_avg)_______________________ 6.6709E+18 OP + Proton_density_(/m3)____________________________________________________ (nd_plasma_protons_vol_avg)______________________ 1.8502E+16 OP Hot_beam_density_(/m3)__________________________________________________ (nd_beam_ions)______________________ 0.0000E+00 OP - Density_limit_from_scaling_(/m3)________________________________________ (dnelimt)_____________________ 7.4748E+19 OP - Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*dnelimt)___________ 7.4748E+19 OP + Density_limit_from_scaling_(/m3)________________________________________ (nd_plasma_electron_maxma_electron_max)_____________________ 7.4748E+19 OP + Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*nd_plasma_electron_maxma_electron_max)___________ 7.4748E+19 OP Helium_ion_density_(thermalised_ions_only)_/_electron_density___________ (f_nd_alpha_electron)______________________ 8.2363E-02 ITV H__concentration________________________________________________________ (f_nd_impurity_electrons(01))____________________ 8.0759E-01 OP He_concentration________________________________________________________ (f_nd_impurity_electrons(02))____________________ 8.2363E-02 @@ -406,13 +406,13 @@ Electron_density_at_separatrix_/_nGW____________________________________ (fgwsep_out)__________________ 5.0000E-01 Temperature_profile_index_______________________________________________ (alphat)______________________ 1.4500E+00 Temperature_profile_index_beta__________________________________________ (tbeta)_______________________ 2.0000E+00 - Old_ASDEX_model_________________________________________________________ (dlimit(1))___________________ 5.2107E+19 OP - Borrass_ITER_model_I____________________________________________________ (dlimit(2))___________________ 1.0653E+20 OP - Borrass_ITER_model_II___________________________________________________ (dlimit(3))___________________ 4.1967E+19 OP - JET_edge_radiation_model________________________________________________ (dlimit(4))___________________ 3.0404E+21 OP - JET_simplified_model____________________________________________________ (dlimit(5))___________________ 4.0490E+20 OP - Hugill-Murakami_Mq_model________________________________________________ (dlimit(6))___________________ 6.6879E+19 OP - Greenwald_model_________________________________________________________ (dlimit(7))___________________ 7.4748E+19 OP + Old_ASDEX_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(1))___________________ 5.2107E+19 OP + Borrass_ITER_model_I____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(2))___________________ 1.0653E+20 OP + Borrass_ITER_model_II___________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(3))___________________ 4.1967E+19 OP + JET_edge_radiation_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(4))___________________ 3.0404E+21 OP + JET_simplified_model____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(5))___________________ 4.0490E+20 OP + Hugill-Murakami_Mq_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(6))___________________ 6.6879E+19 OP + Greenwald_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(7))___________________ 7.4748E+19 OP Deuterium_fuel_fraction_________________________________________________ (fdeut)_______________________ 5.0000E-01 Tritium_fuel_fraction___________________________________________________ (ftrit)_______________________ 5.0000E-01 Total_fusion_power_(MW)_________________________________________________ (p_fusion_total_mw)______________________ 1.5926E+03 OP @@ -1216,8 +1216,8 @@ epsvmc = 1e-7 * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta -beta = 0.03 +ixc = 5 * beta_total_vol_avg +beta_total_vol_avg = 0.03 * Global power balance * *----------------------* diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index b93816bdb0..d63310ed55 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -343,8 +343,8 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP + Total_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.3648E-02 ITV + Total_poloidal_beta_____________________________________________________ (beta_poloidal_vol_avg)_______________________ 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 @@ -368,16 +368,16 @@ Electron_temp.,_density_weighted_(keV)__________________________________ (temp_plasma_electron_density_weighted_kev)_________________________ 1.3805E+01 Electron_density_(/m3)__________________________________________________ (nd_plasma_electrons_vol_avg)________________________ 8.0667E+19 ITV Electron_density_on_axis_(/m3)__________________________________________ (nd_plasma_electron_on_axis)_________________________ 1.0610E+20 OP - Line-averaged_electron_density_(/m3)____________________________________ (nd_electron_line)________________________ 8.9334E+19 OP + Line-averaged_electron_density_(/m3)____________________________________ (nd_plasma_electron_line)________________________ 8.9334E+19 OP Line-averaged_electron_density_/_Greenwald_density______________________ (dnla_gw)_____________________ 1.2000E+00 OP - Ion_density_(/m3)_______________________________________________________ (nd_ions_total)______________________ 7.1669E+19 OP - Fuel_density_(/m3)______________________________________________________ (nd_fuel_ions)________________________ 6.4831E+19 OP - Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_impurities)_________________________ 4.6503E+16 OP - Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_alphas)_______________________ 6.7723E+18 OP - Proton_density_(/m3)____________________________________________________ (nd_protons)______________________ 1.8963E+16 OP + Ion_density_(/m3)_______________________________________________________ (nd_plasma_ions_total_vol_avg)______________________ 7.1669E+19 OP + Fuel_density_(/m3)______________________________________________________ (nd_plasma_fuel_ions_vol_avgel_ions_vol_avg)________________________ 6.4831E+19 OP + Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_plasma_impurities_vol_avg)_________________________ 4.6503E+16 OP + Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_plasma_alphas_vol_avg_alphas_vol_avg)_______________________ 6.7723E+18 OP + Proton_density_(/m3)____________________________________________________ (nd_plasma_protons_vol_avg)______________________ 1.8963E+16 OP Hot_beam_density_(/m3)__________________________________________________ (nd_beam_ions)______________________ 0.0000E+00 OP - Density_limit_from_scaling_(/m3)________________________________________ (dnelimt)_____________________ 7.4445E+19 OP - Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*dnelimt)___________ 7.4445E+19 OP + Density_limit_from_scaling_(/m3)________________________________________ (nd_plasma_electron_max)_____________________ 7.4445E+19 OP + Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*nd_plasma_electron_max)___________ 7.4445E+19 OP Helium_ion_density_(thermalised_ions_only)_/_electron_density___________ (f_nd_alpha_electron)______________________ 8.3954E-02 ITV H__concentration________________________________________________________ (f_nd_impurity_electrons(01))____________________ 8.0392E-01 OP He_concentration________________________________________________________ (f_nd_impurity_electrons(02))____________________ 8.3954E-02 @@ -407,13 +407,13 @@ Electron_density_at_separatrix_/_nGW____________________________________ (fgwsep_out)__________________ 5.0000E-01 Temperature_profile_index_______________________________________________ (alphat)______________________ 1.4500E+00 Temperature_profile_index_beta__________________________________________ (tbeta)_______________________ 2.0000E+00 - Old_ASDEX_model_________________________________________________________ (dlimit(1))___________________ 5.2797E+19 OP - Borrass_ITER_model_I____________________________________________________ (dlimit(2))___________________ 1.0969E+20 OP - Borrass_ITER_model_II___________________________________________________ (dlimit(3))___________________ 4.3575E+19 OP - JET_edge_radiation_model________________________________________________ (dlimit(4))___________________ 3.0227E+21 OP - JET_simplified_model____________________________________________________ (dlimit(5))___________________ 4.3397E+20 OP - Hugill-Murakami_Mq_model________________________________________________ (dlimit(6))___________________ 6.6609E+19 OP - Greenwald_model_________________________________________________________ (dlimit(7))___________________ 7.4445E+19 OP + Old_ASDEX_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(1))___________________ 5.2797E+19 OP + Borrass_ITER_model_I____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(2))___________________ 1.0969E+20 OP + Borrass_ITER_model_II___________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(3))___________________ 4.3575E+19 OP + JET_edge_radiation_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(4))___________________ 3.0227E+21 OP + JET_simplified_model____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(5))___________________ 4.3397E+20 OP + Hugill-Murakami_Mq_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(6))___________________ 6.6609E+19 OP + Greenwald_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(7))___________________ 7.4445E+19 OP Deuterium_fuel_fraction_________________________________________________ (fdeut)_______________________ 5.0000E-01 Tritium_fuel_fraction___________________________________________________ (ftrit)_______________________ 5.0000E-01 Total_fusion_power_(MW)_________________________________________________ (p_fusion_total_mw)______________________ 1.6202E+03 OP @@ -1211,8 +1211,8 @@ epsvmc = 1e-7 * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta -beta = 0.03 +ixc = 5 * beta_total_vol_avg +beta_total_vol_avg = 0.03 * Global power balance * *----------------------* diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 4c2cf34cd6..775c47aa6f 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -343,8 +343,8 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP + Total_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.3648E-02 ITV + Total_poloidal_beta_____________________________________________________ (beta_poloidal_vol_avg)_______________________ 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 @@ -368,16 +368,16 @@ Electron_temp.,_density_weighted_(keV)__________________________________ (temp_plasma_electron_density_weighted_kev)_________________________ 1.3805E+01 Electron_density_(/m3)__________________________________________________ (nd_plasma_electrons_vol_avg)________________________ 8.0667E+19 ITV Electron_density_on_axis_(/m3)__________________________________________ (nd_plasma_electron_on_axis)_________________________ 1.0610E+20 OP - Line-averaged_electron_density_(/m3)____________________________________ (nd_electron_line)________________________ 8.9334E+19 OP + Line-averaged_electron_density_(/m3)____________________________________ (nd_plasma_electron_line)________________________ 8.9334E+19 OP Line-averaged_electron_density_/_Greenwald_density______________________ (dnla_gw)_____________________ 1.2000E+00 OP - Ion_density_(/m3)_______________________________________________________ (nd_ions_total)______________________ 7.1669E+19 OP - Fuel_density_(/m3)______________________________________________________ (nd_fuel_ions)________________________ 6.4831E+19 OP - Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_impurities)_________________________ 4.6503E+16 OP - Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_alphas)_______________________ 6.7723E+18 OP - Proton_density_(/m3)____________________________________________________ (nd_protons)______________________ 1.8963E+16 OP + Ion_density_(/m3)_______________________________________________________ (nd_plasma_ions_total_vol_avg)______________________ 7.1669E+19 OP + Fuel_density_(/m3)______________________________________________________ (nd_plasma_fuel_ions_vol_avgel_ions_vol_avg)________________________ 6.4831E+19 OP + Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_plasma_impurities_vol_avg)_________________________ 4.6503E+16 OP + Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_plasma_alphas_vol_avg_alphas_vol_avg)_______________________ 6.7723E+18 OP + Proton_density_(/m3)____________________________________________________ (nd_plasma_protons_vol_avg)______________________ 1.8963E+16 OP Hot_beam_density_(/m3)__________________________________________________ (nd_beam_ions)______________________ 0.0000E+00 OP - Density_limit_from_scaling_(/m3)________________________________________ (dnelimt)_____________________ 7.4445E+19 OP - Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*dnelimt)___________ 7.4445E+19 OP + Density_limit_from_scaling_(/m3)________________________________________ (nd_plasma_electron_maxma_electron_max)_____________________ 7.4445E+19 OP + Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*nd_plasma_electron_maxma_electron_max)___________ 7.4445E+19 OP Helium_ion_density_(thermalised_ions_only)_/_electron_density___________ (f_nd_alpha_electron)______________________ 8.3954E-02 ITV H__concentration________________________________________________________ (f_nd_impurity_electrons(01))____________________ 8.0392E-01 OP He_concentration________________________________________________________ (f_nd_impurity_electrons(02))____________________ 8.3954E-02 @@ -407,13 +407,13 @@ Electron_density_at_separatrix_/_nGW____________________________________ (fgwsep_out)__________________ 5.0000E-01 Temperature_profile_index_______________________________________________ (alphat)______________________ 1.4500E+00 Temperature_profile_index_beta__________________________________________ (tbeta)_______________________ 2.0000E+00 - Old_ASDEX_model_________________________________________________________ (dlimit(1))___________________ 5.2797E+19 OP - Borrass_ITER_model_I____________________________________________________ (dlimit(2))___________________ 1.0969E+20 OP - Borrass_ITER_model_II___________________________________________________ (dlimit(3))___________________ 4.3575E+19 OP - JET_edge_radiation_model________________________________________________ (dlimit(4))___________________ 3.0227E+21 OP - JET_simplified_model____________________________________________________ (dlimit(5))___________________ 4.3397E+20 OP - Hugill-Murakami_Mq_model________________________________________________ (dlimit(6))___________________ 6.6609E+19 OP - Greenwald_model_________________________________________________________ (dlimit(7))___________________ 7.4445E+19 OP + Old_ASDEX_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(1))___________________ 5.2797E+19 OP + Borrass_ITER_model_I____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(2))___________________ 1.0969E+20 OP + Borrass_ITER_model_II___________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(3))___________________ 4.3575E+19 OP + JET_edge_radiation_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(4))___________________ 3.0227E+21 OP + JET_simplified_model____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(5))___________________ 4.3397E+20 OP + Hugill-Murakami_Mq_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(6))___________________ 6.6609E+19 OP + Greenwald_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(7))___________________ 7.4445E+19 OP Deuterium_fuel_fraction_________________________________________________ (fdeut)_______________________ 5.0000E-01 Tritium_fuel_fraction___________________________________________________ (ftrit)_______________________ 5.0000E-01 Total_fusion_power_(MW)_________________________________________________ (p_fusion_total_mw)______________________ 1.6202E+03 OP @@ -1211,8 +1211,8 @@ epsvmc = 1e-7 * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta -beta = 0.03 +ixc = 5 * beta_total_vol_avg +beta_total_vol_avg = 0.03 * Global power balance * *----------------------* diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 138d7f813d..d859ed92ce 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -343,8 +343,8 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP + Total_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.3648E-02 ITV + Total_poloidal_beta_____________________________________________________ (beta_poloidal_vol_avg)_______________________ 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 @@ -368,16 +368,16 @@ Electron_temp.,_density_weighted_(keV)__________________________________ (temp_plasma_electron_density_weighted_kev)_________________________ 1.3805E+01 Electron_density_(/m3)__________________________________________________ (nd_plasma_electrons_vol_avg)________________________ 8.0667E+19 ITV Electron_density_on_axis_(/m3)__________________________________________ (nd_plasma_electron_on_axis)_________________________ 1.0610E+20 OP - Line-averaged_electron_density_(/m3)____________________________________ (nd_electron_line)________________________ 8.9334E+19 OP + Line-averaged_electron_density_(/m3)____________________________________ (nd_plasma_electron_line)________________________ 8.9334E+19 OP Line-averaged_electron_density_/_Greenwald_density______________________ (dnla_gw)_____________________ 1.2000E+00 OP - Ion_density_(/m3)_______________________________________________________ (nd_ions_total)______________________ 7.1669E+19 OP - Fuel_density_(/m3)______________________________________________________ (nd_fuel_ions)________________________ 6.4831E+19 OP - Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_impurities)_________________________ 4.6503E+16 OP - Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_alphas)_______________________ 6.7723E+18 OP + Ion_density_(/m3)_______________________________________________________ (nd_plasma_ions_total_vol_avg)______________________ 7.1669E+19 OP + Fuel_density_(/m3)______________________________________________________ (nd_plasma_fuel_ions_vol_avgel_ions_vol_avg)________________________ 6.4831E+19 OP + Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_plasma_impurities_vol_avg)_________________________ 4.6503E+16 OP + Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_plasma_alphas_vol_avg_alphas_vol_avg)_______________________ 6.7723E+18 OP Proton_density_(/m3)____________________________________________________ (nd_protonstons)______________________ 1.8963E+16 OP Hot_beam_density_(/m3)__________________________________________________ (nd_beam_ions)______________________ 0.0000E+00 OP - Density_limit_from_scaling_(/m3)________________________________________ (dnelimt)_____________________ 7.4445E+19 OP - Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*dnelimt)___________ 7.4445E+19 OP + Density_limit_from_scaling_(/m3)________________________________________ (nd_plasma_electron_maxma_electron_max)_____________________ 7.4445E+19 OP + Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*nd_plasma_electron_maxma_electron_max)___________ 7.4445E+19 OP Helium_ion_density_(thermalised_ions_only)_/_electron_density___________ (f_nd_alpha_electron)______________________ 8.3954E-02 ITV H__concentration________________________________________________________ (f_nd_impurity_electrons(01))____________________ 8.0392E-01 OP He_concentration________________________________________________________ (f_nd_impurity_electrons(02))____________________ 8.3954E-02 @@ -407,13 +407,13 @@ Electron_density_at_separatrix_/_nGW____________________________________ (fgwsep_out)__________________ 5.0000E-01 Temperature_profile_index_______________________________________________ (alphat)______________________ 1.4500E+00 Temperature_profile_index_beta__________________________________________ (tbeta)_______________________ 2.0000E+00 - Old_ASDEX_model_________________________________________________________ (dlimit(1))___________________ 5.2797E+19 OP - Borrass_ITER_model_I____________________________________________________ (dlimit(2))___________________ 1.0969E+20 OP - Borrass_ITER_model_II___________________________________________________ (dlimit(3))___________________ 4.3575E+19 OP - JET_edge_radiation_model________________________________________________ (dlimit(4))___________________ 3.0227E+21 OP - JET_simplified_model____________________________________________________ (dlimit(5))___________________ 4.3397E+20 OP - Hugill-Murakami_Mq_model________________________________________________ (dlimit(6))___________________ 6.6609E+19 OP - Greenwald_model_________________________________________________________ (dlimit(7))___________________ 7.4445E+19 OP + Old_ASDEX_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(1))___________________ 5.2797E+19 OP + Borrass_ITER_model_I____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(2))___________________ 1.0969E+20 OP + Borrass_ITER_model_II___________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(3))___________________ 4.3575E+19 OP + JET_edge_radiation_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(4))___________________ 3.0227E+21 OP + JET_simplified_model____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(5))___________________ 4.3397E+20 OP + Hugill-Murakami_Mq_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(6))___________________ 6.6609E+19 OP + Greenwald_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(7))___________________ 7.4445E+19 OP Deuterium_fuel_fraction_________________________________________________ (fdeut)_______________________ 5.0000E-01 Tritium_fuel_fraction___________________________________________________ (ftrit)_______________________ 5.0000E-01 Total_fusion_power_(MW)_________________________________________________ (p_fusion_total_mw)______________________ 1.6202E+03 OP @@ -1211,8 +1211,8 @@ epsvmc = 1e-7 * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta -beta = 0.03 +ixc = 5 * beta_total_vol_avg +beta_total_vol_avg = 0.03 * Global power balance * *----------------------* diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index bf82e9863e..45ae23dac8 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -343,8 +343,8 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_____________________________________________________ (beta_poloidal)_______________________ 1.2857E+00 OP + Total_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.3648E-02 ITV + Total_poloidal_beta_____________________________________________________ (beta_poloidal_vol_avg)_______________________ 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 @@ -368,16 +368,16 @@ Electron_temp.,_density_weighted_(keV)__________________________________ (temp_plasma_electron_density_weighted_kev)_________________________ 1.3805E+01 Electron_density_(/m3)__________________________________________________ (nd_plasma_electrons_vol_avg)________________________ 8.0667E+19 ITV Electron_density_on_axis_(/m3)__________________________________________ (nd_plasma_electron_on_axis)_________________________ 1.0610E+20 OP - Line-averaged_electron_density_(/m3)____________________________________ (nd_electron_line)________________________ 8.9334E+19 OP + Line-averaged_electron_density_(/m3)____________________________________ (nd_plasma_electron_line)________________________ 8.9334E+19 OP Line-averaged_electron_density_/_Greenwald_density______________________ (dnla_gw)_____________________ 1.2000E+00 OP - Ion_density_(/m3)_______________________________________________________ (nd_ions_total)______________________ 7.1669E+19 OP - Fuel_density_(/m3)______________________________________________________ (nd_fuel_ions)________________________ 6.4831E+19 OP - Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_impurities)_________________________ 4.6503E+16 OP - Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_alphas)_______________________ 6.7723E+18 OP - Proton_density_(/m3)____________________________________________________ (nd_protons)______________________ 1.8963E+16 OP + Ion_density_(/m3)_______________________________________________________ (nd_plasma_ions_total_vol_avg)______________________ 7.1669E+19 OP + Fuel_density_(/m3)______________________________________________________ (nd_plasma_fuel_ions_vol_avgel_ions_vol_avg)________________________ 6.4831E+19 OP + Total_impurity_density_with_Z_>_2_(no_He)_(/m3)_________________________ (nd_plasma_impurities_vol_avg)_________________________ 4.6503E+16 OP + Helium_ion_density_(thermalised_ions_only)_(/m3)________________________ (nd_plasma_alphas_vol_avg_alphas_vol_avg)_______________________ 6.7723E+18 OP + Proton_density_(/m3)____________________________________________________ (nd_plasma_protons_vol_avg)______________________ 1.8963E+16 OP Hot_beam_density_(/m3)__________________________________________________ (nd_beam_ions)______________________ 0.0000E+00 OP - Density_limit_from_scaling_(/m3)________________________________________ (dnelimt)_____________________ 7.4445E+19 OP - Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*dnelimt)___________ 7.4445E+19 OP + Density_limit_from_scaling_(/m3)________________________________________ (nd_plasma_electron_maxma_electron_max)_____________________ 7.4445E+19 OP + Density_limit_(enforced)_(/m3)__________________________________________ (boundu(9)*nd_plasma_electron_maxma_electron_max)___________ 7.4445E+19 OP Helium_ion_density_(thermalised_ions_only)_/_electron_density___________ (f_nd_alpha_electron)______________________ 8.3954E-02 ITV H__concentration________________________________________________________ (f_nd_impurity_electrons(01))____________________ 8.0392E-01 OP He_concentration________________________________________________________ (f_nd_impurity_electrons(02))____________________ 8.3954E-02 @@ -407,13 +407,13 @@ Electron_density_at_separatrix_/_nGW____________________________________ (fgwsep_out)__________________ 5.0000E-01 Temperature_profile_index_______________________________________________ (alphat)______________________ 1.4500E+00 Temperature_profile_index_beta__________________________________________ (tbeta)_______________________ 2.0000E+00 - Old_ASDEX_model_________________________________________________________ (dlimit(1))___________________ 5.2797E+19 OP - Borrass_ITER_model_I____________________________________________________ (dlimit(2))___________________ 1.0969E+20 OP - Borrass_ITER_model_II___________________________________________________ (dlimit(3))___________________ 4.3575E+19 OP - JET_edge_radiation_model________________________________________________ (dlimit(4))___________________ 3.0227E+21 OP - JET_simplified_model____________________________________________________ (dlimit(5))___________________ 4.3397E+20 OP - Hugill-Murakami_Mq_model________________________________________________ (dlimit(6))___________________ 6.6609E+19 OP - Greenwald_model_________________________________________________________ (dlimit(7))___________________ 7.4445E+19 OP + Old_ASDEX_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(1))___________________ 5.2797E+19 OP + Borrass_ITER_model_I____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(2))___________________ 1.0969E+20 OP + Borrass_ITER_model_II___________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(3))___________________ 4.3575E+19 OP + JET_edge_radiation_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(4))___________________ 3.0227E+21 OP + JET_simplified_model____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(5))___________________ 4.3397E+20 OP + Hugill-Murakami_Mq_model________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(6))___________________ 6.6609E+19 OP + Greenwald_model_________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(7))___________________ 7.4445E+19 OP Deuterium_fuel_fraction_________________________________________________ (fdeut)_______________________ 5.0000E-01 Tritium_fuel_fraction___________________________________________________ (ftrit)_______________________ 5.0000E-01 Total_fusion_power_(MW)_________________________________________________ (p_fusion_total_mw)______________________ 1.6202E+03 OP @@ -1211,8 +1211,8 @@ epsvmc = 1e-7 * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta -beta = 0.03 +ixc = 5 * beta_total_vol_avg +beta_total_vol_avg = 0.03 * Global power balance * *----------------------* diff --git a/examples/data/large_tokamak_IN.DAT b/examples/data/large_tokamak_IN.DAT index 7eec25f7ed..da0321498c 100644 --- a/examples/data/large_tokamak_IN.DAT +++ b/examples/data/large_tokamak_IN.DAT @@ -23,8 +23,8 @@ epsvmc = 1e-7 * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta -beta = 0.03 +ixc = 5 * beta_total_vol_avg_total_vol_avg +beta_total_vol_avg =0.03 * Global power balance * *----------------------* diff --git a/examples/data/large_tokamak_eval_IN.DAT b/examples/data/large_tokamak_eval_IN.DAT index ed0111f838..710bf55d8c 100644 --- a/examples/data/large_tokamak_eval_IN.DAT +++ b/examples/data/large_tokamak_eval_IN.DAT @@ -279,7 +279,7 @@ zref(10) = 1.0 alphan = 1.00 * density profile index alphat = 1.45 * temperature profile index aspect = 3.0 * aspect ratio (`iteration variable 1`) -beta = 0.03230408815355488 * total plasma beta (`iteration variable 5`) (calculated if stellarator) +beta_total_vol_avg = 0.03230408815355488 * total plasma beta (`iteration variable 5`) (calculated if stellarator) b_plasma_toroidal_on_axis = 5.318322174644904 * toroidal field on axis (T) (`iteration variable 2`) nd_plasma_electrons_vol_avg = 7.796223900029837e+19 * electron density (/m3) (`iteration variable 6`) beta_norm_max = 3.0 * Troyon-like coefficient for beta scaling calculated diff --git a/examples/data/large_tokamak_nof_2_MFILE.DAT b/examples/data/large_tokamak_nof_2_MFILE.DAT index 9d375f7dbf..47eac702e1 100644 --- a/examples/data/large_tokamak_nof_2_MFILE.DAT +++ b/examples/data/large_tokamak_nof_2_MFILE.DAT @@ -201,18 +201,18 @@ Safety_factor_on_axis____________________________________________________ (q0)___________________________ 1.00000000000000000e+00 Safety_factor_at_95%_flux_surface________________________________________ (q95)__________________________ 3.73390781931285565e+00 Cylindrical_safety_factor_(qcyl)_________________________________________ (qstar)________________________ 4.12802018540024562e+00 OP - Upper_limit_on_thermal_beta______________________________________________ (beta_max)_____________________ 6.75897673577628422e-02 OP - Total_plasma_beta________________________________________________________ (beta)_________________________ 3.23040881535548857e-02 - Lower_limit_on_thermal_beta______________________________________________ (beta_min)_____________________ 0.00000000000000000e+00 IP + Upper_limit_on_thermal_beta______________________________________________ (beta_vol_avg_max_avg_max)_____________________ 6.75897673577628422e-02 OP + Total_plasma_beta________________________________________________________ (beta_total_vol_avg)_________________________ 3.23040881535548857e-02 + Lower_limit_on_thermal_beta______________________________________________ (beta_vol_avg_min_avg_min)_____________________ 0.00000000000000000e+00 IP Upper_limit_on_poloidal_beta_____________________________________________ (beta_poloidal_max)____________ 1.90000000000000002e-01 IP - Total_poloidal_beta______________________________________________________ (beta_poloidal)________________ 1.32822381700080405e+00 OP - Total_toroidal_beta______________________________________________________ (beta_toroidal)________________ 3.31093495352616854e-02 OP + Total_poloidal_beta______________________________________________________ (beta_poloidal_vol_avg)________________ 1.32822381700080405e+00 OP + Total_toroidal_beta______________________________________________________ (beta_toroidal_vol_avg)________________ 3.31093495352616854e-02 OP Fast_alpha_beta__________________________________________________________ (beta_fast_alpha)______________ 4.31753385900027382e-03 OP Neutral_Beam_ion_beta____________________________________________________ (beta_beam)____________________ 0.00000000000000000e+00 OP Ratio_of_fast_alpha_and_beam_beta_to_thermal_beta________________________ (f_beta_alpha_beam_thermal)____ 1.54271719682202629e-01 OP - Thermal_beta_____________________________________________________________ (beta_thermal)_________________ 2.79865542945546136e-02 OP - Thermal_poloidal_beta____________________________________________________ (beta_thermal_poloidal)________ 1.15070290153733867e+00 OP - Thermal_toroidal_beta____________________________________________________ (beta_thermal_toroidal)________ 2.86841901873654617e-02 OP + Thermal_beta_____________________________________________________________ (beta_thermal_vol_avg)_________________ 2.79865542945546136e-02 OP + Thermal_poloidal_beta____________________________________________________ (beta_thermal_poloidal_vol_avg)________ 1.15070290153733867e+00 OP + Thermal_toroidal_beta____________________________________________________ (beta_thermal_toroidal_vol_avg)________ 2.86841901873654617e-02 OP Poloidal_beta_and_inverse_aspect_ratio___________________________________ (beta_poloidal_eps)____________ 4.42741272333601332e-01 OP Poloidal_beta_and_inverse_aspect_ratio_upper_limit_______________________ (beta_poloidal_eps_max)________ 1.37999999999999989e+00 Beta_g_coefficient_______________________________________________________ (beta_norm_max)________________ 5.95715248137752251e+00 OP @@ -230,16 +230,16 @@ Electron_temp.,_density_weighted_(keV)___________________________________ (temp_plasma_electron_density_weighted_kev)__________________________ 1.34914174066700241e+01 OP Volume_averaged_electron_number_density_(/m3)____________________________ (nd_plasma_electrons_vol_avg)_________________________ 7.79622390002983731e+19 Electron_number_density_on_axis_(/m3)____________________________________ (nd_plasma_electron_on_axis)__________________________ 1.02466460344915771e+20 OP - Line-averaged_electron_number_density_(/m3)______________________________ (nd_electron_line)_________________________ 8.63127495812675338e+19 OP - Plasma_pressure_on_axis_(Pa)_____________________________________________ (pres_plasma_on_axis)___________________________ 7.82668759018785902e+05 OP - Volume_averaged_plasma_pressure_(Pa)_____________________________________ (pres_plasma_vol_avg)_____________ 2.26860509860517632e+05 OP + Line-averaged_electron_number_density_(/m3)______________________________ (nd_plasma_electron_line)_________________________ 8.63127495812675338e+19 OP + Plasma_pressure_on_axis_(Pa)_____________________________________________ (pres_plasma_thermal_on_axis)___________________________ 7.82668759018785902e+05 OP + Volume_averaged_plasma_pressure_(Pa)_____________________________________ (pres_plasma_thermal_vol_avg)_____________ 2.26860509860517632e+05 OP Line-averaged_electron_density_/_Greenwald_density_______________________ (dnla_gw)______________________ 1.19833068191158598e+00 OP - Total_Ion_number_density_(/m3)___________________________________________ (nd_ions_total)________________ 7.06084473006886912e+19 OP - Fuel_ion_number_density_(/m3)____________________________________________ (nd_fuel_ions)_________________ 6.58453241268011663e+19 OP - Total_impurity_number_density_with_Z_>_2_(no_He)_(/m3)___________________ (nd_impurities)________________ 5.43985672856892960e+16 OP - Helium_ion_number_density_(thermalised_ions_only)_(/m3)__________________ (nd_alphas)____________________ 4.69634891516571443e+18 OP + Total_Ion_number_density_(/m3)___________________________________________ (nd_plasma_ions_total_vol_avg)________________ 7.06084473006886912e+19 OP + Fuel_ion_number_density_(/m3)____________________________________________ (nd_plasma_fuel_ions_vol_avgel_ions_vol_avg)_________________ 6.58453241268011663e+19 OP + Total_impurity_number_density_with_Z_>_2_(no_He)_(/m3)___________________ (nd_plasma_impurities_vol_avg)________________ 5.43985672856892960e+16 OP + Helium_ion_number_density_(thermalised_ions_only)_(/m3)__________________ (nd_plasma_alphas_vol_avg_alphas_vol_avg)____________________ 4.69634891516571443e+18 OP Helium_ion_density_(thermalised_ions_only)_/_electron_number_density_____ (f_nd_alpha_electron)__________ 6.02387639886502110e-02 - Proton_number_density_(/m3)______________________________________________ (nd_protons)___________________ 1.23756914361185080e+16 OP + Proton_number_density_(/m3)______________________________________________ (nd_plasma_protons_vol_avg)___________________ 1.23756914361185080e+16 OP Proton_number_density_/_electron_number_density__________________________ (f_nd_protium_electrons)_______ 0.00000000000000000e+00 OP Hot_beam_ion_number_density_(/m3)________________________________________ (nd_beam_ions)_________________ 0.00000000000000000e+00 OP Hot_beam_ion_number_density_/_electron_density___________________________ (f_nd_beam_electron)___________ 0.00000000000000000e+00 OP @@ -275,18 +275,18 @@ Temperature_profile_index________________________________________________ (alphat)_______________________ 1.44999999999999996e+00 Temperature_profile_index_beta___________________________________________ (tbeta)________________________ 2.00000000000000000e+00 Pressure_profile_index___________________________________________________ (alphap)_______________________ 2.45000000000000018e+00 - Old_ASDEX_model__________________________________________________________ (dlimit(1))____________________ 2.90898762676047462e+19 OP - Borrass_ITER_model_I_____________________________________________________ (dlimit(2))____________________ 5.32771894980833526e+19 OP - Borrass_ITER_model_II____________________________________________________ (dlimit(3))____________________ 2.01519696896069632e+19 OP - JET_edge_radiation_model_________________________________________________ (dlimit(4))____________________ 1.71437007414591567e+21 OP - JET_simplified_model_____________________________________________________ (dlimit(5))____________________ 2.21998796377134301e+20 OP - Hugill-Murakami_Mq_model_________________________________________________ (dlimit(6))____________________ 4.83130102547807273e+19 OP - Greenwald_model__________________________________________________________ (dlimit(7))____________________ 7.20274886424344904e+19 OP - ASDEX_New________________________________________________________________ (dlimit(8))____________________ 8.37005006999513989e+20 OP - Density_limit_from_scaling_(/m3)_________________________________________ (dnelimt)______________________ 7.20274886424344904e+19 OP - Deuterium_fuel_fraction__________________________________________________ (f_deuterium)__________________ 5.00000000000000000e-01 - Tritium_fuel_fraction____________________________________________________ (f_tritium)____________________ 5.00000000000000000e-01 - 3-Helium_fuel_fraction___________________________________________________ (f_helium3)____________________ 0.00000000000000000e+00 + Old_ASDEX_model__________________________________________________________ (nd_plasma_electron_max_array(1))____________________ 2.90898762676047462e+19 OP + Borrass_ITER_model_I_____________________________________________________ (nd_plasma_electron_max_array(2))____________________ 5.32771894980833526e+19 OP + Borrass_ITER_model_II____________________________________________________ (nd_plasma_electron_max_array(3))____________________ 2.01519696896069632e+19 OP + JET_edge_radiation_model_________________________________________________ (nd_plasma_electron_max_array(4))____________________ 1.71437007414591567e+21 OP + JET_simplified_model_____________________________________________________ (nd_plasma_electron_max_array(5))____________________ 2.21998796377134301e+20 OP + Hugill-Murakami_Mq_model_________________________________________________ (nd_plasma_electron_max_array(6))____________________ 4.83130102547807273e+19 OP + Greenwald_model__________________________________________________________ (nd_plasma_electron_max_array(7))____________________ 7.20274886424344904e+19 OP + ASDEX_New________________________________________________________________ (nd_plasma_electron_max_array(8))____________________ 8.37005006999513989e+20 OP + Density_limit_from_scaling_(/m3)_________________________________________ (nd_plasma_electron_max)______________________ 7.20274886424344904e+19 OP + Deuterium_fuel_fraction__________________________________________________ (f_plasma_fuel_deuterium)__________________ 5.00000000000000000e-01 + Tritium_fuel_fraction____________________________________________________ (f_plasma_fuel_tritium)____________________ 5.00000000000000000e-01 + 3-Helium_fuel_fraction___________________________________________________ (f_plasma_fuel_helium3)____________________ 0.00000000000000000e+00 Total_fusion_power_(MW)__________________________________________________ (p_fusion_total_mw)_________________ 1.60956116199862254e+03 OP Fusion_rate_density:_total_(particles/m3/sec)____________________________ (fusden_total)____ 3.03874355943265088e+17 OP Fusion_rate_density:_plasma_(particles/m3/sec)___________________________ (fusden_plasma)___ 3.03874355943265088e+17 OP @@ -1188,7 +1188,7 @@ boundl(3) = 8.0 boundu(3) = 9.0 ixc = 4 * temp_plasma_electron_vol_avg_kev boundu(4) = 100.0 -ixc = 5 * beta +ixc = 5 * beta_total_vol_avg ixc = 6 * nd_plasma_electrons_vol_avg ixc = 10 * hfact boundu(10) = 1.2 @@ -1459,7 +1459,7 @@ zref(10) = 1.0 alphan = 1.00 * density profile index alphat = 1.45 * temperature profile index aspect = 3.0 * aspect ratio (`iteration variable 1`) -beta = 0.03230408815355488 * total plasma beta (`iteration variable 5`) (calculated if stellarator) +beta_total_vol_avg = 0.03230408815355488 * total plasma beta (`iteration variable 5`) (calculated if stellarator) b_plasma_toroidal_on_axis = 5.318322174644904 * toroidal field on axis (T) (`iteration variable 2`) nd_plasma_electrons_vol_avg = 7.796223900029837e+19 * electron density (/m3) (`iteration variable 6`) beta_norm_max = 3.0 * Troyon-like coefficient for beta scaling calculated diff --git a/examples/data/large_tokamak_nof_MFILE.DAT b/examples/data/large_tokamak_nof_MFILE.DAT index 0e54d8a8a9..01f26fab5d 100644 --- a/examples/data/large_tokamak_nof_MFILE.DAT +++ b/examples/data/large_tokamak_nof_MFILE.DAT @@ -273,18 +273,18 @@ Safety_factor_on_axis____________________________________________________ (q0)___________________________ 1.00000000000000000e+00 Safety_factor_at_95%_flux_surface________________________________________ (q95)__________________________ 3.05729664268825285e+00 Cylindrical_safety_factor_(qcyl)_________________________________________ (qstar)________________________ 3.37999298978303386e+00 OP - Upper_limit_on_thermal_beta______________________________________________ (beta_max)_____________________ 7.35303866910386600e-02 OP - Total_plasma_beta________________________________________________________ (beta)_________________________ 4.48303922556954615e-02 - Lower_limit_on_thermal_beta______________________________________________ (beta_min)_____________________ 0.00000000000000000e+00 IP + Upper_limit_on_thermal_beta______________________________________________ (beta_vol_avg_max_avg_max)_____________________ 7.35303866910386600e-02 OP + Total_plasma_beta________________________________________________________ (beta_total_vol_avg)_________________________ 4.48303922556954615e-02 + Lower_limit_on_thermal_beta______________________________________________ (beta_vol_avg_min)_____________________ 0.00000000000000000e+00 IP Upper_limit_on_poloidal_beta_____________________________________________ (beta_poloidal_max)____________ 1.90000000000000002e-01 IP Total_poloidal_beta______________________________________________________ (beta_poloidal)________________ 1.25053557633615986e+00 OP - Total_toroidal_beta______________________________________________________ (beta_toroidal)________________ 4.64972707732098992e-02 OP + Total_toroidal_beta______________________________________________________ (beta_toroidal_vol_avg)________________ 4.64972707732098992e-02 OP Fast_alpha_beta__________________________________________________________ (beta_fast_alpha)______________ 5.34272993662247321e-03 OP Neutral_Beam_ion_beta____________________________________________________ (beta_beam)____________________ 0.00000000000000000e+00 OP Ratio_of_fast_alpha_and_beam_beta_to_thermal_beta________________________ (f_beta_alpha_beam_thermal)____ 1.35301246588149487e-01 OP - Thermal_beta_____________________________________________________________ (beta_thermal)_________________ 3.94876623190729900e-02 OP - Thermal_poloidal_beta____________________________________________________ (beta_thermal_poloidal)________ 1.10150110386500244e+00 OP - Thermal_toroidal_beta____________________________________________________ (beta_thermal_toroidal)________ 4.09558880631420777e-02 OP + Thermal_beta_____________________________________________________________ (beta_thermal_vol_avg)_________________ 3.94876623190729900e-02 OP + Thermal_poloidal_beta____________________________________________________ (beta_thermal_poloidal_vol_avg_vol_avg)________ 1.10150110386500244e+00 OP + Thermal_toroidal_beta____________________________________________________ (beta_thermal_toroidal_vol_avg)________ 4.09558880631420777e-02 OP Poloidal_beta_and_inverse_aspect_ratio___________________________________ (beta_poloidal_eps)____________ 4.16845192112053287e-01 OP Poloidal_beta_and_inverse_aspect_ratio_upper_limit_______________________ (beta_poloidal_eps_max)________ 1.37999999999999989e+00 Beta_g_coefficient_______________________________________________________ (beta_norm_max)________________ 5.30638311255202044e+00 OP @@ -302,16 +302,16 @@ Electron_temp.,_density_weighted_(keV)___________________________________ (temp_plasma_electron_density_weighted_kev)__________________________ 1.44360335891099503e+01 OP Volume_averaged_electron_number_density_(/m3)____________________________ (nd_plasma_electrons_vol_avg)_________________________ 8.50078961768999158e+19 Electron_number_density_on_axis_(/m3)____________________________________ (nd_plasma_electron_on_axis)__________________________ 1.11814263037413868e+20 OP - Line-averaged_electron_number_density_(/m3)______________________________ (nd_electron_line)_________________________ 9.41418090734859715e+19 OP - Plasma_pressure_on_axis_(Pa)_____________________________________________ (pres_plasma_on_axis)___________________________ 9.10652371594472905e+05 OP - Volume_averaged_plasma_pressure_(Pa)_____________________________________ (pres_plasma_vol_avg)_____________ 2.63957209157818230e+05 OP + Line-averaged_electron_number_density_(/m3)______________________________ (nd_plasma_electron_line)_________________________ 9.41418090734859715e+19 OP + Plasma_pressure_on_axis_(Pa)_____________________________________________ (pres_plasma_thermal_on_axis)___________________________ 9.10652371594472905e+05 OP + Volume_averaged_plasma_pressure_(Pa)_____________________________________ (pres_plasma_thermal_vol_avg)_____________ 2.63957209157818230e+05 OP Line-averaged_electron_density_/_Greenwald_density_______________________ (dnla_gw)______________________ 1.19999999999999951e+00 OP - Total_Ion_number_density_(/m3)___________________________________________ (nd_ions_total)________________ 7.34892735750798868e+19 OP - Fuel_ion_number_density_(/m3)____________________________________________ (nd_fuel_ions)_________________ 6.49714589130413015e+19 OP - Total_impurity_number_density_with_Z_>_2_(no_He)_(/m3)___________________ (nd_impurities)________________ 6.41695061162086560e+16 OP - Helium_ion_number_density_(thermalised_ions_only)_(/m3)__________________ (nd_alphas)____________________ 8.43080585227756646e+18 OP + Total_Ion_number_density_(/m3)___________________________________________ (nd_plasma_ions_total_vol_avg)________________ 7.34892735750798868e+19 OP + Fuel_ion_number_density_(/m3)____________________________________________ (nd_plasma_fuel_ions_vol_avgel_ions_vol_avg)_________________ 6.49714589130413015e+19 OP + Total_impurity_number_density_with_Z_>_2_(no_He)_(/m3)___________________ (nd_plasma_impurities_vol_avg)________________ 6.41695061162086560e+16 OP + Helium_ion_number_density_(thermalised_ions_only)_(/m3)__________________ (nd_plasma_alphas_vol_avg_alphas_vol_avg)____________________ 8.43080585227756646e+18 OP Helium_ion_density_(thermalised_ions_only)_/_electron_number_density_____ (f_nd_alpha_electron)__________ 9.91767380612879751e-02 - Proton_number_density_(/m3)______________________________________________ (nd_protons)___________________ 2.28393036448186680e+16 OP + Proton_number_density_(/m3)______________________________________________ (nd_plasma_protons_vol_avg)___________________ 2.28393036448186680e+16 OP Proton_number_density_/_electron_number_density__________________________ (f_nd_protium_electrons)_______ 0.00000000000000000e+00 OP Hot_beam_ion_number_density_(/m3)________________________________________ (nd_beam_ions)_________________ 0.00000000000000000e+00 OP Hot_beam_ion_number_density_/_electron_density___________________________ (f_nd_beam_electron)___________ 0.00000000000000000e+00 OP @@ -347,19 +347,19 @@ Temperature_profile_index________________________________________________ (alphat)_______________________ 1.44999999999999996e+00 Temperature_profile_index_beta___________________________________________ (tbeta)________________________ 2.00000000000000000e+00 Pressure_profile_index___________________________________________________ (alphap)_______________________ 2.45000000000000018e+00 - Old_ASDEX_model__________________________________________________________ (dlimit(1))____________________ 5.04927402258230395e+19 OP - Borrass_ITER_model_I_____________________________________________________ (dlimit(2))____________________ 9.91154917220369859e+19 OP - Borrass_ITER_model_II____________________________________________________ (dlimit(3))____________________ 3.82528337286505349e+19 OP - JET_edge_radiation_model_________________________________________________ (dlimit(4))____________________ 2.02644839996092947e+21 OP - JET_simplified_model_____________________________________________________ (dlimit(5))____________________ 3.52789232059618492e+20 OP - Hugill-Murakami_Mq_model_________________________________________________ (dlimit(6))____________________ 5.26219719824596337e+19 OP - Greenwald_model__________________________________________________________ (dlimit(7))____________________ 7.84515075612383478e+19 OP - ASDEX_New________________________________________________________________ (dlimit(8))____________________ 1.03091554466307611e+21 OP - Density_limit_from_scaling_(/m3)_________________________________________ (dnelimt)______________________ 7.84515075612383478e+19 OP - Density_limit_(enforced)_(/m3)___________________________________________ (boundu(9)*dnelimt)____________ 7.84515075612383478e+19 OP - Deuterium_fuel_fraction__________________________________________________ (f_deuterium)__________________ 5.00000000000000000e-01 - Tritium_fuel_fraction____________________________________________________ (f_tritium)____________________ 5.00000000000000000e-01 - 3-Helium_fuel_fraction___________________________________________________ (f_helium3)____________________ 0.00000000000000000e+00 + Old_ASDEX_model__________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(1))____________________ 5.04927402258230395e+19 OP + Borrass_ITER_model_I_____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(2))____________________ 9.91154917220369859e+19 OP + Borrass_ITER_model_II____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(3))____________________ 3.82528337286505349e+19 OP + JET_edge_radiation_model_________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(4))____________________ 2.02644839996092947e+21 OP + JET_simplified_model_____________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(5))____________________ 3.52789232059618492e+20 OP + Hugill-Murakami_Mq_model_________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(6))____________________ 5.26219719824596337e+19 OP + Greenwald_model__________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(7))____________________ 7.84515075612383478e+19 OP + ASDEX_New________________________________________________________________ (nd_plasma_electron_max_arraysma_electron_max_array(8))____________________ 1.03091554466307611e+21 OP + Density_limit_from_scaling_(/m3)_________________________________________ (nd_plasma_electron_maxma_electron_max)______________________ 7.84515075612383478e+19 OP + Density_limit_(enforced)_(/m3)___________________________________________ (boundu(9)*nd_plasma_electron_maxma_electron_max)____________ 7.84515075612383478e+19 OP + Deuterium_fuel_fraction__________________________________________________ (f_plasma_fuel_deuterium)__________________ 5.00000000000000000e-01 + Tritium_fuel_fraction____________________________________________________ (f_plasma_fuel_tritium)____________________ 5.00000000000000000e-01 + 3-Helium_fuel_fraction___________________________________________________ (f_plasma_fuel_helium3)____________________ 0.00000000000000000e+00 Total_fusion_power_(MW)__________________________________________________ (p_fusion_total_mw)_________________ 1.74333215950657041e+03 OP Fusion_rate_density:_total_(particles/m3/sec)____________________________ (fusden_total)____ 3.29182443497713664e+17 OP Fusion_rate_density:_plasma_(particles/m3/sec)___________________________ (fusden_plasma)___ 3.29182443497713664e+17 OP @@ -1243,8 +1243,8 @@ neqns = 3 * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta -beta = 0.03 +ixc = 5 * beta_total_vol_avg +beta_total_vol_avg = 0.03 * Global power balance * *----------------------* diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 915ae526de..4992961212 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -198,7 +198,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -1193,7 +1193,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -2188,7 +2188,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -3183,7 +3183,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -4178,7 +4178,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -5173,7 +5173,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -6168,7 +6168,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -7163,7 +7163,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -8158,7 +8158,7 @@ Safety_factor_on_axis___________________________________________________ (q0)__________________________ 1.0000E+00 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_plasma_beta_______________________________________________________ (beta_total_vol_avg)________________________ 3.0698E-02 ITV Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2080E+00 OP Total_toroidal_beta_____________________________________________________ ______________________________ 3.1498E-02 OP Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.1786E-03 OP @@ -9010,7 +9010,7 @@ ixc = 3 * rmajor boundu(3) = 13 ixc = 4 * temp_plasma_electron_vol_avg_keV boundu(4) = 150.0 -ixc = 5 * beta +ixc = 5 * beta_total_vol_avg ixc = 6 * nd_plasma_electrons_vol_avg ixc = 9 * fdene boundu(9) = 1.2 @@ -9103,7 +9103,7 @@ dr_shld_blkt_gap = 0.02 * gap between vacuum vessel and blanket (m) *---------------Constraint Variables---------------* -fbeta_max = 0.4815 * F-value for beta limit +fbeta_max = 0.4815 * F-value for beta_total_vol_avg limit fdene = 1.2 * F-value for density limit fp_fusion_total_max_mw = 1 * F-value for maximum fusion power fjohc = 0.25 * F-value for central solenoid current at end-of-flattop @@ -9233,13 +9233,13 @@ alphan = 1.00 * Density profile index alphat = 1.45 * Temperature profile index aspect = 3.1 * Aspect ratio (iteration variable 1) nd_plasma_electrons_vol_avg = 7.983e+19 * Electron density (/m3) (iteration variable 6) -beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; +beta_norm_max = 3.0 * (troyon-like) coefficient for beta_total_vol_avg scaling; fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) f_c_plasma_non_inductive = 0.4434 * Fraction of the plasma current produced by ejima_coeff = 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; -i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24); +i_beta_component = 1 * Switch for beta_total_vol_avg limit scaling (constraint equation 24); i_plasma_current = 4 * Switch for plasma current scaling to use; i_density_limit = 7 * Switch for density limit to enforce (constraint equation 5); i_beta_fast_alpha = 1 * Switch for fast alpha pressure calculation; @@ -9250,7 +9250,7 @@ nd_plasma_pedestal_electron = 0.678e20 * Electron density of pedestal (/m3) ( nd_plasma_separatrix_electron = 0.2e20 * Electron density at separatrix (/m3) (i_plasma_pedestal=1) radius_plasma_pedestal_density_norm = 0.94 * R/a of density pedestal (i_plasma_pedestal=1) radius_plasma_pedestal_temp_norm = 0.94 * R/a of temperature pedestal (i_plasma_pedestal=1) -tbeta = 2.0 * Temperature profile index beta (i_plasma_pedestal=1) +tbeta = 2.0 * Temperature profile index beta_total_vol_avg (i_plasma_pedestal=1) temp_plasma_pedestal_kev = 5.5 * Electron temperature of pedestal (kev) (i_plasma_pedestal=1) temp_plasma_separatrix_kev = 0.1 * Electron temperature at separatrix (kev) (i_plasma_pedestal=1) i_confinement_time = 34 * Switch for energy confinement time scaling law @@ -9315,7 +9315,7 @@ t_burn = 1.0d4 * Burn time (s) (calculated if i_pulsed_plant=1) b_plasma_toroidal_on_axis = 5.3292E+00 rmajor = 8.8901E+00 temp_plasma_electron_vol_avg_keV = 1.2330E+01 - beta = 3.1421E-02 + beta_total_vol_avg = 3.1421E-02 nd_plasma_electrons_vol_avg = 7.4321E+19 fdene = 1.2000E+00 oacdcp = 8.6739E+06 diff --git a/examples/data/scan_example_file_IN.DAT b/examples/data/scan_example_file_IN.DAT index 6da89b8315..e05c9f7a39 100644 --- a/examples/data/scan_example_file_IN.DAT +++ b/examples/data/scan_example_file_IN.DAT @@ -23,8 +23,8 @@ epsvmc = 1e-7 * Beta consistency * *------------------* icc = 1 -ixc = 5 * beta -beta = 0.03 +ixc = 5 * beta_total_vol_avg +beta_total_vol_avg =0.03 * Global power balance * *----------------------* diff --git a/process/confinement_time.py b/process/confinement_time.py index a6b26a9345..108cdafff8 100644 --- a/process/confinement_time.py +++ b/process/confinement_time.py @@ -1724,7 +1724,7 @@ def petty08_confinement_time( def lang_high_density_confinement_time( plasma_current: float, b_plasma_toroidal_on_axis: float, - nd_electron_line: float, + nd_plasma_electron_line: float, p_plasma_loss_mw: float, rmajor: float, rminor: float, @@ -1740,7 +1740,7 @@ def lang_high_density_confinement_time( Parameters: plasma_current (float): Plasma current [MA] b_plasma_toroidal_on_axis (float): Toroidal magnetic field [T] - nd_electron_line (float): Line averaged electron density [m**-3] + nd_plasma_electron_line (float): Line averaged electron density [m**-3] p_plasma_loss_mw (float): Net Heating power [MW] rmajor (float): Plasma major radius [m] rminor (float): Plasma minor radius [m] @@ -1763,12 +1763,12 @@ def lang_high_density_confinement_time( """ qratio = q / qstar n_gw = 1.0e14 * plasma_current / (np.pi * rminor * rminor) - nratio = nd_electron_line / n_gw + nratio = nd_plasma_electron_line / n_gw return ( 6.94e-7 * plasma_current**1.3678e0 * b_plasma_toroidal_on_axis**0.12e0 - * nd_electron_line**0.032236e0 + * nd_plasma_electron_line**0.032236e0 * (p_plasma_loss_mw * 1.0e6) ** (-0.74e0) * rmajor**1.2345e0 * kappa_ipb**0.37e0 diff --git a/process/constraints.py b/process/constraints.py index 841ccdcf13..ec58009caa 100644 --- a/process/constraints.py +++ b/process/constraints.py @@ -127,7 +127,7 @@ def constraint_equation_1(): author: J Morris - beta: total plasma beta + beta_total_vol_avg: total plasma beta beta_{ft}: fast alpha beta component beta_{NBI}: neutral beam beta component n_e: electron density [/m3] @@ -136,6 +136,8 @@ def constraint_equation_1(): T_i: density weighted average ion temperature [keV] B_{tot}: total toroidal + poloidal field [T] """ + + # Density weighted temperature is used here as 〈nT〉 != 〈n〉_V * 〈T〉_V cc = ( 1.0 - ( @@ -147,17 +149,19 @@ def constraint_equation_1(): * ( data_structure.physics_variables.nd_plasma_electrons_vol_avg * data_structure.physics_variables.temp_plasma_electron_density_weighted_kev - + data_structure.physics_variables.nd_ions_total + + data_structure.physics_variables.nd_plasma_ions_total_vol_avg * data_structure.physics_variables.temp_plasma_ion_density_weighted_kev ) / data_structure.physics_variables.b_plasma_total**2 ) - / data_structure.physics_variables.beta + / data_structure.physics_variables.beta_total_vol_avg ) return ConstraintResult( normalised_residual=cc, - constraint_value=(data_structure.physics_variables.beta * (1.0 - cc)), - constraint_error=(data_structure.physics_variables.beta * cc), + constraint_value=( + data_structure.physics_variables.beta_total_vol_avg * (1.0 - cc) + ), + constraint_error=(data_structure.physics_variables.beta_total_vol_avg * cc), ) @@ -353,8 +357,8 @@ def constraint_equation_5(): fdene: f-value for density limit nd_plasma_electrons_vol_avg: electron density (/m3) - dnelimt: density limit (/m3) - nd_electron_line: line averaged electron density (m-3) + nd_plasma_electrons_max: density limit (/m3) + nd_plasma_electron_line: line averaged electron density (m-3) i_density_limit: - 1 old ASDEX; @@ -368,24 +372,24 @@ def constraint_equation_5(): # Apply Greenwald limit to line-averaged density if data_structure.physics_variables.i_density_limit == 7: return ConstraintResult( - data_structure.physics_variables.nd_electron_line - / data_structure.physics_variables.dnelimt + data_structure.physics_variables.nd_plasma_electron_line + / data_structure.physics_variables.nd_plasma_electrons_max - 1.0 * data_structure.constraint_variables.fdene, data_structure.constraint_variables.fdene - * data_structure.physics_variables.dnelimt, + * data_structure.physics_variables.nd_plasma_electrons_max, data_structure.constraint_variables.fdene - * data_structure.physics_variables.dnelimt - - data_structure.physics_variables.nd_electron_line, + * data_structure.physics_variables.nd_plasma_electrons_max + - data_structure.physics_variables.nd_plasma_electron_line, ) cc = ( data_structure.physics_variables.nd_plasma_electrons_vol_avg - / data_structure.physics_variables.dnelimt + / data_structure.physics_variables.nd_plasma_electrons_max - 1.0 * data_structure.constraint_variables.fdene ) return ConstraintResult( cc, - data_structure.physics_variables.dnelimt * (1.0 - cc), + data_structure.physics_variables.nd_plasma_electrons_max * (1.0 - cc), data_structure.physics_variables.nd_plasma_electrons_vol_avg * cc, ) @@ -403,7 +407,7 @@ def constraint_equation_6(): cc = ( ( data_structure.physics_variables.eps - * data_structure.physics_variables.beta_poloidal + * data_structure.physics_variables.beta_poloidal_vol_avg ) / data_structure.physics_variables.beta_poloidal_eps_max - 1.0 * data_structure.constraint_variables.fbeta_poloidal_eps @@ -413,7 +417,7 @@ def constraint_equation_6(): data_structure.physics_variables.beta_poloidal_eps_max * (1.0 - cc), ( data_structure.physics_variables.eps - * data_structure.physics_variables.beta_poloidal + * data_structure.physics_variables.beta_poloidal_vol_avg ) * cc, ) @@ -797,8 +801,8 @@ def constraint_equation_24(): - 0 use tokamak model; - 1 use stellarator model fbeta_max: f-value for beta limit - beta_max: allowable beta - beta: total plasma beta (calculated if i_plasma_pedestal =3) + beta_vol_avg_max: allowable beta + beta_total_vol_avg: total plasma beta (calculated if i_plasma_pedestal =3) beta_fast_alpha: fast alpha beta component beta_beam: neutral beam beta component b_plasma_toroidal_on_axis: toroidal field @@ -810,32 +814,32 @@ def constraint_equation_24(): or data_structure.stellarator_variables.istell != 0 ): cc = ( - data_structure.physics_variables.beta - / data_structure.physics_variables.beta_max + data_structure.physics_variables.beta_total_vol_avg + / data_structure.physics_variables.beta_vol_avg_max - 1.0 * data_structure.constraint_variables.fbeta_max ) - con = data_structure.physics_variables.beta_max + con = data_structure.physics_variables.beta_vol_avg_max err = ( - data_structure.physics_variables.beta_max - - data_structure.physics_variables.beta + data_structure.physics_variables.beta_vol_avg_max + - data_structure.physics_variables.beta_total_vol_avg / data_structure.constraint_variables.fbeta_max ) # Here, the beta limit applies to only the thermal component, not the fast alpha or neutral beam parts elif data_structure.physics_variables.i_beta_component == 1: cc = ( ( - data_structure.physics_variables.beta + data_structure.physics_variables.beta_total_vol_avg - data_structure.physics_variables.beta_fast_alpha - data_structure.physics_variables.beta_beam ) - / data_structure.physics_variables.beta_max + / data_structure.physics_variables.beta_vol_avg_max - 1.0 * data_structure.constraint_variables.fbeta_max ) - con = data_structure.physics_variables.beta_max + con = data_structure.physics_variables.beta_vol_avg_max err = ( - data_structure.physics_variables.beta_max + data_structure.physics_variables.beta_vol_avg_max - ( - data_structure.physics_variables.beta + data_structure.physics_variables.beta_total_vol_avg - data_structure.physics_variables.beta_fast_alpha - data_structure.physics_variables.beta_beam ) @@ -845,36 +849,36 @@ def constraint_equation_24(): elif data_structure.physics_variables.i_beta_component == 2: cc = ( ( - data_structure.physics_variables.beta + data_structure.physics_variables.beta_total_vol_avg - data_structure.physics_variables.beta_fast_alpha ) - / data_structure.physics_variables.beta_max + / data_structure.physics_variables.beta_vol_avg_max - 1.0 * data_structure.constraint_variables.fbeta_max ) - con = data_structure.physics_variables.beta_max * (1.0 - cc) + con = data_structure.physics_variables.beta_vol_avg_max * (1.0 - cc) err = ( - data_structure.physics_variables.beta + data_structure.physics_variables.beta_total_vol_avg - data_structure.physics_variables.beta_fast_alpha ) * cc # Beta limit applies to toroidal beta elif data_structure.physics_variables.i_beta_component == 3: cc = ( ( - data_structure.physics_variables.beta + data_structure.physics_variables.beta_total_vol_avg * ( data_structure.physics_variables.b_plasma_total / data_structure.physics_variables.b_plasma_toroidal_on_axis ) ** 2 ) - / data_structure.physics_variables.beta_max + / data_structure.physics_variables.beta_vol_avg_max - 1.0 * data_structure.constraint_variables.fbeta_max ) - con = data_structure.physics_variables.beta_max + con = data_structure.physics_variables.beta_vol_avg_max err = ( - data_structure.physics_variables.beta_max + data_structure.physics_variables.beta_vol_avg_max - ( - data_structure.physics_variables.beta + data_structure.physics_variables.beta_total_vol_avg * ( data_structure.physics_variables.b_plasma_total / data_structure.physics_variables.b_plasma_toroidal_on_axis @@ -1387,14 +1391,14 @@ def constraint_equation_48(): beta_poloidal: poloidal beta """ cc = ( - data_structure.physics_variables.beta_poloidal + data_structure.physics_variables.beta_poloidal_vol_avg / data_structure.constraint_variables.beta_poloidal_max - 1.0 * data_structure.constraint_variables.fbeta_poloidal ) return ConstraintResult( cc, data_structure.constraint_variables.beta_poloidal_max * (1.0 - cc), - data_structure.physics_variables.beta_poloidal * cc, + data_structure.physics_variables.beta_poloidal_vol_avg * cc, ) @@ -1935,7 +1939,7 @@ def constraint_equation_76(): triang: plasma separatrix triangularity (calculated if i_plasma_geometry = 1, 3-5 or 7) aspect: aspect ratio (iteration variable 1) p_plasma_separatrix_mw: power to conducted to the divertor region (MW) - dlimit(7)array : density limit (/m3) as calculated using various models + nd_plasma_electron_max_array(7)array : density limit (/m3) as calculated using various models fnesep: f-value for Eich critical separatrix density """ # TODO: why on earth are these variables being set here!? Should they be local? @@ -1954,7 +1958,7 @@ def constraint_equation_76(): (data_structure.physics_variables.p_plasma_separatrix_mw * 1.0e6) ** (-11.0 / 70.0) ) - * data_structure.physics_variables.dlimit[6] + * data_structure.physics_variables.nd_plasma_electron_max_array[6] ) cc = ( @@ -2145,20 +2149,20 @@ def constraint_equation_84(): """Equation for the lower limit of beta author: J Lion, IPP Greifswald - fbeta_min: f-value for constraint beta-beta_fast_alpha > beta_min - beta_min: Lower limit for beta + fbeta_min: f-value for constraint beta-beta_fast_alpha > beta_vol_avg_min + beta_vol_avg_min: Lower limit for beta beta: plasma beta """ cc = ( 1.0 - data_structure.constraint_variables.fbeta_min - * data_structure.physics_variables.beta - / data_structure.physics_variables.beta_min + * data_structure.physics_variables.beta_total_vol_avg + / data_structure.physics_variables.beta_vol_avg_min ) return ConstraintResult( cc, - data_structure.physics_variables.beta_min * (1.0 - cc), - data_structure.physics_variables.beta * cc, + data_structure.physics_variables.beta_vol_avg_min * (1.0 - cc), + data_structure.physics_variables.beta_total_vol_avg * cc, ) @@ -2371,18 +2375,18 @@ def constraint_equation_92(): """Equation for checking is D/T ratio is consistent, and sums to 1. author: G Turkington, UKAEA - f_deuterium: fraction of deuterium ions - f_tritium: fraction of tritium ions - f_helium3: fraction of helium-3 ions + f_plasma_fuel_deuterium: fraction of deuterium ions + f_plasma_fuel_tritium: fraction of tritium ions + f_plasma_fuel_helium3: fraction of helium-3 ions """ - f_deuterium = 1.0 - ( - data_structure.physics_variables.f_tritium - + data_structure.physics_variables.f_helium3 + f_plasma_fuel_deuterium = 1.0 - ( + data_structure.physics_variables.f_plasma_fuel_tritium + + data_structure.physics_variables.f_plasma_fuel_helium3 ) cc = 1.0 - ( - f_deuterium - + data_structure.physics_variables.f_tritium - + data_structure.physics_variables.f_helium3 + f_plasma_fuel_deuterium + + data_structure.physics_variables.f_plasma_fuel_tritium + + data_structure.physics_variables.f_plasma_fuel_helium3 ) return ConstraintResult(cc, 1.0, cc) diff --git a/process/costs.py b/process/costs.py index 07f5e41258..e18b6cbe91 100644 --- a/process/costs.py +++ b/process/costs.py @@ -2491,7 +2491,7 @@ def acc2273(self): cfrht = 1.0e5 # No detritiation needed if purely D-He3 reaction - if physics_variables.f_tritium > 1.0e-3: + if physics_variables.f_plasma_fuel_tritium > 1.0e-3: cost_variables.c2273 = ( 1.0e-6 * cost_variables.UCDTC @@ -3073,7 +3073,7 @@ def coelc(self): * heat_transport_variables.p_plant_electric_net_mw / 1200.0e0 + 1.0e-6 - * physics_variables.f_helium3 + * physics_variables.f_plasma_fuel_helium3 * physics_variables.wtgpd * 1.0e-3 * cost_variables.uche3 diff --git a/process/current_drive.py b/process/current_drive.py index b416192541..bae7aa8676 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -72,10 +72,13 @@ def iternb(self): fshine = max(fshine, 1e-20) # Deuterium and tritium beam densities - dend = physics_variables.nd_fuel_ions * ( + dend = physics_variables.nd_plasma_fuel_ions_vol_avg * ( 1.0 - current_drive_variables.f_beam_tritium ) - dent = physics_variables.nd_fuel_ions * current_drive_variables.f_beam_tritium + dent = ( + physics_variables.nd_plasma_fuel_ions_vol_avg + * current_drive_variables.f_beam_tritium + ) # Power split to ions / electrons f_p_beam_injected_ions = self.cfnbi( @@ -147,20 +150,25 @@ def culnbi(self): # Calculate number of decay lengths to centre current_drive_variables.n_beam_decay_lengths_core = ( - dpath * physics_variables.nd_electron_line * sigstop + dpath * physics_variables.nd_plasma_electron_line * sigstop ) # Shine-through fraction of beam - fshine = np.exp(-2.0e0 * dpath * physics_variables.nd_electron_line * sigstop) + fshine = np.exp( + -2.0e0 * dpath * physics_variables.nd_plasma_electron_line * sigstop + ) fshine = max(fshine, 1.0e-20) # Deuterium and tritium beam densities - dend = physics_variables.nd_fuel_ions * ( + dend = physics_variables.nd_plasma_fuel_ions_vol_avg * ( 1.0e0 - current_drive_variables.f_beam_tritium ) - dent = physics_variables.nd_fuel_ions * current_drive_variables.f_beam_tritium + dent = ( + physics_variables.nd_plasma_fuel_ions_vol_avg + * current_drive_variables.f_beam_tritium + ) # Power split to ions / electrons @@ -183,7 +191,7 @@ def culnbi(self): physics_variables.alphat, physics_variables.aspect, physics_variables.nd_plasma_electrons_vol_avg, - physics_variables.nd_electron_line, + physics_variables.nd_plasma_electron_line, current_drive_variables.e_beam_kev, current_drive_variables.f_radius_beam_tangency_rmajor, fshine, @@ -202,7 +210,7 @@ def etanb2( alphat, aspect, nd_plasma_electrons_vol_avg, - nd_electron_line, + nd_plasma_electron_line, e_beam_kev, f_radius_beam_tangency_rmajor, fshine, @@ -220,7 +228,7 @@ def etanb2( alphat : input real : temperature profile factor aspect : input real : aspect ratio nd_plasma_electrons_vol_avg : input real : volume averaged electron density (m**-3) - nd_electron_line : input real : line averaged electron density (m**-3) + nd_plasma_electron_line : input real : line averaged electron density (m**-3) e_beam_kev : input real : neutral beam energy (keV) f_radius_beam_tangency_rmajor : input real : R_tangent / R_major for neutral beam injection fshine : input real : shine-through fraction of beam @@ -246,7 +254,7 @@ def etanb2( dene20 = nd_plasma_electrons_vol_avg / 1e20 # Line averaged electron density (10**20 m**-3) - dnla20 = nd_electron_line / 1e20 + dnla20 = nd_plasma_electron_line / 1e20 # Critical energy (MeV) (power to electrons = power to ions) (IPDG89) # N.B. temp_plasma_electron_density_weighted_kev is in keV @@ -1356,7 +1364,7 @@ def cudriv(self) -> None: * current_drive_variables.feffcd, 4: lambda: self.lower_hybrid.lower_hybrid_ehst( te=physics_variables.temp_plasma_electron_vol_avg_kev, - beta=physics_variables.beta, + beta=physics_variables.beta_total_vol_avg, rmajor=physics_variables.rmajor, dene20=dene20, zeff=physics_variables.zeff, diff --git a/process/data_structure/numerics.py b/process/data_structure/numerics.py index c52ba408e0..03da0eb174 100644 --- a/process/data_structure/numerics.py +++ b/process/data_structure/numerics.py @@ -201,7 +201,7 @@ * ( 2) b_plasma_toroidal_on_axis * ( 3) rmajor * ( 4) temp_plasma_electron_vol_avg_kev -* ( 5) beta +* ( 5) beta_total_vol_avg * ( 6) nd_plasma_electrons_vol_avg * ( 7) f_nd_beam_electron * ( 8) fbeta_poloidal_eps (f-value for equation 6) @@ -368,7 +368,7 @@ * (170) deg_div_field_plate : field line angle wrt divertor target plate (degrees) * (171) casths_fraction : TF side case thickness as fraction of toridal case thickness * (172) dx_tf_side_case_min : TF side case thickness [m] -* (173) f_deuterium : Deuterium fraction in fuel +* (173) f_plasma_fuel_deuterium : Deuterium fraction in fuel * (174) EMPTY : Description * (175) EMPTY : Description """ @@ -612,7 +612,7 @@ def init_numerics(): "nd_plasma_electron_on_axis > nd_plasma_pedestal_electron ", "toroidalgap > dx_tf_inboard_out_t", "available_space > required_space ", - "beta > beta_min ", + "beta > beta_vol_avg_min ", "CP lifetime ", "TFC turn dimension ", "Cryogenic plant power ", diff --git a/process/data_structure/physics_variables.py b/process/data_structure/physics_variables.py index df27334cf0..ef794eada1 100644 --- a/process/data_structure/physics_variables.py +++ b/process/data_structure/physics_variables.py @@ -213,27 +213,27 @@ """multiplier for beam-background fusion calculation""" -beta: float = None -"""total plasma beta (`iteration variable 5`) (calculated if stellarator)""" +beta_total_vol_avg: float = None +"""Volume averaged total plasma beta (`iteration variable 5`) (calculated if stellarator)""" beta_fast_alpha: float = None """fast alpha beta component""" -beta_max: float = None -"""Max allowable beta""" +beta_vol_avg_max: float = None +"""Max allowable volume averaged beta""" -beta_min: float = None -"""allowable lower beta""" +beta_vol_avg_min: float = None +"""Minimum allowable volume averaged beta""" beta_beam: float = None """neutral beam beta component""" -beta_poloidal: float = None +beta_poloidal_vol_avg: float = None """poloidal beta""" @@ -241,20 +241,20 @@ """Poloidal beta and inverse aspcet ratio product""" -beta_toroidal: float = None -"""toroidal beta""" +beta_toroidal_vol_avg: float = None +"""Plasma volume averaged toroidal beta""" -beta_thermal: float = None -"""thermal beta""" +beta_thermal_vol_avg: float = None +"""Plasma volume averaged thermal beta""" -beta_thermal_poloidal: float = None -"""poloidal thermal beta""" +beta_thermal_poloidal_vol_avg: float = None +"""Plasma volume averaged poloidal thermal beta""" -beta_thermal_toroidal: float = None -"""poloidal thermal beta""" +beta_thermal_toroidal_vol_avg: float = None +"""Plasma volume averaged toloidal thermal beta""" beta_norm_total: float = None @@ -330,8 +330,8 @@ """Plasma volume averaged electron density (/m3) (`iteration variable 6`)""" -nd_fuel_ions: float = None -"""fuel ion density (/m3)""" +nd_plasma_fuel_ions_vol_avg: float = None +"""Plasma volume averaged fuel ion density (/m3)""" dlamee: float = None @@ -342,12 +342,12 @@ """ion-electron coulomb logarithm""" -dlimit: list[float] = None -"""density limit (/m3) as calculated using various models""" +nd_plasma_electron_max_array: list[float] = None +"""Array of plasma electron density upper limits values (/m3)""" -nd_alphas: float = None -"""thermal alpha density (/m3)""" +nd_plasma_alphas_vol_avg: float = None +"""Plasma volume averaged thermal alpha density (/m3)""" nd_beam_ions: float = None @@ -382,20 +382,20 @@ """Stambaugh-like coefficient for beta scaling""" -dnelimt: float = None -"""density limit (/m3)""" +nd_plasma_electrons_max: float = None +"""Plasma electron max density limit (/m3)""" -nd_ions_total: float = None -"""total ion density (/m3)""" +nd_plasma_ions_total_vol_avg: float = None +"""Plasma volume averaged total ion density (/m3)""" -nd_electron_line: float = None -"""line averaged electron density (/m3)""" +nd_plasma_electron_line: float = None +"""Plasma line averaged electron density (/m3)""" -nd_protons: float = None -"""proton ash density (/m3)""" +nd_plasma_protons_vol_avg: float = None +"""Plasma volume averaged proton ash density (/m3)""" ntau: float = None @@ -406,8 +406,8 @@ """Lawson triple product [keV s / m3]""" -nd_impurities: float = None -"""high Z ion density (/m3)""" +nd_plasma_impurities_vol_avg: float = None +"""Plasma volume averaged impurity (Z > 2) ion density (/m3)""" gradient_length_ne: float = None @@ -448,8 +448,8 @@ """fraction of alpha power to ions""" -f_deuterium: float = None -"""deuterium fuel fraction""" +f_plasma_fuel_deuterium: float = None +"""Plasma deuterium fuel fraction""" f_p_div_lower: float = None @@ -478,8 +478,8 @@ """ -f_helium3: float = None -"""helium-3 fuel fraction""" +f_plasma_fuel_helium3: float = None +"""Plasma Helium-3 fuel fraction""" figmer: float = None @@ -504,8 +504,8 @@ """ -f_tritium: float = None -"""tritium fuel fraction""" +f_plasma_fuel_tritium: float = None +"""Plasma tritium fuel fraction""" fusden_total: float = None @@ -806,8 +806,8 @@ """margin to vertical stability""" -pres_plasma_on_axis: float = None -"""central total plasma pressure (Pa)""" +pres_plasma_thermal_on_axis: float = None +"""Plasma central thermal pressure (no fast ions or beam pressure) (Pa)""" pres_plasma_total_profile: list[float] = None """Profile of total pressure in plasma (Pa)""" @@ -827,8 +827,8 @@ n_plasma_profile_elements: int = None """Number of elements in plasma profile""" -pres_plasma_vol_avg: float = None -"""Volume averaged plasma pressure (Pa)""" +pres_plasma_thermal_vol_avg: float = None +"""Volume averaged thermal plasma pressure (no fast ions or beam pressure) (Pa)""" f_dd_branching_trit: float = None @@ -887,8 +887,8 @@ """Non-alpha charged particle fusion power per volume [MW/m3]""" -pcoef: float = None -"""profile factor (= n-weighted T / average T)""" +f_temp_plasma_electron_density_vol_avg: float = None +"""Ratio of density weighted plasma electron tempertaurature to volume averaged (Profile Factor)""" p_plasma_inner_rad_mw: float = None @@ -1375,17 +1375,17 @@ def init_physics_variables(): global alphat global aspect global beamfus0 - global beta + global beta_total_vol_avg global beta_fast_alpha - global beta_max - global beta_min + global beta_vol_avg_max + global beta_vol_avg_min global beta_beam - global beta_poloidal + global beta_poloidal_vol_avg global beta_poloidal_eps - global beta_toroidal - global beta_thermal - global beta_thermal_poloidal - global beta_thermal_toroidal + global beta_toroidal_vol_avg + global beta_thermal_vol_avg + global beta_thermal_poloidal_vol_avg + global beta_thermal_toroidal_vol_avg global beta_norm_total global beta_norm_thermal global beta_norm_poloidal @@ -1404,11 +1404,11 @@ def init_physics_variables(): global f_vol_plasma global f_r_conducting_wall global nd_plasma_electrons_vol_avg - global nd_fuel_ions + global nd_plasma_fuel_ions_vol_avg global dlamee global dlamie - global dlimit - global nd_alphas + global nd_plasma_electron_max_array + global nd_plasma_alphas_vol_avg global nd_beam_ions global nd_beam_ions_out global beta_norm_max @@ -1417,13 +1417,13 @@ def init_physics_variables(): global beta_norm_max_original_scaling global beta_norm_max_tholerus global beta_norm_max_stambaugh - global dnelimt - global nd_ions_total - global nd_electron_line - global nd_protons + global nd_plasma_electrons_max + global nd_plasma_ions_total_vol_avg + global nd_plasma_electron_line + global nd_plasma_protons_vol_avg global ntau global nTtau - global nd_impurities + global nd_plasma_impurities_vol_avg global beta_poloidal_eps_max global eps global f_c_plasma_auxiliary @@ -1431,18 +1431,18 @@ def init_physics_variables(): global f_alpha_electron global f_p_alpha_plasma_deposited global f_alpha_ion - global f_deuterium + global f_plasma_fuel_deuterium global f_p_div_lower global ffwal global f_nd_plasma_pedestal_greenwald global f_nd_plasma_separatrix_greenwald - global f_helium3 + global f_plasma_fuel_helium3 global figmer global fkzohm global fplhsep global fp_plasma_separatrix_min_mw global fne0 - global f_tritium + global f_plasma_fuel_tritium global fusden_total global fusrat_total global fusrat_plasma_dt_profile @@ -1492,7 +1492,7 @@ def init_physics_variables(): global nd_plasma_electron_on_axis global nd_plasma_ions_on_axis global m_s_limit - global pres_plasma_on_axis + global pres_plasma_thermal_on_axis global pres_plasma_total_profile global pres_plasma_electron_profile global pres_plasma_ion_total_profile @@ -1512,7 +1512,7 @@ def init_physics_variables(): global p_beam_dt_mw global p_non_alpha_charged_mw global pden_non_alpha_charged_mw - global pcoef + global f_temp_plasma_electron_density_vol_avg global p_plasma_inner_rad_mw global pden_plasma_core_rad_mw global p_dd_total_mw @@ -1628,17 +1628,17 @@ def init_physics_variables(): alphat = 0.5 aspect = 2.907 beamfus0 = 1.0 - beta = 0.042 + beta_total_vol_avg = 0.042 beta_fast_alpha = 0.0 - beta_max = 0.0 - beta_min = 0.0 + beta_vol_avg_max = 0.0 + beta_vol_avg_min = 0.0 beta_beam = 0.0 - beta_poloidal = 0.0 + beta_poloidal_vol_avg = 0.0 beta_poloidal_eps = 0.0 - beta_toroidal = 0.0 - beta_thermal = 0.0 - beta_thermal_poloidal = 0.0 - beta_thermal_toroidal = 0.0 + beta_toroidal_vol_avg = 0.0 + beta_thermal_vol_avg = 0.0 + beta_thermal_poloidal_vol_avg = 0.0 + beta_thermal_toroidal_vol_avg = 0.0 beta_norm_total = 0.0 beta_norm_thermal = 0.0 beta_norm_poloidal = 0.0 @@ -1657,11 +1657,11 @@ def init_physics_variables(): f_vol_plasma = 1.0 f_r_conducting_wall = 1.35 nd_plasma_electrons_vol_avg = 9.8e19 - nd_fuel_ions = 0.0 + nd_plasma_fuel_ions_vol_avg = 0.0 dlamee = 0.0 dlamie = 0.0 - dlimit = np.zeros(8, dtype=np.float64) - nd_alphas = 0.0 + nd_plasma_electron_max_array = np.zeros(8, dtype=np.float64) + nd_plasma_alphas_vol_avg = 0.0 nd_beam_ions = 0.0 nd_beam_ions_out = 0.0 beta_norm_max = 3.5 @@ -1670,13 +1670,13 @@ def init_physics_variables(): beta_norm_max_original_scaling = 0.0 beta_norm_max_tholerus = 0.0 beta_norm_max_stambaugh = 0.0 - dnelimt = 0.0 - nd_ions_total = 0.0 - nd_electron_line = 0.0 - nd_protons = 0.0 + nd_plasma_electrons_max = 0.0 + nd_plasma_ions_total_vol_avg = 0.0 + nd_plasma_electron_line = 0.0 + nd_plasma_protons_vol_avg = 0.0 ntau = 0.0 nTtau = 0.0 - nd_impurities = 0.0 + nd_plasma_impurities_vol_avg = 0.0 beta_poloidal_eps_max = 1.38 eps = 0.34399724802 f_c_plasma_auxiliary = 0.0 @@ -1684,18 +1684,18 @@ def init_physics_variables(): f_alpha_electron = 0.0 f_p_alpha_plasma_deposited = 0.95 f_alpha_ion = 0.0 - f_deuterium = 0.5 + f_plasma_fuel_deuterium = 0.5 f_p_div_lower = 1.0 ffwal = 0.92 f_nd_plasma_pedestal_greenwald = 0.85 f_nd_plasma_separatrix_greenwald = 0.50 - f_helium3 = 0.0 + f_plasma_fuel_helium3 = 0.0 figmer = 0.0 fkzohm = 1.0 fplhsep = 1.0 fp_plasma_separatrix_min_mw = 1.0 fne0 = 1.0 - f_tritium = 0.5 + f_plasma_fuel_tritium = 0.5 fusden_total = 0.0 fusrat_total = 0.0 fusrat_plasma_dt_profile = [] @@ -1745,7 +1745,7 @@ def init_physics_variables(): nd_plasma_electron_on_axis = 0.0 nd_plasma_ions_on_axis = 0.0 m_s_limit = 0.3 - pres_plasma_on_axis = 0.0 + pres_plasma_thermal_on_axis = 0.0 pres_plasma_total_profile = [] pres_plasma_electron_profile = [] pres_plasma_ion_total_profile = [] @@ -1765,7 +1765,7 @@ def init_physics_variables(): p_beam_dt_mw = 0.0 p_non_alpha_charged_mw = 0.0 pden_non_alpha_charged_mw = 0.0 - pcoef = 0.0 + f_temp_plasma_electron_density_vol_avg = 0.0 p_plasma_inner_rad_mw = 0.0 pden_plasma_core_rad_mw = 0.0 p_dd_total_mw = 0.0 diff --git a/process/fusion_reactions.py b/process/fusion_reactions.py index 3953078baa..83e378ad49 100644 --- a/process/fusion_reactions.py +++ b/process/fusion_reactions.py @@ -219,12 +219,12 @@ def dt_reaction(self) -> None: * self.plasma_profile.teprofile.profile_y, dt, ) - * physics_variables.f_deuterium - * physics_variables.f_tritium + * physics_variables.f_plasma_fuel_deuterium + * physics_variables.f_plasma_fuel_tritium * ( self.plasma_profile.neprofile.profile_y * ( - physics_variables.nd_fuel_ions + physics_variables.nd_plasma_fuel_ions_vol_avg / physics_variables.nd_plasma_electrons_vol_avg ) ) @@ -248,8 +248,14 @@ def dt_reaction(self) -> None: fusion_power_density = ( sigmav * reaction_energy - * (physics_variables.f_deuterium * physics_variables.nd_fuel_ions) - * (physics_variables.f_tritium * physics_variables.nd_fuel_ions) + * ( + physics_variables.f_plasma_fuel_deuterium + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) + * ( + physics_variables.f_plasma_fuel_tritium + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) ) # Power densities for different particles [MW/m^3] @@ -319,12 +325,12 @@ def dhe3_reaction(self) -> None: * self.plasma_profile.teprofile.profile_y, dhe3, ) - * physics_variables.f_deuterium - * physics_variables.f_helium3 + * physics_variables.f_plasma_fuel_deuterium + * physics_variables.f_plasma_fuel_helium3 * ( self.plasma_profile.neprofile.profile_y * ( - physics_variables.nd_fuel_ions + physics_variables.nd_plasma_fuel_ions_vol_avg / physics_variables.nd_plasma_electrons_vol_avg ) ) @@ -338,8 +344,14 @@ def dhe3_reaction(self) -> None: fusion_power_density = ( sigmav * reaction_energy - * (physics_variables.f_deuterium * physics_variables.nd_fuel_ions) - * (physics_variables.f_helium3 * physics_variables.nd_fuel_ions) + * ( + physics_variables.f_plasma_fuel_deuterium + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) + * ( + physics_variables.f_plasma_fuel_helium3 + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) ) # Power densities for different particles [MW/m^3] @@ -410,12 +422,12 @@ def dd_helion_reaction(self) -> None: * self.plasma_profile.teprofile.profile_y, dd1, ) - * physics_variables.f_deuterium - * physics_variables.f_deuterium + * physics_variables.f_plasma_fuel_deuterium + * physics_variables.f_plasma_fuel_deuterium * ( self.plasma_profile.neprofile.profile_y * ( - physics_variables.nd_fuel_ions + physics_variables.nd_plasma_fuel_ions_vol_avg / physics_variables.nd_plasma_electrons_vol_avg ) ) @@ -432,8 +444,14 @@ def dd_helion_reaction(self) -> None: sigmav * reaction_energy * (1.0 - self.f_dd_branching_trit) - * (physics_variables.f_deuterium * physics_variables.nd_fuel_ions) - * (physics_variables.f_deuterium * physics_variables.nd_fuel_ions) + * ( + physics_variables.f_plasma_fuel_deuterium + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) + * ( + physics_variables.f_plasma_fuel_deuterium + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) ) # Power densities for different particles [MW/m^3] @@ -504,12 +522,12 @@ def dd_triton_reaction(self) -> None: * self.plasma_profile.teprofile.profile_y, dd2, ) - * physics_variables.f_deuterium - * physics_variables.f_deuterium + * physics_variables.f_plasma_fuel_deuterium + * physics_variables.f_plasma_fuel_deuterium * ( self.plasma_profile.neprofile.profile_y * ( - physics_variables.nd_fuel_ions + physics_variables.nd_plasma_fuel_ions_vol_avg / physics_variables.nd_plasma_electrons_vol_avg ) ) @@ -526,8 +544,14 @@ def dd_triton_reaction(self) -> None: sigmav * reaction_energy * self.f_dd_branching_trit - * (physics_variables.f_deuterium * physics_variables.nd_fuel_ions) - * (physics_variables.f_deuterium * physics_variables.nd_fuel_ions) + * ( + physics_variables.f_plasma_fuel_deuterium + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) + * ( + physics_variables.f_plasma_fuel_deuterium + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) ) # Power densities for different particles [MW/m^3] @@ -882,7 +906,7 @@ def beam_fusion( b_plasma_toroidal_on_axis: float, c_beam_total: float, nd_plasma_electrons_vol_avg: float, - nd_fuel_ions: float, + nd_plasma_fuel_ions_vol_avg: float, ion_electron_coulomb_log: float, e_beam_kev: float, f_deuterium_plasma: float, @@ -907,7 +931,7 @@ def beam_fusion( b_plasma_toroidal_on_axis (float): Toroidal field on axis (T). c_beam_total (float): Neutral beam current (A). nd_plasma_electrons_vol_avg (float): Electron density (m^-3). - nd_fuel_ions (float): Fuel ion density (m^-3). + nd_plasma_fuel_ions_vol_avg (float): Fuel ion density (m^-3). ion_electron_coulomb_log (float): Ion-electron coulomb logarithm. e_beam_kev (float): Neutral beam energy (keV). f_deuterium_plasma (float): Deuterium fraction of main plasma. @@ -972,8 +996,8 @@ def beam_fusion( ) # Deuterium and tritium ion densities - deuterium_density = nd_fuel_ions * f_deuterium_plasma - tritium_density = nd_fuel_ions * f_tritium_plasma + deuterium_density = nd_plasma_fuel_ions_vol_avg * f_deuterium_plasma + tritium_density = nd_plasma_fuel_ions_vol_avg * f_tritium_plasma ( deuterium_beam_alpha_power, diff --git a/process/init.py b/process/init.py index b4fff3c9d1..15b7598cc0 100644 --- a/process/init.py +++ b/process/init.py @@ -368,21 +368,21 @@ def check_process(inputs): # noqa: ARG001 if ( abs( 1.0 - - data_structure.physics_variables.f_deuterium - - data_structure.physics_variables.f_tritium - - data_structure.physics_variables.f_helium3 + - data_structure.physics_variables.f_plasma_fuel_deuterium + - data_structure.physics_variables.f_plasma_fuel_tritium + - data_structure.physics_variables.f_plasma_fuel_helium3 ) > 1e-6 ): raise ProcessValidationError( "Fuel ion fractions do not sum to 1.0", - f_deuterium=data_structure.physics_variables.f_deuterium, - f_tritium=data_structure.physics_variables.f_tritium, - f_helium3=data_structure.physics_variables.f_helium3, + f_plasma_fuel_deuterium=data_structure.physics_variables.f_plasma_fuel_deuterium, + f_plasma_fuel_tritium=data_structure.physics_variables.f_plasma_fuel_tritium, + f_plasma_fuel_helium3=data_structure.physics_variables.f_plasma_fuel_helium3, ) if ( - data_structure.physics_variables.f_tritium < 1.0e-3 + data_structure.physics_variables.f_plasma_fuel_tritium < 1.0e-3 ): # tritium fraction is negligible data_structure.buildings_variables.triv = 0.0 data_structure.heat_transport_variables.p_tritium_plant_electric_mw = 0.0 diff --git a/process/input.py b/process/input.py index 264f199b15..12994f3ddb 100644 --- a/process/input.py +++ b/process/input.py @@ -116,11 +116,13 @@ def __post_init__(self): "beamfus0": InputVariable( data_structure.physics_variables, float, range=(0.01, 10.0) ), - "beta": InputVariable(data_structure.physics_variables, float, range=(0.0, 1.0)), - "beta_max": InputVariable( + "beta_total_vol_avg": InputVariable( data_structure.physics_variables, float, range=(0.0, 1.0) ), - "beta_min": InputVariable( + "beta_vol_avg_max": InputVariable( + data_structure.physics_variables, float, range=(0.0, 1.0) + ), + "beta_vol_avg_min": InputVariable( data_structure.physics_variables, float, range=(0.0, 1.0) ), "betbm0": InputVariable(data_structure.physics_variables, float, range=(0.0, 10.0)), @@ -159,7 +161,7 @@ def __post_init__(self): "f_p_div_lower": InputVariable( data_structure.physics_variables, float, range=(0.0, 1.0) ), - "f_deuterium": InputVariable( + "f_plasma_fuel_deuterium": InputVariable( data_structure.physics_variables, float, range=(0.0, 1.0) ), "ffwal": InputVariable(data_structure.physics_variables, float, range=(0.0, 10.0)), @@ -169,7 +171,7 @@ def __post_init__(self): "f_nd_plasma_separatrix_greenwald": InputVariable( data_structure.physics_variables, float, range=(-1.0, 5.0) ), - "f_helium3": InputVariable( + "f_plasma_fuel_helium3": InputVariable( data_structure.physics_variables, float, range=(-1.0, 5.0) ), # TODO: does f_nd_impurity_electrons require an additional range? @@ -716,7 +718,7 @@ def __post_init__(self): "f_t_turn_tf": InputVariable( data_structure.tfcoil_variables, float, range=(0.0, 1.0) ), - "f_tritium": InputVariable( + "f_plasma_fuel_tritium": InputVariable( data_structure.physics_variables, float, range=(0.0, 1.0) ), "f_beam_tritium": InputVariable( diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index 59b7b1efe8..f3612f8409 100644 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -61,7 +61,7 @@ "plasma_current_MA", "b_plasma_toroidal_on_axis", "q95", - "beta_poloidal", + "beta_poloidal_vol_avg", "temp_plasma_electron_vol_avg_kev", "nd_plasma_electrons_vol_avg", "hfact", @@ -114,7 +114,7 @@ "plasma_current_MA", "b_plasma_toroidal_on_axis", "q95", - "beta", + "beta_total_vol_avg", "normalised_thermal_beta", "beta_norm_total", "thermal_beta", @@ -129,7 +129,7 @@ "temp_plasma_pedestal_kev", "nd_plasma_pedestal_electron", "zeff", - "nd_impurities", + "nd_plasma_impurities_vol_avg", "t_energy_confinement", "hfact", "tauelaw", @@ -220,7 +220,7 @@ "plasma_current_MA", "b_plasma_toroidal_on_axis", "q95", - "beta", + "beta_total_vol_avg", "temp_plasma_electron_vol_avg_kev", "nd_plasma_electrons_vol_avg", "p_hcd_injected_total_mw", diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index f4d918ae50..edd9f3774b 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -101,7 +101,7 @@ "sigvvall": "max_vv_stress", "ftaucq": "fmaxvvstress", "fradmin": None, - "ftr": "f_tritium", + "ftr": "f_plasma_fuel_tritium", "iculdl": "idensl", "iiter": None, "ires": None, @@ -113,7 +113,7 @@ "fvolbi": "fhole", "fvolbo": "fhole", "fvolcry": None, - "idhe3": "f_helium3", + "idhe3": "f_plasma_fuel_helium3", "blnktth": None, "dz_blkt_upper": None, "theat": "t_fusion_ramp", @@ -129,9 +129,9 @@ "vgap": "dz_xpoint_divertor", "ftritbm": "f_tritium_bream", "enbeam": "e_beam_kev", - "fdeut": "f_deuterium", - "ftrit": "f_tritium", - "fhe3": "f_helium3", + "fdeut": "f_plasma_fuel_deuterium", + "ftrit": "f_plasma_fuel_tritium", + "fhe3": "f_plasma_fuel_helium3", "falpha": "f_p_alpha_plasma_deposited", "idensl": "i_density_limit", "ftburn": "ft_burn_min", @@ -151,8 +151,8 @@ "epbetmax": "beta_poloidal_eps_max", "dnbeta": "beta_norm_max", "ifalphap": "i_beta_fast_alpha", - "betalim": "beta_max", - "betalim_lower": "beta_min", + "betalim": "beta_vol_avg_max", + "betalim_lower": "beta_vol_avg_min", "fbeta": "fbeta_poloidal_eps", "fcwr": "fr_conducting_wall", "cvol": "f_vol_plasma", @@ -457,6 +457,12 @@ "rebco_thickness": "dx_hts_tape_rebco", "tape_thickness": "dx_hts_tape_total", "tape_width": "dr_hts_tape", + "beta": "beta_total_vol_avg", + "beta_max": "beta_vol_avg_max", + "beta_min": "beta_vol_avg_min", + "f_deuterium": "f_plasma_fuel_deuterium", + "f_tritium": "f_plasma_fuel_tritium", + "f_helium3": "f_plasma_fuel_helium3", } OBS_VARS_HELP = { diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 4ac9e3379d..eee1761b56 100644 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -2635,11 +2635,11 @@ def plot_main_plasma_information( # Add beta information textstr_beta = ( f"$\\mathbf{{Beta \\ Information:}}$\n \n" - f"Total beta,$ \\ \\beta$: {mfile_data.data['beta'].get_scan(scan):.4f}\n" - f"Thermal beta,$ \\ \\beta_{{\\text{{thermal}}}}$: {mfile_data.data['beta_thermal'].get_scan(scan):.4f}\n" - f"Toroidal beta,$ \\ \\beta_{{\\text{{t}}}}$: {mfile_data.data['beta_toroidal'].get_scan(scan):.4f}\n" - f"Poloidal beta,$ \\ \\beta_{{\\text{{p}}}}$: {mfile_data.data['beta_poloidal'].get_scan(scan):.4f}\n" - f"Fast-alpha beta,$ \\ \\beta_{{\\alpha}}$: {mfile_data.data['beta_fast_alpha'].get_scan(scan):.4f}\n" + f"Total beta,$ \\ \\langle \\beta \\rangle$: {mfile_data.data['beta_total_vol_avg'].get_scan(scan):.4f}\n" + f"Thermal beta,$ \\ \\langle \\beta_{{\\text{{thermal}}}} \\rangle$: {mfile_data.data['beta_thermal_vol_avg'].get_scan(scan):.4f}\n" + f"Toroidal beta,$ \\ \\langle \\beta_{{\\text{{t}}}} \\rangle$: {mfile_data.data['beta_toroidal_vol_avg'].get_scan(scan):.4f}\n" + f"Poloidal beta,$ \\ \\langle \\beta_{{\\text{{p}}}} \\rangle$: {mfile_data.data['beta_poloidal_vol_avg'].get_scan(scan):.4f}\n" + f"Fast-alpha beta,$ \\ \\langle \\beta_{{\\alpha}} \\rangle$: {mfile_data.data['beta_fast_alpha'].get_scan(scan):.4f}\n" f"Normalised total beta,$ \\ \\beta_{{\\text{{N}}}}$: {mfile_data.data['beta_norm_total'].get_scan(scan):.4f}\n" f"Normalised thermal beta,$ \\ \\beta_{{\\text{{N,thermal}}}}$: {mfile_data.data['beta_norm_thermal'].get_scan(scan):.4f}\n" ) @@ -2874,7 +2874,7 @@ def plot_main_plasma_information( textstr_reactions = ( f"$\\mathbf{{Fusion \\ Reactions:}}$\n \n" f"Fuel mixture: \n" - f"| D: {mfile_data.data['f_deuterium'].get_scan(scan):.2f} | T: {mfile_data.data['f_tritium'].get_scan(scan):.2f} | 3He: {mfile_data.data['f_helium3'].get_scan(scan):.2f} |\n\n" + f"| D: {mfile_data.data['f_plasma_fuel_deuterium'].get_scan(scan):.2f} | T: {mfile_data.data['f_plasma_fuel_tritium'].get_scan(scan):.2f} | 3He: {mfile_data.data['f_plasma_fuel_helium3'].get_scan(scan):.2f} |\n\n" f"Fusion Power, $P_{{\\text{{fus}}}}:$ {mfile_data.data['p_fusion_total_mw'].get_scan(scan):.2f} MW\n" f"D-T Power, $P_{{\\text{{fus,DT}}}}:$ {mfile_data.data['p_dt_total_mw'].get_scan(scan):.2f} MW\n" f"D-D Power, $P_{{\\text{{fus,DD}}}}:$ {mfile_data.data['p_dd_total_mw'].get_scan(scan):.2f} MW\n" @@ -3118,7 +3118,7 @@ def plot_main_plasma_information( # Add density limit information textstr_density_limit = ( f"$\\mathbf{{Density \\ limit:}}$\n\n" - f"$n_{{\\text{{e,limit}}}}: {mfile_data.data['dnelimt'].get_scan(scan):.3e} \\ m^{{-3}}$\n" + f"$n_{{\\text{{e,limit}}}}: {mfile_data.data['nd_plasma_electrons_max'].get_scan(scan):.3e} \\ m^{{-3}}$\n" ) axis.text( @@ -3588,13 +3588,13 @@ def plot_n_profiles(prof, demo_ranges, mfile_data, scan): + (ne0 - nd_plasma_pedestal_electron) * (1 - rhocore**2 / radius_plasma_pedestal_density_norm**2) ** alphan ) - nicore = necore * (nd_fuel_ions / nd_plasma_electrons_vol_avg) + nicore = necore * (nd_plasma_fuel_ions_vol_avg / nd_plasma_electrons_vol_avg) rhosep = np.linspace(radius_plasma_pedestal_density_norm, 1) neesep = nd_plasma_separatrix_electron + ( nd_plasma_pedestal_electron - nd_plasma_separatrix_electron ) * (1 - rhosep) / (1 - min(0.9999, radius_plasma_pedestal_density_norm)) - nisep = neesep * (nd_fuel_ions / nd_plasma_electrons_vol_avg) + nisep = neesep * (nd_plasma_fuel_ions_vol_avg / nd_plasma_electrons_vol_avg) rho = np.append(rhocore, rhosep) ne = np.append(necore, neesep) @@ -3604,7 +3604,7 @@ def plot_n_profiles(prof, demo_ranges, mfile_data, scan): rho2 = np.linspace(0.95, 1) rho = np.append(rho1, rho2) ne = ne0 * (1 - rho**2) ** alphan - ni = (ne0 * (nd_fuel_ions / nd_plasma_electrons_vol_avg)) * ( + ni = (ne0 * (nd_plasma_fuel_ions_vol_avg / nd_plasma_electrons_vol_avg)) * ( 1 - rho**2 ) ** alphan ne = ne / 1e19 @@ -3652,13 +3652,13 @@ def plot_n_profiles(prof, demo_ranges, mfile_data, scan): rf"$\hspace{{4}} \alpha_{{\text{{n}}}}$: {alphan:.3f}", rf"$n_{{\text{{e,ped}}}}$: {nd_plasma_pedestal_electron:.3e} m$^{{-3}}$" r"$ \hspace{3} \frac{\langle n_i \rangle}{\langle n_e \rangle}$: " - f"{nd_fuel_ions / nd_plasma_electrons_vol_avg:.3f}", + f"{nd_plasma_fuel_ions_vol_avg / nd_plasma_electrons_vol_avg:.3f}", rf"$f_{{\text{{GW e,ped}}}}$: {fgwped_out:.3f}" r"$ \hspace{7} \frac{n_{e,0}}{\langle n_e \rangle}$: " f"{ne0 / nd_plasma_electrons_vol_avg:.3f}", rf"$\rho_{{\text{{ped,n}}}}$: {radius_plasma_pedestal_density_norm:.3f}" r"$ \hspace{8} \frac{\overline{n_{e}}}{n_{\text{GW}}}$: " - f"{mfile_data.data['nd_electron_line'].get_scan(scan) / mfile_data.data['dlimit(7)'].get_scan(scan):.3f}", + f"{mfile_data.data['nd_plasma_electron_line'].get_scan(scan) / mfile_data.data['nd_plasma_electron_max_array(7)'].get_scan(scan):.3f}", rf"$n_{{\text{{e,sep}}}}$: {nd_plasma_separatrix_electron:.3e} m$^{{-3}}$", rf"$f_{{\text{{GW e,sep}}}}$: {fgwsep_out:.3f}", )) @@ -3676,15 +3676,15 @@ def plot_n_profiles(prof, demo_ranges, mfile_data, scan): textstr_ions = "\n".join(( r"$\langle n_{\text{ions-total}} \rangle $: " - f"{mfile_data.data['nd_ions_total'].get_scan(scan):.3e} m$^{{-3}}$", + f"{mfile_data.data['nd_plasma_ions_total_vol_avg'].get_scan(scan):.3e} m$^{{-3}}$", r"$\langle n_{\text{fuel}} \rangle $: " - f"{mfile_data.data['nd_fuel_ions'].get_scan(scan):.3e} m$^{{-3}}$", + f"{mfile_data.data['nd_plasma_fuel_ions_vol_avg'].get_scan(scan):.3e} m$^{{-3}}$", r"$\langle n_{\text{alpha}} \rangle $: " - f"{mfile_data.data['nd_alphas'].get_scan(scan):.3e} m$^{{-3}}$", + f"{mfile_data.data['nd_plasma_alphas_vol_avg'].get_scan(scan):.3e} m$^{{-3}}$", r"$\langle n_{\text{impurities}} \rangle $: " - f"{mfile_data.data['nd_impurities'].get_scan(scan):.3e} m$^{{-3}}$", + f"{mfile_data.data['nd_plasma_impurities_vol_avg'].get_scan(scan):.3e} m$^{{-3}}$", r"$\langle n_{\text{protons}} \rangle $:" - f"{mfile_data.data['nd_protons'].get_scan(scan):.3e} m$^{{-3}}$", + f"{mfile_data.data['nd_plasma_protons_vol_avg'].get_scan(scan):.3e} m$^{{-3}}$", )) prof.text( @@ -3820,7 +3820,8 @@ def plot_t_profiles(prof, demo_ranges, mfile_data, scan): te = mfile_data.data["temp_plasma_electron_vol_avg_kev"].get_scan(scan) # Add text box with temperature profile parameters textstr_temperature = "\n".join(( - rf"$\langle T_{{\text{{e}}}} \rangle$: {mfile_data.data['temp_plasma_electron_vol_avg_kev'].get_scan(scan):.3f} keV", + rf"$\langle T_{{\text{{e}}}} \rangle_\text{{V}}$: {mfile_data.data['temp_plasma_electron_vol_avg_kev'].get_scan(scan):.3f} keV" + rf"$\hspace{{3}} \langle T_{{\text{{e}}}} \rangle_\text{{n}}$: {mfile_data.data['temp_plasma_electron_density_weighted_kev'].get_scan(scan):.3f} keV", rf"$T_{{\text{{e,0}}}}$: {te0:.3f} keV" rf"$\hspace{{4}} \alpha_{{\text{{T}}}}$: {alphat:.3f}", rf"$T_{{\text{{e,ped}}}}$: {temp_plasma_pedestal_kev:.3f} keV" @@ -3829,7 +3830,9 @@ def plot_t_profiles(prof, demo_ranges, mfile_data, scan): rf"$\rho_{{\text{{ped,T}}}}$: {radius_plasma_pedestal_temp_norm:.3f}" r"$ \hspace{6} \frac{T_{e,0}}{\langle T_e \rangle}$: " f"{te0 / te:.3f}", - rf"$T_{{\text{{e,sep}}}}$: {temp_plasma_separatrix_kev:.3f} keV", + rf"$T_{{\text{{e,sep}}}}$: {temp_plasma_separatrix_kev:.3f} keV" + r"$ \hspace{4} \frac{{{\langle T_e \rangle_n}}}{{{\langle T_e \rangle_V}}}$: " + f"{mfile_data.data['f_temp_plasma_electron_density_vol_avg'].get_scan(scan):.3f}", )) props_temperature = {"boxstyle": "round", "facecolor": "wheat", "alpha": 0.5} @@ -6835,13 +6838,13 @@ def plot_physics_info(axis, mfile_data, scan): axis.set_autoscaley_on(False) axis.set_autoscalex_on(False) - nong = mfile_data.data["nd_electron_line"].get_scan(scan) / mfile_data.data[ - "dlimit(7)" + nong = mfile_data.data["nd_plasma_electron_line"].get_scan(scan) / mfile_data.data[ + "nd_plasma_electron_max_array(7)" ].get_scan(scan) - nd_impurities = mfile_data.data["nd_impurities"].get_scan(scan) / mfile_data.data[ - "nd_plasma_electrons_vol_avg" - ].get_scan(scan) + nd_plasma_impurities_vol_avg = mfile_data.data[ + "nd_plasma_impurities_vol_avg" + ].get_scan(scan) / mfile_data.data["nd_plasma_electrons_vol_avg"].get_scan(scan) tepeak = mfile_data.data["temp_plasma_electron_on_axis_kev"].get_scan( scan @@ -6866,7 +6869,7 @@ def plot_physics_info(axis, mfile_data, scan): ("q95", r"$q_{\mathrm{95}}$", ""), ("beta_norm_thermal", r"$\beta_N$, thermal", "% m T MA$^{-1}$"), ("beta_norm_toroidal", r"$\beta_N$, toroidal", "% m T MA$^{-1}$"), - ("beta_thermal_poloidal", r"$\beta_P$, thermal", ""), + ("beta_thermal_poloidal_vol_avg", r"$\beta_P$, thermal", ""), ("beta_poloidal", r"$\beta_P$, total", ""), ("te", r"$\langle T_e \rangle$", "keV"), ("nd_plasma_electrons_vol_avg", r"$\langle n_e \rangle$", "m$^{-3}$"), @@ -6874,7 +6877,11 @@ def plot_physics_info(axis, mfile_data, scan): (tepeak, r"$T_{e0} \ / \ \langle T_e \rangle$", ""), (nepeak, r"$n_{e0} \ / \ \langle n_{\mathrm{e, vol}} \rangle$", ""), ("zeff", r"$Z_{\mathrm{eff}}$", ""), - (nd_impurities, r"$n_Z \ / \ \langle n_{\mathrm{e, vol}} \rangle$", ""), + ( + nd_plasma_impurities_vol_avg, + r"$n_Z \ / \ \langle n_{\mathrm{e, vol}} \rangle$", + "", + ), ("t_energy_confinement", r"$\tau_e$", "s"), ("hfact", "H-factor", ""), (pthresh, "H-mode threshold", "MW"), @@ -7604,7 +7611,7 @@ def plot_confinement_time_comparison( rmajor = mfile_data.data["rmajor"].get_scan(scan) c_plasma_ma = mfile_data.data["plasma_current_ma"].get_scan(scan) kappa95 = mfile_data.data["kappa95"].get_scan(scan) - dnla20 = mfile_data.data["nd_electron_line"].get_scan(scan) / 1e20 + dnla20 = mfile_data.data["nd_plasma_electron_line"].get_scan(scan) / 1e20 afuel = mfile_data.data["m_fuel_amu"].get_scan(scan) b_plasma_toroidal_on_axis = mfile_data.data["b_plasma_toroidal_on_axis"].get_scan( scan @@ -7612,7 +7619,7 @@ def plot_confinement_time_comparison( p_plasma_separatrix_mw = mfile_data.data["p_plasma_separatrix_mw"].get_scan(scan) kappa = mfile_data.data["kappa"].get_scan(scan) aspect = mfile_data.data["aspect"].get_scan(scan) - dnla19 = mfile_data.data["nd_electron_line"].get_scan(scan) / 1e19 + dnla19 = mfile_data.data["nd_plasma_electron_line"].get_scan(scan) / 1e19 kappa_ipb = mfile_data.data["kappa_ipb"].get_scan(scan) triang = mfile_data.data["triang"].get_scan(scan) m_ions_total_amu = mfile_data.data["m_ions_total_amu"].get_scan(scan) @@ -8377,14 +8384,16 @@ def plot_density_limit_comparison( mfile_data (mf.MFile): MFILE data object. scan (int): Scan number to use. """ - old_asdex = mfile_data.data["dlimit(1)"].get_scan(scan) - borrass_iter_i = mfile_data.data["dlimit(2)"].get_scan(scan) - borrass_iter_ii = mfile_data.data["dlimit(3)"].get_scan(scan) - jet_edge_radiation = mfile_data.data["dlimit(4)"].get_scan(scan) - jet_simplified = mfile_data.data["dlimit(5)"].get_scan(scan) - hugill_murakami = mfile_data.data["dlimit(6)"].get_scan(scan) - greenwald = mfile_data.data["dlimit(7)"].get_scan(scan) - asdex_new = mfile_data.data["dlimit(8)"].get_scan(scan) + old_asdex = mfile_data.data["nd_plasma_electron_max_array(1)"].get_scan(scan) + borrass_iter_i = mfile_data.data["nd_plasma_electron_max_array(2)"].get_scan(scan) + borrass_iter_ii = mfile_data.data["nd_plasma_electron_max_array(3)"].get_scan(scan) + jet_edge_radiation = mfile_data.data["nd_plasma_electron_max_array(4)"].get_scan( + scan + ) + jet_simplified = mfile_data.data["nd_plasma_electron_max_array(5)"].get_scan(scan) + hugill_murakami = mfile_data.data["nd_plasma_electron_max_array(6)"].get_scan(scan) + greenwald = mfile_data.data["nd_plasma_electron_max_array(7)"].get_scan(scan) + asdex_new = mfile_data.data["nd_plasma_electron_max_array(8)"].get_scan(scan) # Data for the box plot data = { @@ -11119,7 +11128,7 @@ def main(args=None): global alphan global alphat global ne0 - global nd_fuel_ions + global nd_plasma_fuel_ions_vol_avg global nd_plasma_electrons_vol_avg global te0 global ti @@ -11149,7 +11158,9 @@ def main(args=None): alphan = m_file.data["alphan"].get_scan(scan) alphat = m_file.data["alphat"].get_scan(scan) ne0 = m_file.data["nd_plasma_electron_on_axis"].get_scan(scan) - nd_fuel_ions = m_file.data["nd_fuel_ions"].get_scan(scan) + nd_plasma_fuel_ions_vol_avg = m_file.data["nd_plasma_fuel_ions_vol_avg"].get_scan( + scan + ) nd_plasma_electrons_vol_avg = m_file.data["nd_plasma_electrons_vol_avg"].get_scan( scan ) diff --git a/process/io/variable_metadata.py b/process/io/variable_metadata.py index a1fb928cda..04d94c5411 100644 --- a/process/io/variable_metadata.py +++ b/process/io/variable_metadata.py @@ -184,7 +184,7 @@ class VariableMetadata: description="Bore radius", units="m", ), - "nd_electron_line": VariableMetadata( + "nd_plasma_electron_line": VariableMetadata( latex=r"$\bar{n}_{\mathrm{e}}$[$m^{-3}$]", description="Average electron density", units="m^{-3}", diff --git a/process/iteration_variables.py b/process/iteration_variables.py index 6880205110..5778199737 100644 --- a/process/iteration_variables.py +++ b/process/iteration_variables.py @@ -40,7 +40,9 @@ class IterationVariable: 4: IterationVariable( "temp_plasma_electron_vol_avg_kev", data_structure.physics_variables, 5.0, 150.0 ), - 5: IterationVariable("beta", data_structure.physics_variables, 0.001, 1.0), + 5: IterationVariable( + "beta_total_vol_avg", data_structure.physics_variables, 0.001, 1.0 + ), 6: IterationVariable( "nd_plasma_electrons_vol_avg", data_structure.physics_variables, 2.0e19, 1.0e21 ), @@ -424,7 +426,9 @@ class IterationVariable: 172: IterationVariable( "dx_tf_side_case_min", data_structure.tfcoil_variables, 0.001, 1.0 ), - 173: IterationVariable("f_tritium", data_structure.physics_variables, 0.000, 1.000), + 173: IterationVariable( + "f_plasma_fuel_tritium", data_structure.physics_variables, 0.000, 1.000 + ), 174: IterationVariable("triang", data_structure.physics_variables, 0.00, 1.00), 175: IterationVariable("kappa", data_structure.physics_variables, 0.00, 10.00), } diff --git a/process/pfcoil.py b/process/pfcoil.py index 4b0023c66d..45d0367798 100644 --- a/process/pfcoil.py +++ b/process/pfcoil.py @@ -409,7 +409,7 @@ def pfcoil(self): / pv.rmajor * ( math.log(8.0e0 * pv.aspect) - + pv.beta_poloidal + + pv.beta_poloidal_vol_avg + (pv.ind_plasma_internal_norm / 2.0e0) - 1.5e0 ) @@ -531,7 +531,7 @@ def pfcoil(self): / pv.rmajor * ( math.log(8.0e0 * pv.aspect) - + pv.beta_poloidal + + pv.beta_poloidal_vol_avg + (pv.ind_plasma_internal_norm / 2.0e0) - 1.5e0 ) diff --git a/process/physics.py b/process/physics.py index 9d9ab8ec83..736ae760e0 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1595,9 +1595,9 @@ def physics(self): ) = self.calculate_plasma_masses( physics_variables.m_fuel_amu, physics_variables.m_ions_total_amu, - physics_variables.nd_ions_total, - physics_variables.nd_fuel_ions, - physics_variables.nd_alphas, + physics_variables.nd_plasma_ions_total_vol_avg, + physics_variables.nd_plasma_fuel_ions_vol_avg, + physics_variables.nd_plasma_alphas_vol_avg, physics_variables.vol_plasma, physics_variables.nd_plasma_electrons_vol_avg, ) @@ -1628,7 +1628,7 @@ def physics(self): physics_variables.i_plasma_current, physics_variables.kappa, physics_variables.kappa95, - physics_variables.pres_plasma_on_axis, + physics_variables.pres_plasma_thermal_on_axis, physics_variables.len_plasma_poloidal, physics_variables.q95, physics_variables.rmajor, @@ -1741,39 +1741,39 @@ def physics(self): # Beta Components # ----------------------------------------------------- - physics_variables.beta_toroidal = ( - physics_variables.beta + physics_variables.beta_toroidal_vol_avg = ( + physics_variables.beta_total_vol_avg * physics_variables.b_plasma_total**2 / physics_variables.b_plasma_toroidal_on_axis**2 ) # Calculate physics_variables.beta poloidal [-] - physics_variables.beta_poloidal = calculate_poloidal_beta( + physics_variables.beta_poloidal_vol_avg = calculate_poloidal_beta( physics_variables.b_plasma_total, physics_variables.b_plasma_poloidal_average, - physics_variables.beta, + physics_variables.beta_total_vol_avg, ) - physics_variables.beta_thermal = ( - physics_variables.beta + physics_variables.beta_thermal_vol_avg = ( + physics_variables.beta_total_vol_avg - physics_variables.beta_fast_alpha - physics_variables.beta_beam ) physics_variables.beta_poloidal_eps = ( - physics_variables.beta_poloidal * physics_variables.eps + physics_variables.beta_poloidal_vol_avg * physics_variables.eps ) - physics_variables.beta_thermal_poloidal = ( - physics_variables.beta_thermal + physics_variables.beta_thermal_poloidal_vol_avg = ( + physics_variables.beta_thermal_vol_avg * ( physics_variables.b_plasma_total / physics_variables.b_plasma_poloidal_average ) ** 2 ) - physics_variables.beta_thermal_toroidal = ( - physics_variables.beta_thermal + physics_variables.beta_thermal_toroidal_vol_avg = ( + physics_variables.beta_thermal_vol_avg * ( physics_variables.b_plasma_total / physics_variables.b_plasma_toroidal_on_axis @@ -1782,7 +1782,7 @@ def physics(self): ) physics_variables.beta_norm_thermal = ( 1.0e8 - * physics_variables.beta_thermal + * physics_variables.beta_thermal_vol_avg * physics_variables.rminor * physics_variables.b_plasma_toroidal_on_axis / physics_variables.plasma_current @@ -1806,12 +1806,12 @@ def physics(self): physics_variables.f_beta_alpha_beam_thermal = ( physics_variables.beta_fast_alpha + physics_variables.beta_beam - ) / physics_variables.beta_thermal + ) / physics_variables.beta_thermal_vol_avg # Plasma thermal energy derived from the thermal beta physics_variables.e_plasma_beta_thermal = ( 1.5e0 - * physics_variables.beta_thermal + * physics_variables.beta_thermal_vol_avg * physics_variables.b_plasma_total * physics_variables.b_plasma_total / (2.0e0 * constants.RMU0) @@ -1821,7 +1821,7 @@ def physics(self): # Plasma thermal energy derived from the total beta physics_variables.e_plasma_beta = ( 1.5e0 - * physics_variables.beta + * physics_variables.beta_total_vol_avg * physics_variables.b_plasma_total * physics_variables.b_plasma_total / (2.0e0 * constants.RMU0) @@ -1893,13 +1893,15 @@ def physics(self): # Hender scaling for diamagnetic current at tight physics_variables.aspect ratio current_drive_variables.f_c_plasma_diamagnetic_hender = ( - diamagnetic_fraction_hender(physics_variables.beta) + diamagnetic_fraction_hender(physics_variables.beta_total_vol_avg) ) # SCENE scaling for diamagnetic current current_drive_variables.f_c_plasma_diamagnetic_scene = ( diamagnetic_fraction_scene( - physics_variables.beta, physics_variables.q95, physics_variables.q0 + physics_variables.beta_total_vol_avg, + physics_variables.q95, + physics_variables.q0, ) ) @@ -1918,7 +1920,7 @@ def physics(self): # Pfirsch-Schlüter scaling for diamagnetic current current_drive_variables.f_c_plasma_pfirsch_schluter_scene = ps_fraction_scene( - physics_variables.beta + physics_variables.beta_total_vol_avg ) if physics_variables.i_pfirsch_schluter_current == 1: @@ -1935,7 +1937,7 @@ def physics(self): current_drive_variables.cboot * self.bootstrap_fraction_iter89( physics_variables.aspect, - physics_variables.beta, + physics_variables.beta_total_vol_avg, physics_variables.b_plasma_total, physics_variables.plasma_current, physics_variables.q95, @@ -1950,7 +1952,7 @@ def physics(self): * self.bootstrap_fraction_nevins( physics_variables.alphan, physics_variables.alphat, - physics_variables.beta_toroidal, + physics_variables.beta_toroidal_vol_avg, physics_variables.b_plasma_toroidal_on_axis, physics_variables.nd_plasma_electrons_vol_avg, physics_variables.plasma_current, @@ -1970,7 +1972,7 @@ def physics(self): physics_variables.alphaj, physics_variables.alphap, physics_variables.alphat, - physics_variables.beta_thermal_poloidal, + physics_variables.beta_thermal_poloidal_vol_avg, physics_variables.q0, physics_variables.q95, physics_variables.rmajor, @@ -1986,7 +1988,7 @@ def physics(self): current_drive_variables.f_c_plasma_bootstrap_sakai = ( current_drive_variables.cboot * self.bootstrap_fraction_sakai( - beta_poloidal=physics_variables.beta_poloidal, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, q95=physics_variables.q95, q0=physics_variables.q0, alphan=physics_variables.alphan, @@ -1999,7 +2001,7 @@ def physics(self): current_drive_variables.f_c_plasma_bootstrap_aries = ( current_drive_variables.cboot * self.bootstrap_fraction_aries( - beta_poloidal=physics_variables.beta_poloidal, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, ind_plasma_internal_norm=physics_variables.ind_plasma_internal_norm, core_density=physics_variables.nd_plasma_electron_on_axis, average_density=physics_variables.nd_plasma_electrons_vol_avg, @@ -2010,16 +2012,16 @@ def physics(self): current_drive_variables.f_c_plasma_bootstrap_andrade = ( current_drive_variables.cboot * self.bootstrap_fraction_andrade( - beta_poloidal=physics_variables.beta_poloidal, - core_pressure=physics_variables.pres_plasma_on_axis, - average_pressure=physics_variables.pres_plasma_vol_avg, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, + core_pressure=physics_variables.pres_plasma_thermal_on_axis, + average_pressure=physics_variables.pres_plasma_thermal_vol_avg, inverse_aspect=physics_variables.eps, ) ) current_drive_variables.f_c_plasma_bootstrap_hoang = ( current_drive_variables.cboot * self.bootstrap_fraction_hoang( - beta_poloidal=physics_variables.beta_poloidal, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, pressure_index=physics_variables.alphap, current_index=physics_variables.alphaj, inverse_aspect=physics_variables.eps, @@ -2028,7 +2030,7 @@ def physics(self): current_drive_variables.f_c_plasma_bootstrap_wong = ( current_drive_variables.cboot * self.bootstrap_fraction_wong( - beta_poloidal=physics_variables.beta_poloidal, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, density_index=physics_variables.alphan, temperature_index=physics_variables.alphat, inverse_aspect=physics_variables.eps, @@ -2038,7 +2040,7 @@ def physics(self): current_drive_variables.bscf_gi_i = ( current_drive_variables.cboot * self.bootstrap_fraction_gi_I( - beta_poloidal=physics_variables.beta_poloidal, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, pressure_index=physics_variables.alphap, temperature_index=physics_variables.alphat, inverse_aspect=physics_variables.eps, @@ -2051,7 +2053,7 @@ def physics(self): current_drive_variables.bscf_gi_ii = ( current_drive_variables.cboot * self.bootstrap_fraction_gi_II( - beta_poloidal=physics_variables.beta_poloidal, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, pressure_index=physics_variables.alphap, temperature_index=physics_variables.alphat, inverse_aspect=physics_variables.eps, @@ -2062,7 +2064,7 @@ def physics(self): current_drive_variables.cboot * self.bootstrap_fraction_sugiyama_l_mode( eps=physics_variables.eps, - beta_poloidal=physics_variables.beta_poloidal, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, alphan=physics_variables.alphan, alphat=physics_variables.alphat, zeff=physics_variables.zeff, @@ -2074,7 +2076,7 @@ def physics(self): current_drive_variables.cboot * self.bootstrap_fraction_sugiyama_h_mode( eps=physics_variables.eps, - beta_poloidal=physics_variables.beta_poloidal, + beta_poloidal=physics_variables.beta_poloidal_vol_avg, alphan=physics_variables.alphan, alphat=physics_variables.alphat, tbeta=physics_variables.tbeta, @@ -2083,7 +2085,7 @@ def physics(self): q0=physics_variables.q0, radius_plasma_pedestal_density_norm=physics_variables.radius_plasma_pedestal_density_norm, nd_plasma_pedestal_electron=physics_variables.nd_plasma_pedestal_electron, - n_greenwald=physics_variables.dlimit[6], + n_greenwald=physics_variables.nd_plasma_electron_max_array[6], temp_plasma_pedestal_kev=physics_variables.temp_plasma_pedestal_kev, ) ) @@ -2203,11 +2205,11 @@ def physics(self): physics_variables.b_plasma_toroidal_on_axis, current_drive_variables.c_beam_total, physics_variables.nd_plasma_electrons_vol_avg, - physics_variables.nd_fuel_ions, + physics_variables.nd_plasma_fuel_ions_vol_avg, physics_variables.dlamie, current_drive_variables.e_beam_kev, - physics_variables.f_deuterium, - physics_variables.f_tritium, + physics_variables.f_plasma_fuel_deuterium, + physics_variables.f_plasma_fuel_tritium, current_drive_variables.f_beam_tritium, physics_variables.sigmav_dt_average, physics_variables.temp_plasma_electron_density_weighted_kev, @@ -2278,8 +2280,8 @@ def physics(self): physics_variables.b_plasma_poloidal_average, physics_variables.b_plasma_toroidal_on_axis, physics_variables.nd_plasma_electrons_vol_avg, - physics_variables.nd_fuel_ions, - physics_variables.nd_ions_total, + physics_variables.nd_plasma_fuel_ions_vol_avg, + physics_variables.nd_plasma_ions_total_vol_avg, physics_variables.temp_plasma_electron_density_weighted_kev, physics_variables.temp_plasma_ion_density_weighted_kev, physics_variables.pden_alpha_total_mw, @@ -2385,7 +2387,7 @@ def physics(self): # Calculate L- to H-mode power threshold for different scalings physics_variables.l_h_threshold_powers = l_h_threshold_power( - physics_variables.nd_electron_line, + physics_variables.nd_plasma_electron_line, physics_variables.b_plasma_toroidal_on_axis, physics_variables.rmajor, physics_variables.rminor, @@ -2457,8 +2459,8 @@ def physics(self): # Density limit ( - physics_variables.dlimit, - physics_variables.dnelimt, + physics_variables.nd_plasma_electron_max_array, + physics_variables.nd_plasma_electrons_max, ) = self.calculate_density_limit( physics_variables.b_plasma_toroidal_on_axis, physics_variables.i_density_limit, @@ -2488,9 +2490,9 @@ def physics(self): physics_variables.p_alpha_total_mw, physics_variables.aspect, physics_variables.b_plasma_toroidal_on_axis, - physics_variables.nd_ions_total, + physics_variables.nd_plasma_ions_total_vol_avg, physics_variables.nd_plasma_electrons_vol_avg, - physics_variables.nd_electron_line, + physics_variables.nd_plasma_electron_line, physics_variables.eps, physics_variables.hfact, physics_variables.i_confinement_time, @@ -2564,12 +2566,12 @@ def physics(self): physics_variables.aspect, physics_variables.nd_plasma_electrons_vol_avg, physics_variables.temp_plasma_electron_vol_avg_kev, - physics_variables.nd_fuel_ions, + physics_variables.nd_plasma_fuel_ions_vol_avg, physics_variables.fusden_total, physics_variables.fusden_alpha_total, physics_variables.plasma_current, sbar, - physics_variables.nd_alphas, + physics_variables.nd_plasma_alphas_vol_avg, physics_variables.t_energy_confinement, physics_variables.vol_plasma, ) @@ -2606,8 +2608,8 @@ def physics(self): physics_variables.beta_norm_max_thloreus = ( self.calculate_beta_norm_max_thloreus( c_beta=physics_variables.c_beta, - pres_plasma_on_axis=physics_variables.pres_plasma_on_axis, - pres_plasma_vol_avg=physics_variables.pres_plasma_vol_avg, + pres_plasma_on_axis=physics_variables.pres_plasma_thermal_on_axis, + pres_plasma_vol_avg=physics_variables.pres_plasma_thermal_vol_avg, ) ) @@ -2641,8 +2643,8 @@ def physics(self): i_beta_norm_max=physics_variables.i_beta_norm_max, ) - # calculate_beta_limit() returns the beta_max for beta - physics_variables.beta_max = calculate_beta_limit( + # calculate_beta_limit() returns the beta_vol_avg_max for beta + physics_variables.beta_vol_avg_max = calculate_beta_limit( physics_variables.b_plasma_toroidal_on_axis, physics_variables.beta_norm_max, physics_variables.plasma_current, @@ -2803,7 +2805,7 @@ def physics(self): ), ) fgw = ( - physics_variables.dlimit[6] + physics_variables.nd_plasma_electron_max_array[6] / physics_variables.nd_plasma_electrons_vol_avg ) # calculate separatrix temperature, if Reinke criterion is used @@ -3072,8 +3074,8 @@ def calculate_density_limit( Returns: Tuple[np.ndarray, float]: A tuple containing: - - dlimit (np.ndarray): Average plasma density limit using seven different models (m^-3). - - dnelimt (float): Enforced average plasma density limit (m^-3). + - nd_plasma_electron_max_array (np.ndarray): Average plasma density limit using seven different models (m^-3). + - nd_plasma_electrons_max (float): Enforced average plasma density limit (m^-3). Raises: ValueError: If i_density_limit is not between 1 and 7. @@ -3096,7 +3098,7 @@ def calculate_density_limit( "Illegal value for i_density_limit", i_density_limit=i_density_limit ) - dlimit = np.empty((8,)) + nd_plasma_electron_max_array = np.empty((8,)) # Power per unit area crossing the plasma edge # (excludes radiation and neutrons) @@ -3107,7 +3109,7 @@ def calculate_density_limit( # This applies to the density at the plasma edge, so must be scaled # to give the density limit applying to the average plasma density. - dlimit[0] = ( + nd_plasma_electron_max_array[0] = ( 1.54e20 * p_perp**0.43 * b_plasma_toroidal_on_axis**0.31 @@ -3119,7 +3121,7 @@ def calculate_density_limit( # to give the density limit applying to the average plasma density. # Borrass et al, ITER-TN-PH-9-6 (1989) - dlimit[1] = ( + nd_plasma_electron_max_array[1] = ( 1.8e20 * p_perp**0.53 * b_plasma_toroidal_on_axis**0.31 @@ -3132,7 +3134,7 @@ def calculate_density_limit( # This formula is (almost) identical to that in the original routine # denlim (now deleted). - dlimit[2] = ( + nd_plasma_electron_max_array[2] = ( 0.5e20 * p_perp**0.57 * b_plasma_toroidal_on_axis**0.31 @@ -3148,19 +3150,21 @@ def calculate_density_limit( if denom <= 0.0: if i_density_limit == 4: logger.error( - f"qcyl < 4/3; dlimit(4) set to zero; model 5 will be enforced instead. {denom=} {qcyl=}" + f"qcyl < 4/3; nd_plasma_electron_max_array(4) set to zero; model 5 will be enforced instead. {denom=} {qcyl=}" ) i_density_limit = 5 - dlimit[3] = 0.0 + nd_plasma_electron_max_array[3] = 0.0 else: - dlimit[3] = (1.0e20 * np.sqrt(p_hcd_injected_total_mw / denom)) / prn1 + nd_plasma_electron_max_array[3] = ( + 1.0e20 * np.sqrt(p_hcd_injected_total_mw / denom) + ) / prn1 # JET simplified density limit model # This applies to the density at the plasma edge, so must be scaled # to give the density limit applying to the average plasma density. - dlimit[4] = ( + nd_plasma_electron_max_array[4] = ( 0.237e20 * b_plasma_toroidal_on_axis * np.sqrt(p_plasma_separatrix_mw) @@ -3170,13 +3174,17 @@ def calculate_density_limit( # Hugill-Murakami M.q limit # qcyl=qstar here, which is okay according to the literature - dlimit[5] = 3.0e20 * b_plasma_toroidal_on_axis / (rmajor * qcyl) + nd_plasma_electron_max_array[5] = ( + 3.0e20 * b_plasma_toroidal_on_axis / (rmajor * qcyl) + ) # Greenwald limit - dlimit[6] = 1.0e14 * plasma_current / (np.pi * rminor * rminor) + nd_plasma_electron_max_array[6] = ( + 1.0e14 * plasma_current / (np.pi * rminor * rminor) + ) - dlimit[7] = ( + nd_plasma_electron_max_array[7] = ( 1.0e20 * 0.506 * (p_hcd_injected_total_mw**0.396 * (plasma_current / 1.0e6) ** 0.265) @@ -3185,7 +3193,9 @@ def calculate_density_limit( # Enforce the chosen density limit - return dlimit, dlimit[i_density_limit - 1] + return nd_plasma_electron_max_array, nd_plasma_electron_max_array[ + i_density_limit - 1 + ] @staticmethod def plasma_composition() -> None: @@ -3219,7 +3229,7 @@ def plasma_composition() -> None: """ # Alpha ash portion - physics_variables.nd_alphas = ( + physics_variables.nd_plasma_alphas_vol_avg = ( physics_variables.nd_plasma_electrons_vol_avg * physics_variables.f_nd_alpha_electron ) @@ -3232,16 +3242,17 @@ def plasma_composition() -> None: # Issue #557 Allow f_nd_protium_electrons impurity to be specified: 'f_nd_protium_electrons' # This will override the calculated value which is a minimum. if physics_variables.fusden_alpha_total < 1.0e-6: # not calculated yet... - physics_variables.nd_protons = max( + physics_variables.nd_plasma_protons_vol_avg = max( physics_variables.f_nd_protium_electrons * physics_variables.nd_plasma_electrons_vol_avg, - physics_variables.nd_alphas * (physics_variables.f_helium3 + 1.0e-3), + physics_variables.nd_plasma_alphas_vol_avg + * (physics_variables.f_plasma_fuel_helium3 + 1.0e-3), ) # rough estimate else: - physics_variables.nd_protons = max( + physics_variables.nd_plasma_protons_vol_avg = max( physics_variables.f_nd_protium_electrons * physics_variables.nd_plasma_electrons_vol_avg, - physics_variables.nd_alphas + physics_variables.nd_plasma_alphas_vol_avg * physics_variables.proton_rate_density / physics_variables.fusden_alpha_total, ) @@ -3277,18 +3288,20 @@ def plasma_composition() -> None: # znfuel is the sum of Zi.ni for the three fuel ions znfuel = ( physics_variables.nd_plasma_electrons_vol_avg - - 2.0 * physics_variables.nd_alphas - - physics_variables.nd_protons + - 2.0 * physics_variables.nd_plasma_alphas_vol_avg + - physics_variables.nd_plasma_protons_vol_avg - physics_variables.nd_beam_ions - znimp ) # ====================================================================== - # Fuel ion density, nd_fuel_ions - # For D-T-He3 mix, nd_fuel_ions = nD + nT + nHe3, while znfuel = nD + nT + 2*nHe3 - # So nd_fuel_ions = znfuel - nHe3 = znfuel - f_helium3*nd_fuel_ions - physics_variables.nd_fuel_ions = znfuel / (1.0 + physics_variables.f_helium3) + # Fuel ion density, nd_plasma_fuel_ions_vol_avg + # For D-T-He3 mix, nd_plasma_fuel_ions_vol_avg = nD + nT + nHe3, while znfuel = nD + nT + 2*nHe3 + # So nd_plasma_fuel_ions_vol_avg = znfuel - nHe3 = znfuel - f_plasma_fuel_helium3*nd_plasma_fuel_ions_vol_avg + physics_variables.nd_plasma_fuel_ions_vol_avg = znfuel / ( + 1.0 + physics_variables.f_plasma_fuel_helium3 + ) # ====================================================================== @@ -3297,17 +3310,20 @@ def plasma_composition() -> None: impurity_radiation_module.f_nd_impurity_electron_array[ impurity_radiation.element2index("H_") ] = ( - physics_variables.nd_protons - + (physics_variables.f_deuterium + physics_variables.f_tritium) - * physics_variables.nd_fuel_ions + physics_variables.nd_plasma_protons_vol_avg + + ( + physics_variables.f_plasma_fuel_deuterium + + physics_variables.f_plasma_fuel_tritium + ) + * physics_variables.nd_plasma_fuel_ions_vol_avg + physics_variables.nd_beam_ions ) / physics_variables.nd_plasma_electrons_vol_avg impurity_radiation_module.f_nd_impurity_electron_array[ impurity_radiation.element2index("He") ] = ( - physics_variables.f_helium3 - * physics_variables.nd_fuel_ions + physics_variables.f_plasma_fuel_helium3 + * physics_variables.nd_plasma_fuel_ions_vol_avg / physics_variables.nd_plasma_electrons_vol_avg + physics_variables.f_nd_alpha_electron ) @@ -3315,10 +3331,10 @@ def plasma_composition() -> None: # ====================================================================== # Total impurity density - physics_variables.nd_impurities = 0.0 + physics_variables.nd_plasma_impurities_vol_avg = 0.0 for imp in range(impurity_radiation_module.N_IMPURITIES): if impurity_radiation_module.impurity_arr_z[imp] > 2: - physics_variables.nd_impurities += ( + physics_variables.nd_plasma_impurities_vol_avg += ( impurity_radiation_module.f_nd_impurity_electron_array[imp] * physics_variables.nd_plasma_electrons_vol_avg ) @@ -3326,12 +3342,12 @@ def plasma_composition() -> None: # ====================================================================== # Total ion density - physics_variables.nd_ions_total = ( - physics_variables.nd_fuel_ions - + physics_variables.nd_alphas - + physics_variables.nd_protons + physics_variables.nd_plasma_ions_total_vol_avg = ( + physics_variables.nd_plasma_fuel_ions_vol_avg + + physics_variables.nd_plasma_alphas_vol_avg + + physics_variables.nd_plasma_protons_vol_avg + physics_variables.nd_beam_ions - + physics_variables.nd_impurities + + physics_variables.nd_plasma_impurities_vol_avg ) # ====================================================================== @@ -3379,7 +3395,7 @@ def plasma_composition() -> None: # (used with electron and ion power balance equations only) # No consideration of pden_non_alpha_charged_mw here... - # pcoef now calculated in plasma_profiles, after the very first + # f_temp_plasma_electron_density_vol_avg now calculated in plasma_profiles, after the very first # call of plasma_composition; use old parabolic profile estimate # in this case if physics_variables.first_call == 1: @@ -3390,7 +3406,7 @@ def plasma_composition() -> None: ) physics_variables.first_call = 0 else: - pc = physics_variables.pcoef + pc = physics_variables.f_temp_plasma_electron_density_vol_avg physics_variables.f_alpha_electron = 0.88155 * np.exp( -physics_variables.temp_plasma_electron_vol_avg_kev * pc / 67.4036 @@ -3401,9 +3417,9 @@ def plasma_composition() -> None: # Average atomic masses of injected fuel species physics_variables.m_fuel_amu = ( - (constants.M_DEUTERON_AMU * physics_variables.f_deuterium) - + (constants.M_TRITON_AMU * physics_variables.f_tritium) - + (constants.M_HELION_AMU * physics_variables.f_helium3) + (constants.M_DEUTERON_AMU * physics_variables.f_plasma_fuel_deuterium) + + (constants.M_TRITON_AMU * physics_variables.f_plasma_fuel_tritium) + + (constants.M_HELION_AMU * physics_variables.f_plasma_fuel_helium3) ) # ====================================================================== @@ -3418,9 +3434,12 @@ def plasma_composition() -> None: # Average mass of all ions physics_variables.m_ions_total_amu = ( - (physics_variables.m_fuel_amu * physics_variables.nd_fuel_ions) - + (constants.M_ALPHA_AMU * physics_variables.nd_alphas) - + (physics_variables.nd_protons * constants.M_PROTON_AMU) + ( + physics_variables.m_fuel_amu + * physics_variables.nd_plasma_fuel_ions_vol_avg + ) + + (constants.M_ALPHA_AMU * physics_variables.nd_plasma_alphas_vol_avg) + + (physics_variables.nd_plasma_protons_vol_avg * constants.M_PROTON_AMU) + (physics_variables.m_beam_amu * physics_variables.nd_beam_ions) ) for imp in range(impurity_radiation_module.N_IMPURITIES): @@ -3432,7 +3451,8 @@ def plasma_composition() -> None: ) physics_variables.m_ions_total_amu = ( - physics_variables.m_ions_total_amu / physics_variables.nd_ions_total + physics_variables.m_ions_total_amu + / physics_variables.nd_plasma_ions_total_vol_avg ) # ====================================================================== @@ -3441,23 +3461,23 @@ def plasma_composition() -> None: # Sum of (Zi^2*n_i) / m_i physics_variables.zeffai = ( ( - physics_variables.f_deuterium - * physics_variables.nd_fuel_ions + physics_variables.f_plasma_fuel_deuterium + * physics_variables.nd_plasma_fuel_ions_vol_avg / constants.M_DEUTERON_AMU ) + ( - physics_variables.f_tritium - * physics_variables.nd_fuel_ions + physics_variables.f_plasma_fuel_tritium + * physics_variables.nd_plasma_fuel_ions_vol_avg / constants.M_TRITON_AMU ) + ( 4.0 - * physics_variables.f_helium3 - * physics_variables.nd_fuel_ions + * physics_variables.f_plasma_fuel_helium3 + * physics_variables.nd_plasma_fuel_ions_vol_avg / constants.M_HELION_AMU ) - + (4.0 * physics_variables.nd_alphas / constants.M_ALPHA_AMU) - + (physics_variables.nd_protons / constants.M_PROTON_AMU) + + (4.0 * physics_variables.nd_plasma_alphas_vol_avg / constants.M_ALPHA_AMU) + + (physics_variables.nd_plasma_protons_vol_avg / constants.M_PROTON_AMU) + ( (1.0 - current_drive_variables.f_beam_tritium) * physics_variables.nd_beam_ions @@ -3488,12 +3508,12 @@ def phyaux( aspect: float, nd_plasma_electrons_vol_avg: float, te: float, - nd_fuel_ions: float, + nd_plasma_fuel_ions_vol_avg: float, fusden_total: float, fusden_alpha_total: float, plasma_current: float, sbar: float, - nd_alphas: float, + nd_plasma_alphas_vol_avg: float, t_energy_confinement: float, vol_plasma: float, ) -> tuple[float, float, float, float, float, float, float, float]: @@ -3503,12 +3523,12 @@ def phyaux( aspect (float): Plasma aspect ratio. nd_plasma_electrons_vol_avg (float): Electron density (/m3). te (float): Volume avergaed electron temperature (keV). - nd_fuel_ions (float): Fuel ion density (/m3). + nd_plasma_fuel_ions_vol_avg (float): Fuel ion density (/m3). fusden_total (float): Fusion reaction rate from plasma and beams (/m3/s). fusden_alpha_total (float): Alpha particle production rate (/m3/s). plasma_current (float): Plasma current (A). sbar (float): Exponent for aspect ratio (normally 1). - nd_alphas (float): Alpha ash density (/m3). + nd_plasma_alphas_vol_avg (float): Alpha ash density (/m3). t_energy_confinement (float): Global energy confinement time (s). vol_plasma (float): Plasma volume (m3). @@ -3537,7 +3557,7 @@ def phyaux( # Alpha particle confinement time (s) # Number of alphas / alpha production rate if fusden_alpha_total != 0.0: - t_alpha_confinement = nd_alphas / fusden_alpha_total + t_alpha_confinement = nd_plasma_alphas_vol_avg / fusden_alpha_total else: # only likely if DD is only active fusion reaction t_alpha_confinement = 0.0 @@ -3553,8 +3573,8 @@ def phyaux( # Remember that unburnt fuel-ion pairs/m3 = 0.5 * unburnt fuel-ions/m3 if physics_variables.burnup_in <= 1.0e-9: burnup = ( - nd_alphas - / (nd_alphas + 0.5 * nd_fuel_ions) + nd_plasma_alphas_vol_avg + / (nd_plasma_alphas_vol_avg + 0.5 * nd_plasma_fuel_ions_vol_avg) / physics_variables.tauratio ) else: @@ -3811,7 +3831,7 @@ def calculate_plasma_current( # Normalised beta from Troyon beta limit physics_variables.beta_norm_total = ( 1.0e8 - * physics_variables.beta + * physics_variables.beta_total_vol_avg * rminor * b_plasma_toroidal_on_axis / plasma_current @@ -3897,7 +3917,7 @@ def outplas(self): * physics_variables.rmajor**2 * physics_variables.b_plasma_toroidal_on_axis * np.sqrt(physics_variables.eps) - * physics_variables.nd_electron_line**3 + * physics_variables.nd_plasma_electron_line**3 * physics_variables.kappa / (physics_variables.e_plasma_beta**2 * physics_variables.plasma_current) ) @@ -3910,7 +3930,7 @@ def outplas(self): / ( 3.0e0 * physics_variables.vol_plasma - * physics_variables.nd_electron_line + * physics_variables.nd_plasma_electron_line ) ) / ( constants.ELECTRON_CHARGE @@ -4309,50 +4329,55 @@ def outplas(self): po.ovarrf( self.outfile, "Upper limit on total beta", - "(beta_max)", - physics_variables.beta_max, + "(beta_vol_avg_max)", + physics_variables.beta_vol_avg_max, "OP ", ) elif physics_variables.i_beta_component == 1: po.ovarrf( self.outfile, "Upper limit on thermal beta", - "(beta_max)", - physics_variables.beta_max, + "(beta_vol_avg_max)", + physics_variables.beta_vol_avg_max, "OP ", ) else: po.ovarrf( self.outfile, "Upper limit on thermal + NB beta", - "(beta_max)", - physics_variables.beta_max, + "(beta_vol_avg_max)", + physics_variables.beta_vol_avg_max, "OP ", ) - po.ovarre(self.outfile, "Total plasma beta", "(beta)", physics_variables.beta) + po.ovarre( + self.outfile, + "Total plasma beta", + "(beta_total_vol_avg)", + physics_variables.beta_total_vol_avg, + ) if physics_variables.i_beta_component == 0: po.ovarrf( self.outfile, "Lower limit on total beta", - "(beta_min)", - physics_variables.beta_min, + "(beta_vol_avg_min)", + physics_variables.beta_vol_avg_min, "IP", ) elif physics_variables.i_beta_component == 1: po.ovarrf( self.outfile, "Lower limit on thermal beta", - "(beta_min)", - physics_variables.beta_min, + "(beta_vol_avg_min)", + physics_variables.beta_vol_avg_min, "IP", ) else: po.ovarrf( self.outfile, "Lower limit on thermal + NB beta", - "(beta_min)", - physics_variables.beta_min, + "(beta_vol_avg_min)", + physics_variables.beta_vol_avg_min, "IP", ) po.ovarre( @@ -4365,15 +4390,15 @@ def outplas(self): po.ovarre( self.outfile, "Total poloidal beta", - "(beta_poloidal)", - physics_variables.beta_poloidal, + "(beta_poloidal_vol_avg)", + physics_variables.beta_poloidal_vol_avg, "OP ", ) po.ovarre( self.outfile, - "Total toroidal beta", - "(beta_toroidal)", - physics_variables.beta_toroidal, + "Volume averaged toroidal beta", + "(beta_toroidal_vol_avg)", + physics_variables.beta_toroidal_vol_avg, "OP ", ) po.ovarre( @@ -4400,23 +4425,23 @@ def outplas(self): po.ovarre( self.outfile, - "Thermal beta", - "(beta_thermal)", - physics_variables.beta_thermal, + "Volume averaged thermal beta", + "(beta_thermal_vol_avg)", + physics_variables.beta_thermal_vol_avg, "OP ", ) po.ovarre( self.outfile, "Thermal poloidal beta", - "(beta_thermal_poloidal)", - physics_variables.beta_thermal_poloidal, + "(beta_thermal_poloidal_vol_avg)", + physics_variables.beta_thermal_poloidal_vol_avg, "OP ", ) po.ovarre( self.outfile, "Thermal toroidal beta", - "(beta_thermal_toroidal)", - physics_variables.beta_thermal_toroidal, + "(beta_thermal_toroidal_vol_avg)", + physics_variables.beta_thermal_toroidal_vol_avg, "OP ", ) @@ -4586,6 +4611,13 @@ def outplas(self): physics_variables.temp_plasma_electron_density_weighted_kev, "OP ", ) + po.ovarrf( + self.outfile, + "Ratio of electron density weighted temp. to volume averaged temp.", + "(f_temp_plasma_electron_density_vol_avg)", + physics_variables.f_temp_plasma_electron_density_vol_avg, + "OP ", + ) po.ovarre( self.outfile, "Volume averaged electron number density (/m3)", @@ -4602,22 +4634,22 @@ def outplas(self): po.ovarre( self.outfile, "Line-averaged electron number density (/m3)", - "(nd_electron_line)", - physics_variables.nd_electron_line, + "(nd_plasma_electron_line)", + physics_variables.nd_plasma_electron_line, "OP ", ) po.ovarre( self.outfile, "Plasma pressure on axis (Pa)", - "(pres_plasma_on_axis)", - physics_variables.pres_plasma_on_axis, + "(pres_plasma_thermal_on_axis)", + physics_variables.pres_plasma_thermal_on_axis, "OP ", ) po.ovarre( self.outfile, "Volume averaged plasma pressure (Pa)", - "(pres_plasma_vol_avg)", - physics_variables.pres_plasma_vol_avg, + "(pres_plasma_thermal_vol_avg)", + physics_variables.pres_plasma_thermal_vol_avg, "OP ", ) # As array output is not currently supported, each element is output as a float instance @@ -4656,36 +4688,37 @@ def outplas(self): self.outfile, "Line-averaged electron density / Greenwald density", "(dnla_gw)", - physics_variables.nd_electron_line / physics_variables.dlimit[6], + physics_variables.nd_plasma_electron_line + / physics_variables.nd_plasma_electron_max_array[6], "OP ", ) po.ovarre( self.outfile, "Total Ion number density (/m3)", - "(nd_ions_total)", - physics_variables.nd_ions_total, + "(nd_plasma_ions_total_vol_avg)", + physics_variables.nd_plasma_ions_total_vol_avg, "OP ", ) po.ovarre( self.outfile, "Fuel ion number density (/m3)", - "(nd_fuel_ions)", - physics_variables.nd_fuel_ions, + "(nd_plasma_fuel_ions_vol_avg)", + physics_variables.nd_plasma_fuel_ions_vol_avg, "OP ", ) po.ovarre( self.outfile, "Total impurity number density with Z > 2 (no He) (/m3)", - "(nd_impurities)", - physics_variables.nd_impurities, + "(nd_plasma_impurities_vol_avg)", + physics_variables.nd_plasma_impurities_vol_avg, "OP ", ) po.ovarre( self.outfile, "Helium ion number density (thermalised ions only) (/m3)", - "(nd_alphas)", - physics_variables.nd_alphas, + "(nd_plasma_alphas_vol_avg)", + physics_variables.nd_plasma_alphas_vol_avg, "OP ", ) po.ovarre( @@ -4696,9 +4729,9 @@ def outplas(self): ) po.ovarre( self.outfile, - "Proton number density (/m3)", - "(nd_protons)", - physics_variables.nd_protons, + "Plasma volume averaged proton number density (/m3)", + "(nd_plasma_protons_vol_avg)", + physics_variables.nd_plasma_protons_vol_avg, "OP ", ) po.ovarre( @@ -4873,21 +4906,21 @@ def outplas(self): # must be assigned to their exisiting values# fgwped_out = ( physics_variables.nd_plasma_pedestal_electron - / physics_variables.dlimit[6] + / physics_variables.nd_plasma_electron_max_array[6] ) fgwsep_out = ( physics_variables.nd_plasma_separatrix_electron - / physics_variables.dlimit[6] + / physics_variables.nd_plasma_electron_max_array[6] ) if physics_variables.f_nd_plasma_pedestal_greenwald >= 0e0: physics_variables.f_nd_plasma_pedestal_greenwald = ( physics_variables.nd_plasma_pedestal_electron - / physics_variables.dlimit[6] + / physics_variables.nd_plasma_electron_max_array[6] ) if physics_variables.f_nd_plasma_separatrix_greenwald >= 0e0: physics_variables.f_nd_plasma_separatrix_greenwald = ( physics_variables.nd_plasma_separatrix_electron - / physics_variables.dlimit[6] + / physics_variables.nd_plasma_electron_max_array[6] ) po.ovarre( @@ -4981,72 +5014,72 @@ def outplas(self): po.ovarre( self.outfile, "Old ASDEX model", - "(dlimit(1))", - physics_variables.dlimit[0], + "(nd_plasma_electron_max_array(1))", + physics_variables.nd_plasma_electron_max_array[0], "OP ", ) po.ovarre( self.outfile, "Borrass ITER model I", - "(dlimit(2))", - physics_variables.dlimit[1], + "(nd_plasma_electron_max_array(2))", + physics_variables.nd_plasma_electron_max_array[1], "OP ", ) po.ovarre( self.outfile, "Borrass ITER model II", - "(dlimit(3))", - physics_variables.dlimit[2], + "(nd_plasma_electron_max_array(3))", + physics_variables.nd_plasma_electron_max_array[2], "OP ", ) po.ovarre( self.outfile, "JET edge radiation model", - "(dlimit(4))", - physics_variables.dlimit[3], + "(nd_plasma_electron_max_array(4))", + physics_variables.nd_plasma_electron_max_array[3], "OP ", ) po.ovarre( self.outfile, "JET simplified model", - "(dlimit(5))", - physics_variables.dlimit[4], + "(nd_plasma_electron_max_array(5))", + physics_variables.nd_plasma_electron_max_array[4], "OP ", ) po.ovarre( self.outfile, "Hugill-Murakami Mq model", - "(dlimit(6))", - physics_variables.dlimit[5], + "(nd_plasma_electron_max_array(6))", + physics_variables.nd_plasma_electron_max_array[5], "OP ", ) po.ovarre( self.outfile, "Greenwald model", - "(dlimit(7))", - physics_variables.dlimit[6], + "(nd_plasma_electron_max_array(7))", + physics_variables.nd_plasma_electron_max_array[6], "OP ", ) po.ovarre( self.outfile, "ASDEX New", - "(dlimit(8))", - physics_variables.dlimit[7], + "(nd_plasma_electron_max_array(8))", + physics_variables.nd_plasma_electron_max_array[7], "OP ", ) po.ovarre( self.outfile, "Density limit from scaling (/m3)", - "(dnelimt)", - physics_variables.dnelimt, + "(nd_plasma_electrons_max)", + physics_variables.nd_plasma_electrons_max, "OP ", ) if (numerics.ioptimz > 0) and (numerics.active_constraints[4]): po.ovarre( self.outfile, "Density limit (enforced) (/m3)", - "(boundu(9)*dnelimt)", - numerics.boundu[8] * physics_variables.dnelimt, + "(boundu(9)*nd_plasma_electrons_max)", + numerics.boundu[8] * physics_variables.nd_plasma_electrons_max, "OP ", ) @@ -5060,20 +5093,20 @@ def outplas(self): po.ovarrf( self.outfile, "Deuterium fuel fraction", - "(f_deuterium)", - physics_variables.f_deuterium, + "(f_plasma_fuel_deuterium)", + physics_variables.f_plasma_fuel_deuterium, ) po.ovarrf( self.outfile, "Tritium fuel fraction", - "(f_tritium)", - physics_variables.f_tritium, + "(f_plasma_fuel_tritium)", + physics_variables.f_plasma_fuel_tritium, ) po.ovarrf( self.outfile, "3-Helium fuel fraction", - "(f_helium3)", - physics_variables.f_helium3, + "(f_plasma_fuel_helium3)", + physics_variables.f_plasma_fuel_helium3, ) po.oblnkl(self.outfile) po.ocmmnt(self.outfile, "----------------------------") @@ -5866,14 +5899,16 @@ def outplas(self): ) logger.warning("rmajor outside Snipes 2000 fitted range") - if (physics_variables.nd_electron_line < 0.09e20) or ( - physics_variables.nd_electron_line > 3.16e20 + if (physics_variables.nd_plasma_electron_line < 0.09e20) or ( + physics_variables.nd_plasma_electron_line > 3.16e20 ): po.ocmmnt( self.outfile, - "(physics_variables.nd_electron_line outside Snipes 2000 fitted range)", + "(physics_variables.nd_plasma_electron_line outside Snipes 2000 fitted range)", + ) + logger.warning( + "nd_plasma_electron_line outside Snipes 2000 fitted range" ) - logger.warning("nd_electron_line outside Snipes 2000 fitted range") if (physics_variables.kappa < 1.0e0) or ( physics_variables.kappa > 2.04e0 @@ -6612,9 +6647,9 @@ def output_confinement_comparison(self, istell: int) -> None: physics_variables.p_alpha_total_mw, physics_variables.aspect, physics_variables.b_plasma_toroidal_on_axis, - physics_variables.nd_ions_total, + physics_variables.nd_plasma_ions_total_vol_avg, physics_variables.nd_plasma_electrons_vol_avg, - physics_variables.nd_electron_line, + physics_variables.nd_plasma_electron_line, physics_variables.eps, 1.0, i_confinement_time, @@ -6933,7 +6968,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: # Calculate electron and ion density profiles ne = plasma_profile.neprofile.profile_y * 1e-19 ni = ( - physics_variables.nd_ions_total + physics_variables.nd_plasma_ions_total_vol_avg / physics_variables.nd_plasma_electrons_vol_avg ) * ne @@ -6958,7 +6993,7 @@ def bootstrap_fraction_sauter(plasma_profile: float) -> float: amain = np.full_like(inverse_q, physics_variables.m_fuel_amu) # Create new array of average main ion charge - zmain = np.full_like(inverse_q, 1.0 + physics_variables.f_helium3) + zmain = np.full_like(inverse_q, 1.0 + physics_variables.f_plasma_fuel_helium3) # Prevent division by zero if ne[nr - 1] == 0.0: @@ -7542,9 +7577,9 @@ def fhz(hfact: float) -> float: physics_variables.p_alpha_total_mw, physics_variables.aspect, physics_variables.b_plasma_toroidal_on_axis, - physics_variables.nd_ions_total, + physics_variables.nd_plasma_ions_total_vol_avg, physics_variables.nd_plasma_electrons_vol_avg, - physics_variables.nd_electron_line, + physics_variables.nd_plasma_electron_line, physics_variables.eps, hfact, i_confinement_time, @@ -7598,9 +7633,9 @@ def calculate_confinement_time( p_alpha_total_mw: float, aspect: float, b_plasma_toroidal_on_axis: float, - nd_ions_total: float, + nd_plasma_ions_total_vol_avg: float, nd_plasma_electrons_vol_avg: float, - nd_electron_line: float, + nd_plasma_electron_line: float, eps: float, hfact: float, i_confinement_time: int, @@ -7627,9 +7662,9 @@ def calculate_confinement_time( :param p_alpha_total_mw: Alpha particle power (MW) :param aspect: Aspect ratio :param b_plasma_toroidal_on_axis: Toroidal field on axis (T) - :param nd_ions_total: Total ion density (/m3) + :param nd_plasma_ions_total_vol_avg: Total ion density (/m3) :param nd_plasma_electrons_vol_avg: Volume averaged electron density (/m3) - :param nd_electron_line: Line-averaged electron density (/m3) + :param nd_plasma_electron_line: Line-averaged electron density (/m3) :param eps: Inverse aspect ratio :param hfact: H factor on energy confinement scalings :param i_confinement_time: Switch for energy confinement scaling to use @@ -7689,8 +7724,8 @@ def calculate_confinement_time( # ======================================================================== # Line averaged electron density in scaled units - dnla20 = nd_electron_line * 1.0e-20 - dnla19 = nd_electron_line * 1.0e-19 + dnla20 = nd_plasma_electron_line * 1.0e-20 + dnla19 = nd_plasma_electron_line * 1.0e-19 # Volume averaged electron density in units of 10**20 m**-3 n20 = nd_plasma_electrons_vol_avg / 1.0e20 @@ -8304,7 +8339,7 @@ def calculate_confinement_time( t_electron_confinement = confinement.lang_high_density_confinement_time( plasma_current, b_plasma_toroidal_on_axis, - nd_electron_line, + nd_plasma_electron_line, p_plasma_loss_mw, rmajor, rminor, @@ -8445,7 +8480,7 @@ def calculate_confinement_time( pden_ion_transport_loss_mw = ( (3 / 2) * (constants.ELECTRON_CHARGE / 1e3) - * nd_ions_total + * nd_plasma_ions_total_vol_avg * temp_plasma_ion_density_weighted_kev / t_ion_energy_confinement ) @@ -8457,7 +8492,7 @@ def calculate_confinement_time( / t_electron_energy_confinement ) - ratio = (nd_ions_total / nd_plasma_electrons_vol_avg) * ( + ratio = (nd_plasma_ions_total_vol_avg / nd_plasma_electrons_vol_avg) * ( temp_plasma_ion_density_weighted_kev / temp_plasma_electron_density_weighted_kev ) @@ -8487,9 +8522,9 @@ def calculate_confinement_time( def calculate_plasma_masses( m_fuel_amu: float, m_ions_total_amu: float, - nd_ions_total: float, - nd_fuel_ions: float, - nd_alphas: float, + nd_plasma_ions_total_vol_avg: float, + nd_plasma_fuel_ions_vol_avg: float, + nd_plasma_alphas_vol_avg: float, vol_plasma: float, nd_plasma_electrons_vol_avg: float, ) -> tuple[float, float, float, float, float]: @@ -8500,12 +8535,12 @@ def calculate_plasma_masses( :type m_fuel_amu: float :param m_ions_total_amu: Average mass of all ions (amu). :type m_ions_total_amu: float - :param nd_ions_total: Total ion density (/m3). - :type nd_ions_total: float - :param nd_fuel_ions: Fuel ion density (/m3). - :type nd_fuel_ions: float - :param nd_alphas: Alpha ash density (/m3). - :type nd_alphas: float + :param nd_plasma_ions_total_vol_avg: Total ion density (/m3). + :type nd_plasma_ions_total_vol_avg: float + :param nd_plasma_fuel_ions_vol_avg: Fuel ion density (/m3). + :type nd_plasma_fuel_ions_vol_avg: float + :param nd_plasma_alphas_vol_avg: Alpha ash density (/m3). + :type nd_plasma_alphas_vol_avg: float :param vol_plasma: Plasma volume (m3). :type vol_plasma: float :param nd_plasma_electrons_vol_avg: Volume averaged electron density (/m3). @@ -8517,14 +8552,14 @@ def calculate_plasma_masses( # Calculate mass of fuel ions m_plasma_fuel_ions = (m_fuel_amu * constants.ATOMIC_MASS_UNIT) * ( - nd_fuel_ions * vol_plasma + nd_plasma_fuel_ions_vol_avg * vol_plasma ) m_plasma_ions_total = (m_ions_total_amu * constants.ATOMIC_MASS_UNIT) * ( - nd_ions_total * vol_plasma + nd_plasma_ions_total_vol_avg * vol_plasma ) - m_plasma_alpha = (nd_alphas * vol_plasma) * constants.ALPHA_MASS + m_plasma_alpha = (nd_plasma_alphas_vol_avg * vol_plasma) * constants.ALPHA_MASS m_plasma_electron = constants.ELECTRON_MASS * ( nd_plasma_electrons_vol_avg * vol_plasma @@ -8570,7 +8605,7 @@ def res_diff_time(rmajor, res_plasma, kappa95): def l_h_threshold_power( - nd_electron_line: float, + nd_plasma_electron_line: float, b_plasma_toroidal_on_axis: float, rmajor: float, rminor: float, @@ -8583,8 +8618,8 @@ def l_h_threshold_power( """ L-mode to H-mode power threshold calculation. - :param nd_electron_line: Line-averaged electron density (/m3) - :type nd_electron_line: float + :param nd_plasma_electron_line: Line-averaged electron density (/m3) + :type nd_plasma_electron_line: float :param b_plasma_toroidal_on_axis: Toroidal field on axis (T) :type b_plasma_toroidal_on_axis: float :param rmajor: Plasma major radius (m) @@ -8606,7 +8641,7 @@ def l_h_threshold_power( :rtype: list[float] """ - dnla20 = 1e-20 * nd_electron_line + dnla20 = 1e-20 * nd_plasma_electron_line # ======================================================================== diff --git a/process/physics_functions.py b/process/physics_functions.py index 05c6ce4db5..f0346fc5a9 100644 --- a/process/physics_functions.py +++ b/process/physics_functions.py @@ -225,8 +225,8 @@ def fast_alpha_beta( b_plasma_poloidal_average: float, b_plasma_toroidal_on_axis: float, nd_plasma_electrons_vol_avg: float, - nd_fuel_ions: float, - nd_ions_total: float, + nd_plasma_fuel_ions_vol_avg: float, + nd_plasma_ions_total_vol_avg: float, temp_plasma_electron_density_weighted_kev: float, temp_plasma_ion_density_weighted_kev: float, pden_alpha_total_mw: float, @@ -242,8 +242,8 @@ def fast_alpha_beta( b_plasma_poloidal_average (float): Poloidal field (T). b_plasma_toroidal_on_axis (float): Toroidal field on axis (T). nd_plasma_electrons_vol_avg (float): Electron density (m^-3). - nd_fuel_ions (float): Fuel ion density (m^-3). - nd_ions_total (float): Total ion density (m^-3). + nd_plasma_fuel_ions_vol_avg (float): Fuel ion density (m^-3). + nd_plasma_ions_total_vol_avg (float): Total ion density (m^-3). temp_plasma_electron_density_weighted_kev (float): Density-weighted electron temperature (keV). temp_plasma_ion_density_weighted_kev (float): Density-weighted ion temperature (keV). pden_alpha_total_mw (float): Alpha power per unit volume, from beams and plasma (MW/m^3). @@ -268,14 +268,14 @@ def fast_alpha_beta( """ # Determine average fast alpha density - if physics_variables.f_deuterium < 1.0: + if physics_variables.f_plasma_fuel_deuterium < 1.0: beta_thermal = ( 2.0 * constants.RMU0 * constants.KILOELECTRON_VOLT * ( nd_plasma_electrons_vol_avg * temp_plasma_electron_density_weighted_kev - + nd_ions_total * temp_plasma_ion_density_weighted_kev + + nd_plasma_ions_total_vol_avg * temp_plasma_ion_density_weighted_kev ) / (b_plasma_toroidal_on_axis**2 + b_plasma_poloidal_average**2) ) @@ -286,7 +286,7 @@ def fast_alpha_beta( fact = min( 0.3, 0.29 - * (nd_fuel_ions / nd_plasma_electrons_vol_avg) ** 2 + * (nd_plasma_fuel_ions_vol_avg / nd_plasma_electrons_vol_avg) ** 2 * ( ( temp_plasma_electron_density_weighted_kev @@ -302,7 +302,7 @@ def fast_alpha_beta( fact = min( 0.30, 0.26 - * (nd_fuel_ions / nd_plasma_electrons_vol_avg) ** 2 + * (nd_plasma_fuel_ions_vol_avg / nd_plasma_electrons_vol_avg) ** 2 * np.sqrt( max( 0.0, diff --git a/process/plasma_profiles.py b/process/plasma_profiles.py index 2d154fa4eb..2953afd120 100644 --- a/process/plasma_profiles.py +++ b/process/plasma_profiles.py @@ -27,7 +27,7 @@ class PlasmaProfile: parameterise_plasma(): Initializes the density and temperature profile averages and peak values. parabolic_paramterisation(): Parameterizes plasma profiles in the case where i_plasma_pedestal=0. pedestal_parameterisation(): Instance temperature and density profiles then integrate them, setting physics variables temp_plasma_electron_density_weighted_kev and temp_plasma_ion_density_weighted_kev. - calculate_profile_factors(): Calculate and set the central pressure (pres_plasma_on_axis) using the ideal gas law and the pressure profile index (alphap). + calculate_profile_factors(): Calculate and set the central pressure (pres_plasma_thermal_on_axis) using the ideal gas law and the pressure profile index (alphap). calculate_parabolic_profile_factors(): The gradient information for i_plasma_pedestal = 0. """ @@ -142,7 +142,7 @@ def parabolic_paramterisation(self) -> None: # Profile factor; ratio of density-weighted to volume-averaged # temperature - physics_variables.pcoef = ( + physics_variables.f_temp_plasma_electron_density_vol_avg = ( (1.0e0 + physics_variables.alphan) * (1.0e0 + physics_variables.alphat) / (1.0e0 + physics_variables.alphan + physics_variables.alphat) @@ -151,7 +151,7 @@ def parabolic_paramterisation(self) -> None: # Line averaged electron density (IPDG89) # Taken by integrating the parabolic profile over rho in the bounds of 0 and 1 and dividng by the width of the integration bounds - physics_variables.nd_electron_line = ( + physics_variables.nd_plasma_electron_line = ( physics_variables.nd_plasma_electrons_vol_avg * (1.0 + physics_variables.alphan) * (sp.special.gamma(0.5) / 2.0) @@ -162,10 +162,12 @@ def parabolic_paramterisation(self) -> None: # Density-weighted temperatures physics_variables.temp_plasma_electron_density_weighted_kev = ( - physics_variables.temp_plasma_electron_vol_avg_kev * physics_variables.pcoef + physics_variables.temp_plasma_electron_vol_avg_kev + * physics_variables.f_temp_plasma_electron_density_vol_avg ) physics_variables.temp_plasma_ion_density_weighted_kev = ( - physics_variables.temp_plasma_ion_vol_avg_kev * physics_variables.pcoef + physics_variables.temp_plasma_ion_vol_avg_kev + * physics_variables.f_temp_plasma_electron_density_vol_avg ) # Central values for temperature (keV) and density (m**-3) @@ -183,8 +185,9 @@ def parabolic_paramterisation(self) -> None: physics_variables.nd_plasma_electrons_vol_avg * (1.0 + physics_variables.alphan) ) - physics_variables.nd_plasma_ions_on_axis = physics_variables.nd_ions_total * ( - 1.0 + physics_variables.alphan + physics_variables.nd_plasma_ions_on_axis = ( + physics_variables.nd_plasma_ions_total_vol_avg + * (1.0 + physics_variables.alphan) ) def pedestal_parameterisation(self) -> None: @@ -234,7 +237,7 @@ def pedestal_parameterisation(self) -> None: # Profile factor; ratio of density-weighted to volume-averaged # temperature - physics_variables.pcoef = ( + physics_variables.f_temp_plasma_electron_density_vol_avg = ( physics_variables.temp_plasma_electron_density_weighted_kev / physics_variables.temp_plasma_electron_vol_avg_kev ) @@ -242,7 +245,7 @@ def pedestal_parameterisation(self) -> None: # Line-averaged electron density # = integral(n(rho).drho) - physics_variables.nd_electron_line = self.neprofile.profile_integ + physics_variables.nd_plasma_electron_line = self.neprofile.profile_integ # Scrape-off density / volume averaged density # (Input value is used if i_plasma_pedestal = 0) @@ -255,10 +258,10 @@ def pedestal_parameterisation(self) -> None: def calculate_profile_factors(self) -> None: """ - Calculate and set the central pressure (pres_plasma_on_axis) using the ideal gas law and the pressure profile index (alphap). + Calculate and set the central pressure (pres_plasma_thermal_on_axis) using the ideal gas law and the pressure profile index (alphap). - This method calculates the central pressure (pres_plasma_on_axis) using the ideal gas law and the pressure profile index (alphap). - It sets the value of the physics variable `pres_plasma_on_axis`. + This method calculates the central pressure (pres_plasma_thermal_on_axis) using the ideal gas law and the pressure profile index (alphap). + It sets the value of the physics variable `pres_plasma_thermal_on_axis`. Args: None @@ -269,7 +272,7 @@ def calculate_profile_factors(self) -> None: # Central pressure (Pa), from ideal gas law : p = nkT - physics_variables.pres_plasma_on_axis = ( + physics_variables.pres_plasma_thermal_on_axis = ( ( physics_variables.nd_plasma_electron_on_axis * physics_variables.temp_plasma_electron_on_axis_kev @@ -287,7 +290,7 @@ def calculate_profile_factors(self) -> None: # Total ion pressure profile (Pa) physics_variables.pres_plasma_ion_total_profile = ( - physics_variables.nd_ions_total + physics_variables.nd_plasma_ions_total_vol_avg * (self.neprofile.profile_y / physics_variables.nd_plasma_electrons_vol_avg) ) * ( self.teprofile.profile_y @@ -303,7 +306,7 @@ def calculate_profile_factors(self) -> None: # Fuel ion pressure profile (Pa) physics_variables.pres_plasma_fuel_profile = ( - physics_variables.nd_fuel_ions + physics_variables.nd_plasma_fuel_ions_vol_avg * (self.neprofile.profile_y / physics_variables.nd_plasma_electrons_vol_avg) ) * ( self.teprofile.profile_y @@ -312,7 +315,7 @@ def calculate_profile_factors(self) -> None: ) # Pressure profile index (N.B. no pedestal effects included here) - # N.B. pres_plasma_on_axis is NOT equal to
* (1 + alphap), but p(rho) = n(rho)*T(rho) + # N.B. pres_plasma_thermal_on_axis is NOT equal to
* (1 + alphap), but p(rho) = n(rho)*T(rho) # and
=