From a0fae271a3d0fa96dd8652006981e80c84cf7a40 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 6 Jun 2024 13:23:34 +0100 Subject: [PATCH 1/4] chore: Remove startup_variables module The startup_variables module has been deleted from the repository. This module contained global variables related to the plasma start-up model. The deletion was necessary as it is no longer needed in the codebase. --- source/fortran/startup_variables.f90 | 54 ---------------------------- 1 file changed, 54 deletions(-) delete mode 100644 source/fortran/startup_variables.f90 diff --git a/source/fortran/startup_variables.f90 b/source/fortran/startup_variables.f90 deleted file mode 100644 index 4bb37a9dba..0000000000 --- a/source/fortran/startup_variables.f90 +++ /dev/null @@ -1,54 +0,0 @@ -module startup_variables - !! author: J. Morris (UKAEA) - !! - !! Module containing global variables relating to the plasma start-up model - !! - !!### References - !! - !! - Work File Notes in F/MPE/MOD/CAG/PROCESS/PULSE - !! - AEA FUS 251: A User's Guide to the PROCESS Systems Code - -#ifndef dp - use, intrinsic :: iso_fortran_env, only: dp=>real64 -#endif - - implicit none - - public - - real(dp) :: ftaue - !! factor in energy confinement time formula - - real(dp) :: gtaue - !! offset term in energy confinement time scaling - - real(dp) :: nign - !! electron density at ignition (start-up) (/m3) - - real(dp) :: ptaue - !! exponent for density term in energy confinement time formula - - real(dp) :: qtaue - !! exponent for temperature term in energy confinement time formula - - real(dp) :: rtaue - !! exponent for power term in energy confinement time formula - - real(dp) :: tign - !! electron temperature at ignition (start-up) (keV) - - contains - - subroutine init_startup_variables - !! Initialise module variables - implicit none - - ftaue = 0.0D0 - gtaue = 0.0D0 - nign = 0.0D0 - ptaue = 0.0D0 - qtaue = 0.0D0 - rtaue = 0.0D0 - tign = 0.0D0 - end subroutine init_startup_variables -end module startup_variables From 80e4b1a144117c09ed07a65737b14c02b3f5bab2 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 6 Jun 2024 13:32:03 +0100 Subject: [PATCH 2/4] Remove startup variables from physics.py --- process/physics.py | 250 +-------------------------------------------- 1 file changed, 2 insertions(+), 248 deletions(-) diff --git a/process/physics.py b/process/physics.py index b60174fd27..49814696b5 100644 --- a/process/physics.py +++ b/process/physics.py @@ -25,7 +25,6 @@ stellarator_variables, process_output as po, profiles_module, - startup_variables, ) @@ -4971,28 +4970,14 @@ def pcond( # Calculate Neo-Alcator confinement time (used in several scalings) taueena = 0.07e0 * n20 * rminor * rmajor * rmajor * qstar - # For reference (see startup.f90): - # startup_variables.gtaue = offset term in tauee scaling - # startup_variables.ptaue = exponent for density term in tauee scaling - # startup_variables.qtaue = exponent for temperature term in tauee scaling - # startup_variables.rtaue = exponent for power term in tauee scaling - # Electron energy confinement times if isc == 1: # Neo-Alcator scaling (ohmic) # tauee = taueena tauee = hfact * taueena - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 1.0e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = 0.0e0 elif isc == 2: # Mirnov scaling (H-mode) tauee = hfact * 0.2e0 * rminor * np.sqrt(kappa95) * pcur - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.0e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = 0.0e0 elif isc == 3: # Merezhkin-Muhkovatov scaling (L-mode) tauee = ( @@ -5006,10 +4991,6 @@ def pcond( * np.sqrt(afuel) / np.sqrt(ten / 10.0e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 1.0e0 - startup_variables.qtaue = -0.5e0 - startup_variables.rtaue = 0.0e0 elif isc == 4: # Shimomura scaling (H-mode) tauee = ( @@ -5021,10 +5002,6 @@ def pcond( * np.sqrt(kappa95) * np.sqrt(afuel) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.0e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = 0.0e0 elif isc == 5: # Kaye-Goldston scaling (L-mode) tauee = ( @@ -5037,10 +5014,7 @@ def pcond( * np.sqrt(afuel / 1.5e0) / (bt**0.09e0 * rminor**0.49e0 * powerht**0.58e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.26e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.58e0 + if iinvqd != 0: tauee = 1.0e0 / np.sqrt(1.0e0 / taueena**2 + 1.0e0 / tauee**2) @@ -5057,10 +5031,6 @@ def pcond( * np.sqrt(afuel) / np.sqrt(powerht) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.1e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.5e0 elif isc == 7: # ITER Offset linear scaling - ITER 89-O (L-mode) term1 = ( @@ -5083,10 +5053,6 @@ def pcond( / powerht ) tauee = hfact * (term1 + term2) - startup_variables.gtaue = hfact * term1 - startup_variables.ptaue = 0.6e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -1.0e0 elif isc == 8: # Rebut-Lallia offset linear scaling (L-mode) rll = (rminor**2 * rmajor * kappa95) ** 0.333e0 @@ -5105,15 +5071,6 @@ def pcond( / powerht ) ) - startup_variables.gtaue = ( - hfact - * 1.65e0 - * np.sqrt(afuel / 2.0e0) - * (1.2e-2 * pcur * rll**1.5e0 / np.sqrt(zeff)) - ) - startup_variables.ptaue = 0.75e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -1.0e0 elif isc == 9: # Goldston scaling (L-mode) tauee = ( @@ -5126,10 +5083,7 @@ def pcond( * np.sqrt(afuel / 1.5e0) / np.sqrt(powerht) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.0e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.5e0 + if iinvqd != 0: tauee = 1.0e0 / np.sqrt(1.0e0 / taueena**2 + 1.0e0 / tauee**2) @@ -5152,10 +5106,6 @@ def pcond( ) ** 0.08e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 1.0e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.4e0 elif isc == 11: # JAERI scaling gjaeri = ( @@ -5182,12 +5132,6 @@ def pcond( * kappa95**0.2e0 / powerht ) - startup_variables.gtaue = ( - hfact * 0.085e0 * kappa95 * rminor**2 * np.sqrt(afuel) - ) - startup_variables.ptaue = 0.6e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -1.0e0 elif isc == 12: # Kaye-Big scaling tauee = ( @@ -5202,10 +5146,6 @@ def pcond( * afuel**0.5e0 / powerht**0.5e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.1e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.5e0 elif isc == 13: # ITER H-mode scaling - ITER H90-P tauee = ( @@ -5220,10 +5160,6 @@ def pcond( * np.sqrt(afuel) / np.sqrt(powerht) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.09e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.5e0 elif isc == 14: # Minimum of ITER 89-P (isc=6) and ITER 89-O (isc=7) tauit1 = ( @@ -5260,17 +5196,6 @@ def pcond( tauit2 = hfact * (term1 + term2) tauee = min(tauit1, tauit2) - if tauit1 < tauit2: - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.1e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.5e0 - else: - startup_variables.gtaue = hfact * term1 - startup_variables.ptaue = 0.6e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -1.0e0 - elif isc == 15: # Riedel scaling (L-mode) tauee = ( hfact @@ -5283,10 +5208,6 @@ def pcond( * bt**0.152e0 / powerht**0.537e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.078e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.537e0 elif isc == 16: # Christiansen et al scaling (L-mode) tauee = ( @@ -5300,10 +5221,6 @@ def pcond( * bt**0.29e0 / (powerht**0.79e0 * afuel**0.02e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.41e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.79e0 elif isc == 17: # Lackner-Gottardi scaling (L-mode) qhat = (1.0e0 + kappa95**2) * rminor**2 * bt / (0.4e0 * pcur * rmajor) @@ -5319,10 +5236,6 @@ def pcond( * qhat**0.4e0 / powerht**0.6e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.6e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.6e0 elif isc == 18: # Neo-Kaye scaling (L-mode) tauee = ( @@ -5337,10 +5250,6 @@ def pcond( * np.sqrt(afuel) / powerht**0.59e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.14e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.59e0 elif isc == 19: # Riedel scaling (H-mode) tauee = ( @@ -5355,10 +5264,6 @@ def pcond( * dnla20**0.105e0 / powerht**0.486e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.105e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.486e0 elif isc == 20: # Amended version of ITER H90-P law # Nuclear Fusion 32 (1992) 318 @@ -5371,10 +5276,6 @@ def pcond( * rmajor**1.60e0 / (powerht**0.47e0 * kappa**0.19e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.0e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.47e0 elif isc == 21: # Large Helical Device scaling (stellarators) # S.Sudo, Y.Takeiri, H.Zushi et al., Nuclear Fusion 30 (1990) 11 @@ -5387,10 +5288,6 @@ def pcond( * bt**0.84e0 * powerht ** (-0.58e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.69e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = 0.58e0 elif isc == 22: # Gyro-reduced Bohm scaling # R.J.Goldston, H.Biglari, G.W.Hammett et al., Bull.Am.Phys.Society, @@ -5404,10 +5301,6 @@ def pcond( * rminor**2.4e0 * rmajor**0.6e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.6e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.6e0 elif isc == 23: # Lackner-Gottardi stellarator scaling # K.Lackner and N.A.O.Gottardi, Nuclear Fusion, 30, p.767 (1990) @@ -5422,10 +5315,6 @@ def pcond( * powerht ** (-0.6e0) * iotabar**0.4e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.6e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.6e0 elif ( isc == 24 @@ -5445,10 +5334,6 @@ def pcond( * aspect**0.11e0 * kappa**0.66e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.17e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.67e0 # Next two are ITER-97 H-mode scalings # J. G. Cordey et al., EPS Berchtesgaden, 1997 @@ -5466,10 +5351,6 @@ def pcond( * kappa**0.63e0 * afuel**0.42e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.35e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.67e0 elif isc == 27: # ELMy: ITERH-97P(y) tauee = ( @@ -5484,10 +5365,6 @@ def pcond( * kappa**0.92e0 * afuel**0.2e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.4e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.66e0 elif isc == 28: # ITER-96P (= ITER-97L) L-mode scaling # S.M.Kaye and the ITER Confinement Database Working Group, @@ -5505,10 +5382,6 @@ def pcond( * afuel**0.20e0 * powerht ** (-0.73e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.4e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.73e0 elif isc == 29: # Valovic modified ELMy-H mode scaling tauee = ( @@ -5523,10 +5396,6 @@ def pcond( * kappa**0.56e0 * powerht ** (-0.68e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.45e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.68e0 elif isc == 30: # Kaye PPPL Workshop April 1998 L-mode scaling tauee = ( @@ -5541,10 +5410,6 @@ def pcond( * afuel**0.25e0 * powerht ** (-0.73e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.47e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.73e0 elif isc == 31: # ITERH-PB98P(y), ELMy H-mode scaling tauee = ( @@ -5559,10 +5424,6 @@ def pcond( * aspect ** (-0.66e0) * afuel**0.2e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.4e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.66e0 elif isc == 32: # IPB98(y), ELMy H-mode scaling # Data selection : full ITERH.DB3 @@ -5579,10 +5440,6 @@ def pcond( * aspect ** (-0.23e0) * afuel**0.2e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.41e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.63e0 elif isc == 33: # IPB98(y,1), ELMy H-mode scaling # Data selection : full ITERH.DB3 @@ -5599,10 +5456,6 @@ def pcond( * aspect ** (-0.57e0) * afuel**0.13e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.44e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.65e0 elif isc == 34: # IPB98(y,2), ELMy H-mode scaling # Data selection : ITERH.DB3, NBI only @@ -5619,10 +5472,6 @@ def pcond( * aspect ** (-0.58e0) * afuel**0.19e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.41e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.69e0 elif isc == 35: # IPB98(y,3), ELMy H-mode scaling # Data selection : ITERH.DB3, NBI only, no C-Mod @@ -5639,10 +5488,6 @@ def pcond( * aspect ** (-0.64e0) * afuel**0.20e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.4e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.69e0 elif isc == 36: # IPB98(y,4), ELMy H-mode scaling # Data selection : ITERH.DB3, NBI only, ITER like devices @@ -5659,10 +5504,6 @@ def pcond( * aspect ** (-0.69e0) * afuel**0.17e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.39e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.70e0 elif isc == 37: # ISS95 stellarator scaling # U. Stroth et al., Nuclear Fusion, 36, p.1063 (1996) @@ -5678,10 +5519,6 @@ def pcond( * powerht ** (-0.59e0) * iotabar**0.4e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.51e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.59e0 elif isc == 38: # ISS04 stellarator scaling # H. Yamada et al., Nuclear Fusion, 45, p.1684 (2005) @@ -5697,10 +5534,6 @@ def pcond( * powerht ** (-0.61e0) * iotabar**0.41e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.54e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.61e0 elif isc == 39: # DS03 beta-independent H-mode scaling # T. C. Luce, C. C. Petty and J. G. Cordey, @@ -5717,10 +5550,6 @@ def pcond( * aspect ** (-0.3e0) * afuel**0.14e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.49e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.55e0 elif isc == 40: # "Non-power law" (NPL) Murari energy confinement scaling # Based on the ITPA database of H-mode discharges @@ -5742,11 +5571,6 @@ def pcond( * h ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.448e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.735e0 - elif isc == 41: # Beta independent dimensionless confinement scaling # C.C. Petty 2008 Phys. Plasmas 15, 080501, equation 36 # Note that there is no dependence on the average fuel mass 'afuel' @@ -5762,11 +5586,6 @@ def pcond( * aspect ** (-0.84e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.32e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.47e0 - elif isc == 42: # High density relevant confinement scaling # P.T. Lang et al. 2012, IAEA conference proceeding EX/P4-01 # q should be q95: incorrect if icurr = 2 (ST current scaling) @@ -5790,11 +5609,6 @@ def pcond( * nratio ** (-0.22e0 * np.log(nratio)) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.032236e0 - 0.22e0 * np.log(nratio) - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.74e0 - elif isc == 43: # Hubbard et al. 2017 I-mode confinement time scaling - nominal tauee = ( hfact @@ -5804,10 +5618,6 @@ def pcond( * dnla20**0.02e0 * powerht ** (-0.29e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.02e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.29e0 elif isc == 44: # Hubbard et al. 2017 I-mode confinement time scaling - lower tauee = ( @@ -5818,10 +5628,6 @@ def pcond( * dnla20 ** (-0.03e0) * powerht ** (-0.33e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = -0.03e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.33e0 elif isc == 45: # Hubbard et al. 2017 I-mode confinement time scaling - upper tauee = ( @@ -5832,10 +5638,6 @@ def pcond( * dnla20**0.07 * powerht ** (-0.25e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.07e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.25e0 elif isc == 46: # NSTX, ELMy H-mode scaling # NSTX scaling with IPB98(y,2) for other variables @@ -5853,10 +5655,6 @@ def pcond( * aspect ** (-0.58e0) * afuel**0.19e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.44e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.73e0 elif isc == 47: # NSTX-Petty08 Hybrid # Linear interpolation between NSTX and Petty08 in eps @@ -5875,11 +5673,6 @@ def pcond( * aspect ** (-0.84e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.32e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.47e0 - elif (1.0e0 / aspect) >= 0.6e0: # NSTX, i.e.case (46) tauee = ( @@ -5895,11 +5688,6 @@ def pcond( * afuel**0.19e0 ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.44e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.73e0 - else: taupetty = ( 0.052e0 @@ -5928,17 +5716,6 @@ def pcond( + ((0.6e0 - (1.0e0 / aspect)) / (0.6e0 - 0.4e0)) * taupetty ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = ( - ((1.0e0 / aspect) - 0.4e0) / (0.6e0 - 0.4e0) - ) * 0.32e0 + ((0.6e0 - (1.0e0 / aspect)) / (0.6e0 - 0.4e0)) * 0.44e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = ( - ((1.0e0 / aspect) - 0.4e0) / (0.6e0 - 0.4e0) - ) * (-0.47e0) + ((0.6e0 - (1.0e0 / aspect)) / (0.6e0 - 0.4e0)) * ( - -0.73e0 - ) - elif isc == 48: # NSTX gyro-Bohm (Buxton) # P F Buxton et al. 2019 Plasma Phys. Control. Fusion 61 035006 tauee = ( @@ -5951,19 +5728,9 @@ def pcond( * dnla20 ** (-0.05e0) ) - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = -0.05e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = -0.38e0 - elif isc == 49: # tauee is an input tauee = hfact * physics_variables.tauee_in - startup_variables.gtaue = 0.0e0 - startup_variables.ptaue = 0.0e0 - startup_variables.qtaue = 0.0e0 - startup_variables.rtaue = 0.0e0 - elif isc == 50: # ITPA20 Issue #3164 # The updated ITPA global H-mode confinement database: description and analysis # G. Verdoolaege et al 2021 Nucl. Fusion 61 076006 DOI 10.1088/1741-4326/abdb91 @@ -5997,11 +5764,6 @@ def pcond( * physics_variables.aion**0.2 ) - startup_variables.gtaue = 0.0 - startup_variables.ptaue = 0.0 - startup_variables.qtaue = 0.0 - startup_variables.rtaue = 0.0 - else: error_handling.idiags[0] = isc error_handling.report_error(81) @@ -6024,12 +5786,4 @@ def pcond( taueff = (ratio + 1.0e0) / (ratio / tauei + 1.0e0 / tauee) - # This is used only in subroutine startup, which is currently (r400) - # not used. - startup_variables.ftaue = (tauee - startup_variables.gtaue) / ( - n20**startup_variables.ptaue - * (te / 10.0e0) ** startup_variables.qtaue - * powerht**startup_variables.rtaue - ) - return kappaa, ptrepv, ptripv, tauee, tauei, taueff, powerht From cc161ff0942630b2fb69b3e208401aae61db2b27 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 6 Jun 2024 13:43:35 +0100 Subject: [PATCH 3/4] Remove startup_variables module --- CMakeLists.txt | 1 - process/caller.py | 3 --- source/fortran/init_module.f90 | 2 -- tests/unit/test_physics.py | 17 ----------------- 4 files changed, 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f61d5f6a4d..db15c7829e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,7 +124,6 @@ LIST(APPEND PROCESS_SRCS stellarator.f90 stellarator_configuration.f90 stellarator_fwbs.f90 - startup_variables.f90 ) PREPROCESS() diff --git a/process/caller.py b/process/caller.py index d4ac6287b8..cb8469ca41 100644 --- a/process/caller.py +++ b/process/caller.py @@ -64,9 +64,6 @@ def call_models(self, xc): self.models.physics.physics() - # startup model (not used) - # call startup(ft.constants.nout,0) ! commented-out for speed reasons - # Toroidal field coil model self.models.tfcoil.run() diff --git a/source/fortran/init_module.f90 b/source/fortran/init_module.f90 index ac6072b56d..d9a9170f4f 100644 --- a/source/fortran/init_module.f90 +++ b/source/fortran/init_module.f90 @@ -46,7 +46,6 @@ subroutine init_all_module_vars use build_variables, only: init_build_variables use constraint_variables, only: init_constraint_variables use pulse_variables, only: init_pulse_variables - use startup_variables, only: init_startup_variables use rebco_variables, only: init_rebco_variables use reinke_variables, only: init_reinke_variables use define_iteration_variables, only: init_define_iteration_variables @@ -89,7 +88,6 @@ subroutine init_all_module_vars call init_build_variables call init_constraint_variables call init_pulse_variables - call init_startup_variables call init_rebco_variables call init_reinke_variables call init_define_iteration_variables diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index bf27e99fec..3fd19f3251 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -7,7 +7,6 @@ physics_module, current_drive_variables, impurity_radiation_module, - startup_variables, ) import numpy import pytest @@ -2687,16 +2686,6 @@ def test_pcond(pcondparam, monkeypatch, physics): monkeypatch.setattr(physics_variables, "falpha", pcondparam.falpha) - monkeypatch.setattr(startup_variables, "ptaue", pcondparam.ptaue) - - monkeypatch.setattr(startup_variables, "gtaue", pcondparam.gtaue) - - monkeypatch.setattr(startup_variables, "ftaue", pcondparam.ftaue) - - monkeypatch.setattr(startup_variables, "rtaue", pcondparam.rtaue) - - monkeypatch.setattr(startup_variables, "qtaue", pcondparam.qtaue) - kappaa, ptrepv, ptripv, tauee, tauei, taueff, powerht = physics.pcond( iinvqd=pcondparam.iinvqd, isc=pcondparam.isc, @@ -2730,12 +2719,6 @@ def test_pcond(pcondparam, monkeypatch, physics): assert physics_variables.kappaa_ipb == pytest.approx(pcondparam.expected_kappaa_ipb) - assert startup_variables.ptaue == pytest.approx(pcondparam.expected_ptaue) - - assert startup_variables.ftaue == pytest.approx(pcondparam.expected_ftaue) - - assert startup_variables.rtaue == pytest.approx(pcondparam.expected_rtaue) - assert kappaa == pytest.approx(pcondparam.expected_kappaa) assert powerht == pytest.approx(pcondparam.expected_powerht) From 2b5236aa2e9262433932f3ca4c0d9015d11b34df Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 6 Jun 2024 13:57:58 +0100 Subject: [PATCH 4/4] Remove variables from tests --- tests/integration/ref_dicts.json | 23 ----- tests/unit/test_physics.py | 144 ------------------------------- 2 files changed, 167 deletions(-) diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 5b7d452538..f03475a90f 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -2035,7 +2035,6 @@ "fstrcond": 1.0, "ftar": 1.0, "ftaucq": 1.0, - "ftaue": 0.0, "ftaulimit": 1.0, "ftbr": 1.0, "ftburn": 1.0, @@ -2195,7 +2194,6 @@ "green_func_emp_first": ".true.", "ground_clrnc": 5.0, "gsmass": 0.0, - "gtaue": 0.0, "gtscale": 0.0, "h": null, "h_cp_top": 0.0, @@ -3401,7 +3399,6 @@ "ngrp": 3.0, "ngrpmx": 10.0, "ni0": 0.0, - "nign": 0.0, "nimp": 14.0, "nin": 10.0, "nineqns": 0.0, @@ -3637,7 +3634,6 @@ "psyncpv": 0.0, "ptargf": 2.0, "ptarmw": 0.0, - "ptaue": 0.0, "ptempalw": 473.15, "ptfnuc": 0.0, "ptfnucmax": 0.001, @@ -3715,7 +3711,6 @@ "qss": 0.0, "qstar": 0.0, "qtargettotal": 5000000.0, - "qtaue": 0.0, "quench_model": "'exponential'", "r1": 0.0, "r2": 0.0, @@ -4280,7 +4275,6 @@ "rsrd": 0.0, "rtanbeam": 0.0, "rtanmax": 0.0, - "rtaue": 0.0, "run_tests": 0.0, "runtitle": "\"Run Title (change this line using input variable 'runtitle')\"", "rxcl": 4.0, @@ -7583,7 +7577,6 @@ "thwcndut": 0.008, "ti": 12.9, "ti0": 0.0, - "tign": 0.0, "tim": [ 0.0, 0.0, @@ -9628,7 +9621,6 @@ "fstrcond": "f-value for maxiumum TF coil conduit Tresca yield criterion\n (`constraint equation 32`, `iteration variable 49`)", "ftar": "fraction of power to the lower divertor in double null configuration\n (`i_single_null = 0` only) (default assumes SN)", "ftaucq": "f-value for calculated minimum TF quench time\n (`constraint equation 65`, `iteration variable 113`)", - "ftaue": "factor in energy confinement time formula", "ftaulimit": "f-value for lower limit on taup/taueff the ratio of alpha particle to energy\n confinement times (`constraint equation 62`, `iteration variable 110`)", "ftbr": "f-value for minimum tritium breeding ratio (`constraint equation 52`, `iteration variable 89`)", "ftburn": "f-value for minimum burn time (`constraint equation 13`, `iteration variable 21`)", @@ -9720,7 +9712,6 @@ "green_func_emp_first": "", "ground_clrnc": "clearance beneath TF coil (m)", "gsmass": "reactor core gravity support mass (kg)", - "gtaue": "offset term in energy confinement time scaling", "gtscale": "switch for a/R scaling of dnbeta (`iprofile=0` only):\n
    \n
  • =0 do not scale dnbeta with eps
  • \n
  • =1 scale dnbeta with eps, original scaling
  • \n
  • =2 scale dnbeta with eps, Menard scaling
  • \n
", "h": "", "h_cp_top": "Vertical distance from the midplane to the top of the tapered section [m]", @@ -10161,7 +10152,6 @@ "ngrp": "number of groups of PF coils. Symmetric coil pairs should all be in the same group", "ngrpmx": "maximum number of groups of PF coils", "ni0": "central ion density (/m3)", - "nign": "electron density at ignition (start-up) (/m3)", "nimp": "nimp /14/ FIX : number of ion species in impurity radiation model", "nin": "", "nineqns": "nineqns /0/ : number of inequality constraints VMCON must satisfy\n (leave at zero for now)", @@ -10389,7 +10379,6 @@ "psyncpv": "synchrotron radiation power per volume (MW/m3)", "ptargf": "IFE target factory power at 6 Hz repetition rate (MW)", "ptarmw": "", - "ptaue": "exponent for density term in energy confinement time formula", "ptempalw": "maximum peak centrepost temperature (K) (`constraint equation 44`)", "ptfnuc": "nuclear heating in the TF coil (MW)", "ptfnucmax": "maximum nuclear heating in TF coil (MW/m3) (`constraint equation 54`)", @@ -10445,7 +10434,6 @@ "qss": "", "qstar": "cylindrical safety factor", "qtargettotal": "Power density on target including surface recombination [W/m2] (`iteration variable 124`)", - "qtaue": "exponent for temperature term in energy confinement time formula", "quench_model": "switch for TF coil quench model (Only applies to REBCO magnet at present, issue #522):\n
    \n
  • ='exponential' exponential quench with constant discharge resistor
  • \n
  • ='linear' quench with constant voltage
  • \n
", "r1": "IFE device radial build (m)", "r2": "IFE device radial build (m)", @@ -10576,7 +10564,6 @@ "rsrd": "effective separatrix/divertor radius ratio", "rtanbeam": "neutral beam centreline tangency radius (m)", "rtanmax": "maximum tangency radius for centreline of beam (m)", - "rtaue": "exponent for power term in energy confinement time formula", "run_tests": "turns on built-in tests if set to 1", "runtitle": "short descriptive title for the run", "rxcl": "clearance around reactor (m)", @@ -10828,7 +10815,6 @@ "thwcndut": "TF coil conduit case thickness (m) (`iteration variable 58`)", "ti": "volume averaged ion temperature (keV). N.B. calculated from te if `tratio > 0.0`", "ti0": "central ion temperature (keV)", - "tign": "electron temperature at ignition (start-up) (keV)", "tim": "array of time points during plasma pulse (s)", "time1": "Time at which TF quench is detected (s)", "time2": "", @@ -19474,15 +19460,6 @@ "estotft", "is_leg_cp_temp_same" ], - "startup_variables": [ - "ftaue", - "gtaue", - "nign", - "ptaue", - "qtaue", - "rtaue", - "tign" - ], "stellarator_configuration": [], "stellarator_module": [ "config", diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 3fd19f3251..125569741a 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -1735,16 +1735,6 @@ class PcondParam(NamedTuple): falpha: Any = None - ptaue: Any = None - - gtaue: Any = None - - ftaue: Any = None - - rtaue: Any = None - - qtaue: Any = None - iinvqd: Any = None isc: Any = None @@ -1803,12 +1793,6 @@ class PcondParam(NamedTuple): expected_kappaa_ipb: Any = None - expected_ptaue: Any = None - - expected_ftaue: Any = None - - expected_rtaue: Any = None - expected_kappaa: Any = None expected_powerht: Any = None @@ -1834,11 +1818,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.40999999999999998, - gtaue=0, - ftaue=1645.9881192671726, - rtaue=-0.63, - qtaue=0, iinvqd=1, isc=32, ignite=0, @@ -1868,9 +1847,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.40999999999999998, - expected_ftaue=823.65887428773408, - expected_rtaue=-0.63, expected_kappaa=1.7187938085542791, expected_ptrepv=0.012570664670798823, expected_ptripv=0.011156836223364355, @@ -1886,11 +1862,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.44, - gtaue=0, - ftaue=146.42448015009589, - rtaue=-0.65000000000000002, - qtaue=0, iinvqd=1, isc=33, ignite=0, @@ -1920,9 +1891,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.44, - expected_ftaue=143.29591882802001, - expected_rtaue=-0.65000000000000002, expected_kappaa=1.7187938085542791, expected_ptrepv=0.081458458765440875, expected_ptripv=0.072296788376262536, @@ -1938,11 +1906,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.40999999999999998, - gtaue=0, - ftaue=176.74003304700352, - rtaue=-0.68999999999999995, - qtaue=0, iinvqd=1, isc=34, ignite=0, @@ -1972,9 +1935,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.40999999999999998, - expected_ftaue=178.90696306034835, - expected_rtaue=-0.68999999999999995, expected_kappaa=1.7187938085542791, expected_ptrepv=0.081327750398391824, expected_ptripv=0.072180780839479111, @@ -1990,11 +1950,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.40000000000000002, - gtaue=0, - ftaue=238.88549012959402, - rtaue=-0.68999999999999995, - qtaue=0, iinvqd=1, isc=35, ignite=0, @@ -2024,9 +1979,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.40000000000000002, - expected_ftaue=120.20885852490557, - expected_rtaue=-0.68999999999999995, expected_kappaa=1.7187938085542791, expected_ptrepv=0.12077931279593926, expected_ptripv=0.10719520783694242, @@ -2042,11 +1994,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.39000000000000001, - gtaue=0, - ftaue=185.98072240082502, - rtaue=-0.69999999999999996, - qtaue=0, iinvqd=1, isc=36, ignite=0, @@ -2076,9 +2023,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.39000000000000001, - expected_ftaue=188.57285952117329, - expected_rtaue=-0.69999999999999996, expected_kappaa=1.7187938085542791, expected_ptrepv=0.081309182573405442, expected_ptripv=0.072164301346324039, @@ -2094,11 +2038,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.51000000000000001, - gtaue=0, - ftaue=104.36916202452747, - rtaue=-0.58999999999999997, - qtaue=0, iinvqd=1, isc=37, ignite=0, @@ -2128,9 +2067,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.51000000000000001, - expected_ftaue=103.56301150501412, - expected_rtaue=-0.58999999999999997, expected_kappaa=1.7187938085542791, expected_ptrepv=0.08142612910014517, expected_ptripv=0.072268094843318462, @@ -2146,11 +2082,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.54000000000000004, - gtaue=0, - ftaue=92.132683025124891, - rtaue=-0.60999999999999999, - qtaue=0, iinvqd=1, isc=38, ignite=0, @@ -2180,9 +2111,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.54000000000000004, - expected_ftaue=130.75063341866976, - expected_rtaue=-0.60999999999999999, expected_kappaa=1.7187938085542791, expected_ptrepv=0.072709146314778414, expected_ptripv=0.064531515128155068, @@ -2198,11 +2126,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.48999999999999999, - gtaue=0, - ftaue=78.856230211754649, - rtaue=-0.55000000000000004, - qtaue=0, iinvqd=1, isc=39, ignite=0, @@ -2232,9 +2155,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.48999999999999999, - expected_ftaue=85.223040995670956, - expected_rtaue=-0.55000000000000004, expected_kappaa=1.7187938085542791, expected_ptrepv=0.078529089520063822, expected_ptripv=0.069696886639614319, @@ -2250,11 +2170,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.44800000000000001, - gtaue=0, - ftaue=238.73238207972739, - rtaue=-0.73499999999999999, - qtaue=0, iinvqd=1, isc=40, ignite=0, @@ -2284,9 +2199,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.44800000000000001, - expected_ftaue=232.72166245933104, - expected_rtaue=-0.73499999999999999, expected_kappaa=1.7187938085542791, expected_ptrepv=0.081359821043062386, expected_ptripv=0.072209244483967094, @@ -2302,11 +2214,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.32000000000000001, - gtaue=0, - ftaue=52.028076004704893, - rtaue=-0.46999999999999997, - qtaue=0, iinvqd=1, isc=41, ignite=0, @@ -2336,9 +2243,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.32000000000000001, - expected_ftaue=50.282659177654601, - expected_rtaue=-0.46999999999999997, expected_kappaa=1.7187938085542791, expected_ptrepv=0.081513009259203975, expected_ptripv=0.072345203550858064, @@ -2354,11 +2258,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=-0.0078747350665397467, - gtaue=0, - ftaue=178.10069717955975, - rtaue=-0.73999999999999999, - qtaue=0, iinvqd=1, isc=42, ignite=0, @@ -2388,9 +2287,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=-0.0078747350665397467, - expected_ftaue=241.51291454983658, - expected_rtaue=-0.73999999999999999, expected_kappaa=1.7187938085542791, expected_ptrepv=0.073097992274882811, expected_ptripv=0.064876627403966491, @@ -2406,11 +2302,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.02, - gtaue=0, - ftaue=17.002723443677841, - rtaue=-0.28999999999999998, - qtaue=0, iinvqd=1, isc=43, ignite=0, @@ -2440,9 +2331,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.02, - expected_ftaue=17.002214349414931, - expected_rtaue=-0.28999999999999998, expected_kappaa=1.7187938085542791, expected_ptrepv=0.081423406537449478, expected_ptripv=0.072265678488503571, @@ -2458,11 +2346,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=-0.029999999999999999, - gtaue=0, - ftaue=21.102743356890517, - rtaue=-0.33000000000000002, - qtaue=0, iinvqd=1, isc=44, ignite=0, @@ -2492,9 +2375,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=-0.029999999999999999, - expected_ftaue=21.103103603854958, - expected_rtaue=-0.33000000000000002, expected_kappaa=1.7187938085542791, expected_ptrepv=0.081419881443596701, expected_ptripv=0.072262549863580605, @@ -2510,11 +2390,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.070000000000000007, - gtaue=0, - ftaue=13.697325239330771, - rtaue=-0.25, - qtaue=0, iinvqd=1, isc=45, ignite=0, @@ -2544,9 +2419,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.070000000000000007, - expected_ftaue=13.699210029839019, - expected_rtaue=-0.25, expected_kappaa=1.7187938085542791, expected_ptrepv=0.081421142032658531, expected_ptripv=0.072263668673609824, @@ -2562,11 +2434,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.44, - gtaue=0, - ftaue=251.73181499774617, - rtaue=-0.72999999999999998, - qtaue=0, iinvqd=1, isc=46, ignite=0, @@ -2596,9 +2463,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.44, - expected_ftaue=230.82001145150934, - expected_rtaue=-0.72999999999999998, expected_kappaa=1.7187938085542791, expected_ptrepv=0.079599509500323962, expected_ptripv=0.070646915991500636, @@ -2614,11 +2478,6 @@ class PcondParam(NamedTuple): kappaa_ipb=1.68145080681586, pohmmw=0.63634001890069991, falpha=0.94999999999999996, - ptaue=0.32000000000000001, - gtaue=0, - ftaue=116.17488441727863, - rtaue=-0.46999999999999997, - qtaue=0, iinvqd=1, isc=47, ignite=0, @@ -2648,9 +2507,6 @@ class PcondParam(NamedTuple): xarea=38.39822223637151, zeff=2.4987360098030775, expected_kappaa_ipb=1.68145080681586, - expected_ptaue=0.32000000000000001, - expected_ftaue=58.462387646846778, - expected_rtaue=-0.46999999999999997, expected_kappaa=1.7187938085542791, expected_ptrepv=0.070108167457759038, expected_ptripv=0.062223069561580698,