From 7b8ea3a24a413e7adf5002b9b4fea9182a02ec95 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 4 Apr 2025 14:14:10 +0100 Subject: [PATCH 01/41] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20CurrentDr?= =?UTF-8?q?ive=20initialization=20to=20include=20new=20classes=20for=20eac?= =?UTF-8?q?h=20current=20drive=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 3863 +++++++++++++++--------------- process/main.py | 23 +- tests/unit/test_current_drive.py | 20 +- tests/unit/test_physics.py | 21 +- tests/unit/test_stellarator.py | 30 +- 5 files changed, 1998 insertions(+), 1959 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 9d066259eb..ec8503d8ec 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -17,1865 +17,2108 @@ from process.plasma_profiles import PlasmaProfile -class CurrentDrive: +class NeutralBeam: def __init__(self, plasma_profile: PlasmaProfile): self.outfile = constants.nout self.plasma_profile = plasma_profile - def cudriv(self, output: bool): - """Routine to calculate the current drive power requirements + def iternb(self): + """Routine to calculate ITER Neutral Beam current drive parameters author: P J Knight, CCFE, Culham Science Centre - outfile : input integer : output file unit - iprint : input integer : switch for writing to output file (1=yes) - This routine calculates the power requirements of the current - drive system, using a choice of models for the current drive - efficiency. + effnbss : output real : neutral beam current drive efficiency (A/W) + f_p_beam_injected_ions : output real : fraction of NB power given to ions + fshine : output real : shine-through fraction of beam + This routine calculates the current drive parameters for a + neutral beam system, based on the 1990 ITER model. + ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, + ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 """ + # Check argument sanity + if (1 + physics_variables.eps) < current_drive_variables.frbeam: + eh.fdiags[0] = physics_variables.eps + eh.fdiags[1] = current_drive_variables.frbeam + eh.report_error(15) - current_drive_variables.p_ecrh_injected_mw = 0.0e0 - current_drive_variables.pnbeam = 0.0e0 - current_drive_variables.plhybd = 0.0e0 - current_drive_variables.c_beam_total = 0.0e0 - beam_current_fix = 0.0e0 - current_drive_variables.p_beam_orbit_loss_mw = 0.0e0 - porbitlossmwfix = 0.0e0 - - pinjmw1 = 0.0 - pinjmwfix = 0.0 - pinjimw1 = 0.0 - pinjemw1 = 0.0 - pinjemwfix = 0.0 - pinjimwfix = 0.0 - auxiliary_cdfix = 0.0 - aux_current_fraction_fix = 0.0 - gamcdfix = 0.0e0 + # Calculate beam path length to centre + dpath = physics_variables.rmajor * np.sqrt( + (1.0 + physics_variables.eps) ** 2 - current_drive_variables.frbeam**2 + ) - # To stop issues with input file we force - # zero secondary heating if no injection method - if current_drive_variables.i_hcd_secondary == 0: - current_drive_variables.p_hcd_secondary_extra_heat_mw = 0.0 + # Calculate beam stopping cross-section + sigstop = self.sigbeam( + current_drive_variables.e_beam_kev / physics_variables.m_beam_amu, + physics_variables.te, + physics_variables.dene, + physics_variables.f_nd_alpha_electron, + physics_variables.rncne, + physics_variables.rnone, + physics_variables.rnfene, + ) - # check for unphysically large heating in - # secondary injected power source - if ( - current_drive_variables.p_hcd_secondary_extra_heat_mw - > current_drive_variables.p_hcd_secondary_injected_mw - ): - current_drive_variables.p_hcd_secondary_extra_heat_mw = ( - current_drive_variables.p_hcd_secondary_injected_mw - ) + # Calculate number of decay lengths to centre + current_drive_variables.n_beam_decay_lengths_core = ( + dpath * physics_variables.dene * sigstop + ) - # current_drive_variables.i_hcd_calculations | switch for current drive calculation - # = 0 | turned off - # = 1 | turned on - if current_drive_variables.i_hcd_calculations != 0: - # put electron density in desired units (10^-20 m-3) - dene20 = physics_variables.dene * 1.0e-20 + # Shine-through fraction of beam + fshine = np.exp(-2.0 * dpath * physics_variables.dene * sigstop) + fshine = max(fshine, 1e-20) - # If present we must calculate second current drive - # efficiencies in units of Amps/Watt using the fixed - # values from user input - # current_drive_variables.i_hcd_secondary | switch for fixed current drive efficiency model + # Deuterium and tritium beam densities + dend = physics_variables.nd_fuel_ions * ( + 1.0 - current_drive_variables.f_beam_tritium + ) + dent = physics_variables.nd_fuel_ions * current_drive_variables.f_beam_tritium - # Fenstermacher Lower Hybrid model - if current_drive_variables.i_hcd_secondary == 1: - effrfssfix = ( - (0.36e0 * (1.0e0 + (physics_variables.te / 25.0e0) ** 1.16e0)) - / (physics_variables.rmajor * dene20) - * current_drive_variables.feffcd - ) - eta_cd_hcd_secondary = effrfssfix - # Ion-Cyclotron current drive - elif current_drive_variables.i_hcd_secondary == 2: - effrfssfix = ( - 0.63e0 - * 0.1e0 - * physics_variables.ten - / (2.0e0 + physics_variables.zeff) - / (physics_variables.rmajor * dene20) - * current_drive_variables.feffcd - ) - eta_cd_hcd_secondary = effrfssfix - # Fenstermacher Electron Cyclotron Resonance model - elif current_drive_variables.i_hcd_secondary == 3: - effrfssfix = ( - 0.21e0 - * physics_variables.ten - / (physics_variables.rmajor * dene20 * physics_variables.dlamee) - * current_drive_variables.feffcd - ) - eta_cd_hcd_secondary = effrfssfix - # Ehst Lower Hybrid / Fast Wave current drive - elif current_drive_variables.i_hcd_secondary == 4: - effrfssfix = ( - physics_variables.te**0.77e0 - * (0.034e0 + 0.196e0 * physics_variables.beta) - / (physics_variables.rmajor * dene20) - * ( - 32.0e0 / (5.0e0 + physics_variables.zeff) - + 2.0e0 - + (12.0e0 * (6.0e0 + physics_variables.zeff)) - / (5.0e0 + physics_variables.zeff) - / (3.0e0 + physics_variables.zeff) - + 3.76e0 / physics_variables.zeff - ) - / 12.507e0 - * current_drive_variables.feffcd - ) - eta_cd_hcd_secondary = effrfssfix - elif current_drive_variables.i_hcd_secondary == 5: - ( - effnbss, - current_drive_variables.f_p_beam_injected_ions, - current_drive_variables.f_p_beam_shine_through, - ) = self.iternb() - effnbssfix = effnbss * current_drive_variables.feffcd - eta_cd_hcd_secondary = effnbssfix - # Culham Lower Hybrid current drive model - elif current_drive_variables.i_hcd_secondary == 6: - effrfss = self.cullhy() - effrfssfix = effrfss * current_drive_variables.feffcd - eta_cd_hcd_secondary = effrfssfix - # Culham ECCD model - elif current_drive_variables.i_hcd_secondary == 7: - effrfss = self.culecd() - effrfssfix = effrfss * current_drive_variables.feffcd - eta_cd_hcd_secondary = effrfssfix - # Culham Neutral Beam model - elif current_drive_variables.i_hcd_secondary == 8: - ( - effnbss, - current_drive_variables.f_p_beam_injected_ions, - current_drive_variables.f_p_beam_shine_through, - ) = self.culnbi() - effnbssfix = effnbss * current_drive_variables.feffcd - eta_cd_hcd_secondary = effnbssfix - # ECRH user input gamma - elif current_drive_variables.i_hcd_secondary == 10: - # Normalised current drive efficiency gamma - current_drive_variables.eta_cd_norm_hcd_secondary = ( - current_drive_variables.eta_cd_norm_ecrh - ) + # Power split to ions / electrons + f_p_beam_injected_ions = self.cfnbi( + physics_variables.m_beam_amu, + current_drive_variables.e_beam_kev, + physics_variables.ten, + physics_variables.dene, + dend, + dent, + physics_variables.zeffai, + physics_variables.dlamie, + ) - # Absolute current drive efficiency - effrfssfix = current_drive_variables.eta_cd_norm_hcd_secondary / ( - dene20 * physics_variables.rmajor - ) - eta_cd_hcd_secondary = effrfssfix - # EBW scaling - elif current_drive_variables.i_hcd_secondary == 12: - # Scaling author Simon Freethy - # Ref : PROCESS issue 1262 - # Normalised current drive efficiency gamma - current_drive_variables.eta_cd_norm_hcd_secondary = ( - current_drive_variables.xi_ebw / 32.7e0 - ) * physics_variables.te + # Current drive efficiency + effnbss = current_drive_variables.frbeam * self.etanb( + physics_variables.m_beam_amu, + physics_variables.alphan, + physics_variables.alphat, + physics_variables.aspect, + physics_variables.dene, + current_drive_variables.e_beam_kev, + physics_variables.rmajor, + physics_variables.ten, + physics_variables.zeff, + ) - # Absolute current drive efficiency - effrfssfix = current_drive_variables.eta_cd_norm_hcd_secondary / ( - dene20 * physics_variables.rmajor - ) - eta_cd_hcd_secondary = effrfssfix + return effnbss, f_p_beam_injected_ions, fshine - # EBWs can only couple to plasma if cyclotron harmonic is above plasma density cut-off; - # this behaviour is captured in the following function (ref issue #1262): - # current_drive_variables.n_ecrh_harmonic = cyclotron harmonic number (fundamental used as default) - # constant 'a' controls sharpness of transition - a = 0.1e0 + def culnbi(self): + """Routine to calculate Neutral Beam current drive parameters + author: P J Knight, CCFE, Culham Science Centre + effnbss : output real : neutral beam current drive efficiency (A/W) + f_p_beam_injected_ions : output real : fraction of NB power given to ions + fshine : output real : shine-through fraction of beam + This routine calculates Neutral Beam current drive parameters + using the corrections outlined in AEA FUS 172 to the ITER method. +

The result cannot be guaranteed for devices with aspect ratios far + from that of ITER (approx. 2.8). + AEA FUS 172: Physics Assessment for the European Reactor Study + """ + if (1.0e0 + physics_variables.eps) < current_drive_variables.frbeam: + eh.fdiags[0] = physics_variables.eps + eh.fdiags[1] = current_drive_variables.frbeam + eh.report_error(20) - fc = ( - 1.0e0 - / (2.0e0 * np.pi) - * current_drive_variables.n_ecrh_harmonic - * constants.electron_charge - * physics_variables.bt - / constants.electron_mass - ) - fp = ( - 1.0e0 - / (2.0e0 * np.pi) - * np.sqrt( - physics_variables.dene - * constants.electron_charge**2 - / (constants.electron_mass * constants.epsilon0) - ) - ) + # Calculate beam path length to centre - density_factor = 0.5e0 * ( - 1.0e0 + np.tanh((2.0e0 / a) * ((fp - fc) / fp - a)) - ) + dpath = physics_variables.rmajor * np.sqrt( + (1.0e0 + physics_variables.eps) ** 2 - current_drive_variables.frbeam**2 + ) - eta_cd_hcd_secondary = eta_cd_hcd_secondary * density_factor - effrfssfix = effrfssfix * density_factor - elif current_drive_variables.i_hcd_secondary == 13: - # ECCD model for O-mode cut-off with added Te and Zeff dependance - # Scaling author: Simon Freethy - # Ref : PROCESS issue #2994 + # Calculate beam stopping cross-section - fc = ( - 1 - / (2 * np.pi) - * constants.electron_charge - * physics_variables.bt - / constants.electron_mass - ) - fp = ( - 1 - / (2 * np.pi) - * np.sqrt( - (physics_variables.dene / 1.0e19) - * constants.electron_charge**2 - / (constants.electron_mass * constants.epsilon0) - ) - ) + sigstop = self.sigbeam( + current_drive_variables.e_beam_kev / physics_variables.m_beam_amu, + physics_variables.te, + physics_variables.dene, + physics_variables.f_nd_alpha_electron, + physics_variables.rncne, + physics_variables.rnone, + physics_variables.rnfene, + ) - xi_CD = 0.18e0 # This is tuned to the results of a GRAY study - xi_CD = xi_CD * ( - 4.8e0 / (2 + physics_variables.zeff) - ) # Zeff correction - effrfssfix = ( - xi_CD - * physics_variables.te - / ( - 3.27e0 - * physics_variables.rmajor - * (physics_variables.dene / 1.0e19) - ) - ) + # Calculate number of decay lengths to centre - # O-mode case - if current_drive_variables.i_ecrh_wave_mode == 0: - f_cutoff = fp + current_drive_variables.n_beam_decay_lengths_core = ( + dpath * physics_variables.dnla * sigstop + ) - # X-mode case - elif current_drive_variables.i_ecrh_wave_mode == 1: - f_cutoff = 0.5 * ( - fc - + np.sqrt( - current_drive_variables.n_ecrh_harmonic * fc**2 + 4 * fp**2 - ) - ) + # Shine-through fraction of beam - # Plasma coupling only occurs if the plasma cut-off is below the cyclotron harmonic - a = 0.1 # This controls how sharply the transition is reached - cutoff_factor = 0.5 * ( - 1 - + np.tanh( - (2 / (a)) - * ( - (current_drive_variables.n_ecrh_harmonic * fc - f_cutoff) - / fp - - a - ) - ) - ) - eta_cd_hcd_secondary = effrfssfix * cutoff_factor - elif current_drive_variables.i_hcd_secondary != 0: - raise ProcessValueError( - f"Current drive switch is invalid: {current_drive_variables.i_hcd_secondary = }" - ) + fshine = np.exp(-2.0e0 * dpath * physics_variables.dnla * sigstop) + fshine = max(fshine, 1.0e-20) - if current_drive_variables.i_hcd_secondary in [1, 2, 4, 6]: - # Injected power - pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw + # Deuterium and tritium beam densities - # Wall plug power - heat_transport_variables.pinjwpfix = ( - current_drive_variables.p_hcd_secondary_injected_mw - / current_drive_variables.eta_lowhyb_injector_wall_plug - ) + dend = physics_variables.nd_fuel_ions * ( + 1.0e0 - current_drive_variables.f_beam_tritium + ) + dent = physics_variables.nd_fuel_ions * current_drive_variables.f_beam_tritium - # Wall plug to injector efficiency - current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( - current_drive_variables.eta_lowhyb_injector_wall_plug - ) + # Power split to ions / electrons - # Normalised current drive efficiency gamma - gamcdfix = effrfssfix * (dene20 * physics_variables.rmajor) + f_p_beam_injected_ions = self.cfnbi( + physics_variables.m_beam_amu, + current_drive_variables.e_beam_kev, + physics_variables.ten, + physics_variables.dene, + dend, + dent, + physics_variables.zeffai, + physics_variables.dlamie, + ) - # the fixed auxiliary current - auxiliary_cdfix = ( - effrfssfix - * ( - current_drive_variables.p_hcd_secondary_injected_mw - - current_drive_variables.p_hcd_secondary_extra_heat_mw - ) - * 1.0e6 - ) - aux_current_fraction_fix = ( - auxiliary_cdfix / physics_variables.plasma_current - ) - elif current_drive_variables.i_hcd_secondary in [3, 7, 10, 12, 13]: - # Injected power - pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw + # Current drive efficiency - # Wall plug power - heat_transport_variables.pinjwpfix = ( - current_drive_variables.p_hcd_secondary_injected_mw - / current_drive_variables.eta_ecrh_injector_wall_plug - ) + effnbss = self.etanb2( + physics_variables.m_beam_amu, + physics_variables.alphan, + physics_variables.alphat, + physics_variables.aspect, + physics_variables.dene, + physics_variables.dnla, + current_drive_variables.e_beam_kev, + current_drive_variables.frbeam, + fshine, + physics_variables.rmajor, + physics_variables.rminor, + physics_variables.ten, + physics_variables.zeff, + ) - # Wall plug to injector efficiency - current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( - current_drive_variables.eta_ecrh_injector_wall_plug - ) + return effnbss, f_p_beam_injected_ions, fshine - # the fixed auxiliary current - auxiliary_cdfix = ( - effrfssfix - * ( - current_drive_variables.p_hcd_secondary_injected_mw - - current_drive_variables.p_hcd_secondary_extra_heat_mw - ) - * 1.0e6 - ) - aux_current_fraction_fix = ( - auxiliary_cdfix / physics_variables.plasma_current - ) - elif current_drive_variables.i_hcd_secondary in [5, 8]: - # Account for first orbit losses - # (power due to particles that are ionised but not thermalised) [MW]: - # This includes a second order term in shinethrough*(first orbit loss) - current_drive_variables.f_p_beam_orbit_loss = min( - 0.999, current_drive_variables.f_p_beam_orbit_loss - ) # Should never be needed + def etanb2( + self, + m_beam_amu, + alphan, + alphat, + aspect, + dene, + dnla, + e_beam_kev, + frbeam, + fshine, + rmajor, + rminor, + ten, + zeff, + ): + """Routine to find neutral beam current drive efficiency + using the ITER 1990 formulation, plus correction terms + outlined in Culham Report AEA FUS 172 + author: P J Knight, CCFE, Culham Science Centre + m_beam_amu : input real : beam ion mass (amu) + alphan : input real : density profile factor + alphat : input real : temperature profile factor + aspect : input real : aspect ratio + dene : input real : volume averaged electron density (m**-3) + dnla : input real : line averaged electron density (m**-3) + e_beam_kev : input real : neutral beam energy (keV) + frbeam : input real : R_tangent / R_major for neutral beam injection + fshine : input real : shine-through fraction of beam + rmajor : input real : plasma major radius (m) + rminor : input real : plasma minor radius (m) + ten : input real : density weighted average electron temperature (keV) + zeff : input real : plasma effective charge + This routine calculates the current drive efficiency in A/W of + a neutral beam system, based on the 1990 ITER model, + plus correction terms outlined in Culham Report AEA FUS 172. +

The formulae are from AEA FUS 172, unless denoted by IPDG89. + AEA FUS 172: Physics Assessment for the European Reactor Study + ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, + ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 + """ + # Charge of beam ions + zbeam = 1.0 - pnbitotfix = current_drive_variables.p_hcd_secondary_injected_mw / ( - 1.0e0 - - current_drive_variables.f_p_beam_orbit_loss - + current_drive_variables.f_p_beam_orbit_loss - * current_drive_variables.f_p_beam_shine_through - ) + # Fitting factor (IPDG89) + bbd = 1.0 - # Shinethrough power (atoms that are not ionised) [MW]: - nbshinemwfix = ( - pnbitotfix * current_drive_variables.f_p_beam_shine_through - ) + # Volume averaged electron density (10**20 m**-3) + dene20 = dene / 1e20 - # First orbit loss - porbitlossmwfix = current_drive_variables.f_p_beam_orbit_loss * ( - pnbitotfix - nbshinemwfix - ) + # Line averaged electron density (10**20 m**-3) + dnla20 = dnla / 1e20 - # Power deposited - pinjmwfix = pnbitotfix - nbshinemwfix - porbitlossmwfix - pinjimwfix = pinjmwfix * current_drive_variables.f_p_beam_injected_ions - pinjemwfix = pinjmwfix * ( - 1.0e0 - current_drive_variables.f_p_beam_injected_ions - ) + # Critical energy (MeV) (power to electrons = power to ions) (IPDG89) + # N.B. ten is in keV + ecrit = 0.01 * m_beam_amu * ten - current_drive_variables.pwpnb = ( - pnbitotfix / current_drive_variables.eta_beam_injector_wall_plug - ) # neutral beam wall plug power - heat_transport_variables.pinjwpfix = current_drive_variables.pwpnb - current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( - current_drive_variables.eta_beam_injector_wall_plug - ) - gamnb = effnbssfix * (dene20 * physics_variables.rmajor) - gamcdfix = gamnb - beam_current_fix = ( - 1.0e-3 * (pnbitotfix * 1.0e6) / current_drive_variables.e_beam_kev - ) # Neutral beam current (A) - auxiliary_cdfix = ( - effnbssfix - * ( - current_drive_variables.p_hcd_secondary_injected_mw - - current_drive_variables.p_hcd_secondary_extra_heat_mw - ) - * 1.0e6 - ) - aux_current_fraction_fix = ( - auxiliary_cdfix / physics_variables.plasma_current - ) + # Beam energy in MeV + ebmev = e_beam_kev / 1e3 - # Fenstermacher Lower Hybrid model - if current_drive_variables.i_hcd_primary == 1: - effrfss = ( - (0.36e0 * (1.0e0 + (physics_variables.te / 25.0e0) ** 1.16e0)) - / (physics_variables.rmajor * dene20) - * current_drive_variables.feffcd - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # Ion-Cyclotron current drive - elif current_drive_variables.i_hcd_primary == 2: - effrfss = ( - 0.63e0 - * 0.1e0 - * physics_variables.ten - / (2.0e0 + physics_variables.zeff) - / (physics_variables.rmajor * dene20) - * current_drive_variables.feffcd - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # Fenstermacher Electron Cyclotron Resonance model - elif current_drive_variables.i_hcd_primary == 3: - effrfss = ( - 0.21e0 - * physics_variables.ten - / (physics_variables.rmajor * dene20 * physics_variables.dlamee) - * current_drive_variables.feffcd - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # Ehst Lower Hybrid / Fast Wave current drive - elif current_drive_variables.i_hcd_primary == 4: - effrfss = ( - physics_variables.te**0.77e0 - * (0.034e0 + 0.196e0 * physics_variables.beta) - / (physics_variables.rmajor * dene20) - * ( - 32.0e0 / (5.0e0 + physics_variables.zeff) - + 2.0e0 - + (12.0e0 * (6.0e0 + physics_variables.zeff)) - / (5.0e0 + physics_variables.zeff) - / (3.0e0 + physics_variables.zeff) - + 3.76e0 / physics_variables.zeff - ) - / 12.507e0 - * current_drive_variables.feffcd - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # ITER Neutral Beam current drive - elif current_drive_variables.i_hcd_primary == 5: - ( - effnbss, - current_drive_variables.f_p_beam_injected_ions, - current_drive_variables.f_p_beam_shine_through, - ) = self.iternb() - effnbss = effnbss * current_drive_variables.feffcd - current_drive_variables.eta_cd_hcd_primary = effnbss - # Culham Lower Hybrid current drive model - elif current_drive_variables.i_hcd_primary == 6: - effrfss = self.cullhy() - effrfss = effrfss * current_drive_variables.feffcd - current_drive_variables.eta_cd_hcd_primary = effrfss - # Culham ECCD model - elif current_drive_variables.i_hcd_primary == 7: - effrfss = self.culecd() - effrfss = effrfss * current_drive_variables.feffcd - current_drive_variables.eta_cd_hcd_primary = effrfss - # Culham Neutral Beam model - elif current_drive_variables.i_hcd_primary == 8: - ( - effnbss, - current_drive_variables.f_p_beam_injected_ions, - current_drive_variables.f_p_beam_shine_through, - ) = self.culnbi() - effnbss = effnbss * current_drive_variables.feffcd - current_drive_variables.eta_cd_hcd_primary = effnbss - # ECRH user input gamma - elif current_drive_variables.i_hcd_primary == 10: - current_drive_variables.eta_cd_norm_hcd_primary = ( - current_drive_variables.eta_cd_norm_ecrh - ) - - # Absolute current drive efficiency - effrfss = current_drive_variables.eta_cd_norm_hcd_primary / ( - dene20 * physics_variables.rmajor - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # EBW scaling - elif current_drive_variables.i_hcd_primary == 12: - # Scaling author Simon Freethy - # Ref : PROCESS issue 1262 + # x and y coefficients of function J0(x,y) (IPDG89) + xjs = ebmev / (bbd * ecrit) + xj = np.sqrt(xjs) - # Normalised current drive efficiency gamma - current_drive_variables.eta_cd_norm_hcd_primary = ( - current_drive_variables.xi_ebw / 32.7e0 - ) * physics_variables.te + yj = 0.8 * zeff / m_beam_amu - # Absolute current drive efficiency - effrfss = current_drive_variables.eta_cd_norm_hcd_primary / ( - dene20 * physics_variables.rmajor - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # EBWs can only couple to plasma if cyclotron harmonic is above plasma density cut-off; - # this behaviour is captured in the following function (ref issue #1262): - # current_drive_variables.n_ecrh_harmonic = cyclotron harmonic number (fundamental used as default) - # contant 'a' controls sharpness of transition - a = 0.1e0 + # Fitting function J0(x,y) + j0 = xjs / (4.0 + 3.0 * yj + xjs * (xj + 1.39 + 0.61 * yj**0.7)) - fc = ( - 1.0e0 - / (2.0e0 * np.pi) - * current_drive_variables.n_ecrh_harmonic - * constants.electron_charge - * physics_variables.bt - / constants.electron_mass - ) - fp = ( - 1.0e0 - / (2.0e0 * np.pi) - * np.sqrt( - physics_variables.dene - * constants.electron_charge**2 - / (constants.electron_mass * constants.epsilon0) - ) - ) + # Effective inverse aspect ratio, with a limit on its maximum value + epseff = min(0.2, (0.5 / aspect)) - density_factor = 0.5e0 * ( - 1.0e0 + np.tanh((2.0e0 / a) * ((fp - fc) / fp - a)) - ) + # Reduction in the reverse electron current + # due to neoclassical effects + gfac = (1.55 + 0.85 / zeff) * np.sqrt(epseff) - (0.2 + 1.55 / zeff) * epseff - current_drive_variables.eta_cd_hcd_primary = ( - current_drive_variables.eta_cd_hcd_primary * density_factor - ) - effrfss = effrfss * density_factor + # Reduction in the net beam driven current + # due to the reverse electron current + ffac = 1.0 - (zbeam / zeff) * (1.0 - gfac) - elif current_drive_variables.i_hcd_primary == 13: - # ECCD model for O-mode cut-off with added Te and Zeff dependance - # Scaling author: Simon Freethy - # Ref : PROCESS issue #2994 + # Normalisation to allow results to be valid for + # non-ITER plasma size and density: - fc = ( - 1 - / (2 * np.pi) - * constants.electron_charge - * physics_variables.bt - / constants.electron_mass - ) - fp = ( - 1 - / (2 * np.pi) - * np.sqrt( - (physics_variables.dene / 1.0e19) - * constants.electron_charge**2 - / (constants.electron_mass * constants.epsilon0) - ) - ) + # Line averaged electron density (10**20 m**-3) normalised to ITER + nnorm = 1.0 - xi_CD = 0.18e0 # This is tuned to the results of a GRAY study - xi_CD = xi_CD * ( - 4.8e0 / (2 + physics_variables.zeff) - ) # Zeff correction - effrfss = ( - xi_CD - * physics_variables.te - / ( - 3.27e0 - * physics_variables.rmajor - * (physics_variables.dene / 1.0e19) - ) - ) + # Distance along beam to plasma centre + r = max(rmajor, rmajor * frbeam) + eps1 = rminor / r - # O-mode case - if current_drive_variables.i_ecrh_wave_mode == 0: - f_cutoff = fp + if (1.0 + eps1) < frbeam: + eh.fdiags[0] = eps1 + eh.fdiags[1] = frbeam + eh.report_error(21) - # X-mode case - elif current_drive_variables.i_ecrh_wave_mode == 1: - f_cutoff = 0.5 * ( - fc - + np.sqrt( - current_drive_variables.n_ecrh_harmonic * fc**2 + 4 * fp**2 - ) - ) + d = rmajor * np.sqrt((1.0 + eps1) ** 2 - frbeam**2) - # Plasma coupling only occurs if the plasma cut-off is below the cyclotron harmonic - a = 0.1 # This controls how sharply the transition is reached - cutoff_factor = 0.5 * ( - 1 - + np.tanh( - (2 / (a)) - * ( - (current_drive_variables.n_ecrh_harmonic * fc - f_cutoff) - / fp - - a - ) - ) - ) - current_drive_variables.eta_cd_hcd_primary = effrfss * cutoff_factor - else: - raise ProcessValueError( - f"Current drive switch is invalid: {current_drive_variables.i_hcd_primary = }" - ) + # Distance along beam to plasma centre for ITER + # assuming a tangency radius equal to the major radius + epsitr = 2.15 / 6.0 + dnorm = 6.0 * np.sqrt(2.0 * epsitr + epsitr**2) - # Compute current drive wall plug and injected powers (MW) and efficiencies - auxiliary_cd = ( - physics_variables.aux_current_fraction - * physics_variables.plasma_current - ) + # Normalisation to beam energy (assumes a simplified formula for + # the beam stopping cross-section) + ebnorm = ebmev * ((nnorm * dnorm) / (dnla20 * d)) ** (1.0 / 0.78) - # LHCD or ICCD - if current_drive_variables.i_hcd_primary in [1, 2, 4, 6]: - # Injected power - current_drive_variables.plhybd = ( - 1.0e-6 - * ( - physics_variables.aux_current_fraction - - aux_current_fraction_fix - ) - * physics_variables.plasma_current - / effrfss - + current_drive_variables.p_hcd_primary_extra_heat_mw - ) - pinjimw1 = 0.0e0 - pinjemw1 = current_drive_variables.plhybd + # A_bd fitting coefficient, after normalisation with ebnorm + abd = ( + 0.107 + * (1.0 - 0.35 * alphan + 0.14 * alphan**2) + * (1.0 - 0.21 * alphat) + * (1.0 - 0.2 * ebnorm + 0.09 * ebnorm**2) + ) - # Wall plug power - current_drive_variables.pwplh = ( - current_drive_variables.plhybd - / current_drive_variables.eta_lowhyb_injector_wall_plug - ) - pinjwp1 = current_drive_variables.pwplh + # Normalised current drive efficiency (A/W m**-2) (IPDG89) + gamnb = 5.0 * abd * 0.1 * ten * (1.0 - fshine) * frbeam * j0 / 0.2 * ffac - # Wall plug to injector efficiency - current_drive_variables.eta_hcd_primary_injector_wall_plug = ( - current_drive_variables.eta_lowhyb_injector_wall_plug - ) + # Current drive efficiency (A/W) + return gamnb / (dene20 * rmajor) - # Normalised current drive efficiency gamma - gamrf = effrfss * (dene20 * physics_variables.rmajor) - current_drive_variables.eta_cd_norm_hcd_primary = gamrf - # ECCD - elif current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: - # Injected power (set to close to close the Steady-state current equilibrium) - current_drive_variables.p_ecrh_injected_mw = ( - 1.0e-6 - * ( - physics_variables.aux_current_fraction - - aux_current_fraction_fix - ) - * physics_variables.plasma_current - / effrfss - + current_drive_variables.p_hcd_primary_extra_heat_mw - ) - pinjemw1 = current_drive_variables.p_ecrh_injected_mw + def etanb(self, m_beam_amu, alphan, alphat, aspect, dene, ebeam, rmajor, ten, zeff): + """Routine to find neutral beam current drive efficiency + using the ITER 1990 formulation + author: P J Knight, CCFE, Culham Science Centre + m_beam_amu : input real : beam ion mass (amu) + alphan : input real : density profile factor + alphat : input real : temperature profile factor + aspect : input real : aspect ratio + dene : input real : volume averaged electron density (m**-3) + ebeam : input real : neutral beam energy (keV) + rmajor : input real : plasma major radius (m) + ten : input real : density weighted average electron temp. (keV) + zeff : input real : plasma effective charge + This routine calculates the current drive efficiency of + a neutral beam system, based on the 1990 ITER model. + ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, + ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 + """ - # Wall plug power - current_drive_variables.echwpow = ( - current_drive_variables.p_ecrh_injected_mw - / current_drive_variables.eta_ecrh_injector_wall_plug - ) + zbeam = 1.0 + bbd = 1.0 - # Wall plug to injector efficiency - pinjwp1 = current_drive_variables.echwpow - current_drive_variables.eta_hcd_primary_injector_wall_plug = ( - current_drive_variables.eta_ecrh_injector_wall_plug - ) - elif current_drive_variables.i_hcd_primary in [5, 8]: - # MDK. See Gitlab issue #248, and scanned note. - power1 = ( - 1.0e-6 - * ( - physics_variables.aux_current_fraction - - aux_current_fraction_fix - ) - * physics_variables.plasma_current - / effnbss - + current_drive_variables.p_hcd_primary_extra_heat_mw - ) + dene20 = 1e-20 * dene - # Account for first orbit losses - # (power due to particles that are ionised but not thermalised) [MW]: - # This includes a second order term in shinethrough*(first orbit loss) - current_drive_variables.f_p_beam_orbit_loss = min( - 0.999, current_drive_variables.f_p_beam_orbit_loss - ) # Should never be needed + # Ratio of E_beam/E_crit + xjs = ebeam / (bbd * 10.0 * m_beam_amu * ten) + xj = np.sqrt(xjs) - current_drive_variables.p_beam_injected_mw = power1 / ( - 1.0e0 - - current_drive_variables.f_p_beam_orbit_loss - + current_drive_variables.f_p_beam_orbit_loss - * current_drive_variables.f_p_beam_shine_through - ) + yj = 0.8 * zeff / m_beam_amu - # Shinethrough power (atoms that are not ionised) [MW]: - current_drive_variables.p_beam_shine_through_mw = ( - current_drive_variables.p_beam_injected_mw - * current_drive_variables.f_p_beam_shine_through - ) + rjfunc = xjs / (4.0 + 3.0 * yj + xjs * (xj + 1.39 + 0.61 * yj**0.7)) - # First orbit loss - current_drive_variables.p_beam_orbit_loss_mw = ( - current_drive_variables.f_p_beam_orbit_loss - * ( - current_drive_variables.p_beam_injected_mw - - current_drive_variables.p_beam_shine_through_mw - ) - ) + epseff = 0.5 / aspect + gfac = (1.55 + 0.85 / zeff) * np.sqrt(epseff) - (0.2 + 1.55 / zeff) * epseff + ffac = 1.0 / zbeam - (1.0 - gfac) / zeff - # Power deposited - pinjmw1 = ( - current_drive_variables.p_beam_injected_mw - - current_drive_variables.p_beam_shine_through_mw - - current_drive_variables.p_beam_orbit_loss_mw - ) - pinjimw1 = pinjmw1 * current_drive_variables.f_p_beam_injected_ions - pinjemw1 = pinjmw1 * ( - 1.0e0 - current_drive_variables.f_p_beam_injected_ions - ) + abd = ( + 0.107 + * (1.0 - 0.35 * alphan + 0.14 * alphan**2) + * (1.0 - 0.21 * alphat) + * (1.0 - 0.2e-3 * ebeam + 0.09e-6 * ebeam**2) + ) - current_drive_variables.pwpnb = ( - current_drive_variables.p_beam_injected_mw - / current_drive_variables.eta_beam_injector_wall_plug - ) # neutral beam wall plug power - pinjwp1 = current_drive_variables.pwpnb - current_drive_variables.eta_hcd_primary_injector_wall_plug = ( - current_drive_variables.eta_beam_injector_wall_plug - ) - gamnb = effnbss * (dene20 * physics_variables.rmajor) - current_drive_variables.eta_cd_norm_hcd_primary = gamnb - current_drive_variables.c_beam_total = ( - 1.0e-3 - * (current_drive_variables.p_beam_injected_mw * 1.0e6) - / current_drive_variables.e_beam_kev - ) # Neutral beam current (A) + return abd * (5.0 / rmajor) * (0.1 * ten / dene20) * rjfunc / 0.2 * ffac - # Total injected power - # sum contributions from primary and secondary systems - current_drive_variables.p_hcd_injected_total_mw = ( - pinjemw1 + pinjimw1 + pinjemwfix + pinjimwfix - ) - pinjmw1 = pinjemw1 + pinjimw1 - pinjmwfix = pinjemwfix + pinjimwfix - current_drive_variables.p_hcd_injected_electrons_mw = pinjemw1 + pinjemwfix - current_drive_variables.p_hcd_injected_ions_mw = pinjimw1 + pinjimwfix - heat_transport_variables.pinjwp = ( - pinjwp1 + heat_transport_variables.pinjwpfix - ) + def sigbeam(self, eb, te, ne, rnhe, rnc, rno, rnfe): + """Calculates the stopping cross-section for a hydrogen + beam in a fusion plasma + author: P J Knight, CCFE, Culham Science Centre + eb : input real : beam energy (kev/amu) + te : input real : electron temperature (keV) + ne : input real : electron density (10^20m-3) + rnhe : input real : alpha density / ne + rnc : input real : carbon density /ne + rno : input real : oxygen density /ne + rnfe : input real : iron density /ne + This function calculates the stopping cross-section (m^-2) + for a hydrogen beam in a fusion plasma. + Janev, Boley and Post, Nuclear Fusion 29 (1989) 2125 + """ + a = np.array([ + [ + [4.4, -2.49e-2], + [7.46e-2, 2.27e-3], + [3.16e-3, -2.78e-5], + ], + [ + [2.3e-1, -1.15e-2], + [-2.55e-3, -6.2e-4], + [1.32e-3, 3.38e-5], + ], + ]) - # Reset injected power to zero for ignited plasma (fudge) - if physics_variables.ignite == 1: - heat_transport_variables.pinjwp = 0.0e0 + b = np.array([ + [ + [[-2.36, -1.49, -1.41, -1.03], [0.185, -0.0154, -4.08e-4, 0.106]], + [ + [-0.25, -0.119, -0.108, -0.0558], + [-0.0381, -0.015, -0.0138, -3.72e-3], + ], + ], + [ + [ + [0.849, 0.518, 0.477, 0.322], + [-0.0478, 7.18e-3, 1.57e-3, -0.0375], + ], + [ + [0.0677, 0.0292, 0.0259, 0.0124], + [0.0105, 3.66e-3, 3.33e-3, 8.61e-4], + ], + ], + [ + [ + [-0.0588, -0.0336, -0.0305, -0.0187], + [4.34e-3, 3.41e-4, 7.35e-4, 3.53e-3], + ], + [ + [-4.48e-3, -1.79e-3, -1.57e-3, -7.43e-4], + [-6.76e-4, -2.04e-4, -1.86e-4, -5.12e-5], + ], + ], + ]) - # Ratio of fusion to input (injection+ohmic) power - if ( - abs( - current_drive_variables.p_hcd_injected_total_mw - + current_drive_variables.p_beam_orbit_loss_mw - + physics_variables.p_plasma_ohmic_mw - ) - < 1.0e-6 - ): - current_drive_variables.bigq = 1.0e18 - else: - current_drive_variables.bigq = physics_variables.fusion_power / ( - current_drive_variables.p_hcd_injected_total_mw - + current_drive_variables.p_beam_orbit_loss_mw - + physics_variables.p_plasma_ohmic_mw - ) + z = np.array([2.0, 6.0, 8.0, 26.0]) + nn = np.array([rnhe, rnc, rno, rnfe]) - if not output: - return + nen = ne * 1e-19 - po.oheadr(self.outfile, "Current Drive System") + s1 = 0.0 + for k in range(2): + for j in range(3): + for i in range(2): + s1 += ( + a[i, j, k] + * (np.log(eb)) ** i + * (np.log(nen)) ** j + * (np.log(te)) ** k + ) - if current_drive_variables.i_hcd_calculations == 0: - po.ocmmnt(self.outfile, "No current drive used") - po.oblnkl(self.outfile) - return + sz = 0.0 + for l in range(4): # noqa: E741 + for k in range(2): + for j in range(2): + for i in range(3): + sz += ( + b[i, j, k, l] + * (np.log(eb)) ** i + * (np.log(nen)) ** j + * (np.log(te)) ** k + * nn[l] + * z[l] + * (z[l] - 1.0) + ) - if current_drive_variables.i_hcd_primary in [1, 4, 6]: - po.ocmmnt(self.outfile, "Lower Hybrid Current Drive") - elif current_drive_variables.i_hcd_primary == 2: - po.ocmmnt(self.outfile, "Ion Cyclotron Current Drive") - elif current_drive_variables.i_hcd_primary in [3, 7]: - po.ocmmnt(self.outfile, "Electron Cyclotron Current Drive") - elif current_drive_variables.i_hcd_primary in [5, 8]: - po.ocmmnt(self.outfile, "Neutral Beam Current Drive") - elif current_drive_variables.i_hcd_primary == 10: - po.ocmmnt( - self.outfile, "Electron Cyclotron Current Drive (user input gamma_CD)" - ) - elif current_drive_variables.i_hcd_primary == 12: - po.ocmmnt(self.outfile, "EBW current drive") - elif current_drive_variables.i_hcd_primary == 13: - po.ocmmnt( - self.outfile, - "Electron Cyclotron Current Drive (O-mode cutoff with Zeff & Te)", - ) + return max(1e-20 * (np.exp(s1) / eb * (1.0 + sz)), 1e-23) - po.ovarin( - self.outfile, - "Current drive efficiency model", - "(i_hcd_primary)", - current_drive_variables.i_hcd_primary, - ) + def cfnbi(self, afast, efast, te, ne, _nd, _nt, zeffai, xlmbda): + """Routine to calculate the fraction of the fast particle energy + coupled to the ions + author: P J Knight, CCFE, Culham Science Centre + afast : input real : mass of fast particle (units of proton mass) + efast : input real : energy of fast particle (keV) + te : input real : density weighted average electron temp. (keV) + ne : input real : volume averaged electron density (m**-3) + nd : input real : deuterium beam density (m**-3) + nt : input real : tritium beam density (m**-3) + zeffai : input real : mass weighted plasma effective charge + xlmbda : input real : ion-electron coulomb logarithm + f_p_beam_injected_ions : output real : fraction of fast particle energy coupled to ions + This routine calculates the fast particle energy coupled to + the ions in the neutral beam system. + """ + # atmd = 2.0 + atmdt = 2.5 + # atmt = 3.0 + c = 3.0e8 + me = constants.electron_mass + # zd = 1.0 + # zt = 1.0 - if current_drive_variables.i_hcd_secondary in [1, 4, 6]: - po.ocmmnt(self.outfile, "Lower Hybrid Current Drive") - elif current_drive_variables.i_hcd_secondary == 2: - po.ocmmnt(self.outfile, "Ion Cyclotron Current Drive") - elif current_drive_variables.i_hcd_secondary in [3, 7]: - po.ocmmnt(self.outfile, "Electron Cyclotron Current Drive") - elif current_drive_variables.i_hcd_secondary in [5, 8]: - po.ocmmnt(self.outfile, "Neutral Beam Current Drive") - elif current_drive_variables.i_hcd_secondary == 10: - po.ocmmnt( - self.outfile, "Electron Cyclotron Current Drive (user input gamma_CD)" - ) - elif current_drive_variables.i_hcd_secondary == 12: - po.ocmmnt(self.outfile, "EBW current drive") - elif current_drive_variables.i_hcd_secondary == 13: - po.ocmmnt( - self.outfile, - "Electron Cyclotron Current Drive (O-mode cutoff with Zeff & Te)", - ) + # xlbd = self.xlmbdabi(afast, atmd, efast, te, ne) + # xlbt = self.xlmbdabi(afast, atmt, efast, te, ne) - po.ovarin( - self.outfile, - "Secondary current drive efficiency model", - "(i_hcd_secondary)", - current_drive_variables.i_hcd_secondary, + # sum = nd * zd * zd * xlbd / atmd + nt * zt * zt * xlbt / atmt + # ecritfix = 16.0e0 * te * afast * (sum / (ne * xlmbda)) ** (2.0e0 / 3.0e0) + + xlmbdai = self.xlmbdabi(afast, atmdt, efast, te, ne) + sumln = zeffai * xlmbdai / xlmbda + xlnrat = ( + 3.0e0 * np.sqrt(np.pi) / 4.0e0 * me / constants.proton_mass * sumln + ) ** (2.0e0 / 3.0e0) + ve = c * np.sqrt(2.0e0 * te / 511.0e0) + + ecritfi = ( + afast + * constants.proton_mass + * ve + * ve + * xlnrat + / (2.0e0 * constants.electron_charge * 1.0e3) ) - if physics_variables.ignite == 1: - po.ocmmnt( - self.outfile, - "Ignited plasma; injected power only used for start-up phase", - ) + x = np.sqrt(efast / ecritfi) + t1 = np.log((x * x - x + 1.0e0) / ((x + 1.0e0) ** 2)) + thx = (2.0e0 * x - 1.0e0) / np.sqrt(3.0e0) + t2 = 2.0e0 * np.sqrt(3.0e0) * (np.arctan(thx) + np.pi / 6.0e0) - po.oblnkl(self.outfile) + return (t1 + t2) / (3.0e0 * x * x) - if abs(physics_variables.inductive_current_fraction) > 1.0e-8: - po.ocmmnt(self.outfile, "Current is driven by both inductive") - po.ocmmnt(self.outfile, "and non-inductive means.") + def xlmbdabi(self, mb, mth, eb, t, nelec): + """Calculates the Coulomb logarithm for ion-ion collisions + author: P J Knight, CCFE, Culham Science Centre + mb : input real : mass of fast particle (units of proton mass) + mth : input real : mass of background ions (units of proton mass) + eb : input real : energy of fast particle (keV) + t : input real : density weighted average electron temp. (keV) + nelec : input real : volume averaged electron density (m**-3) + This function calculates the Coulomb logarithm for ion-ion + collisions where the relative velocity may be large compared + with the background ('mt') thermal velocity. + Mikkelson and Singer, Nuc Tech/Fus, 4, 237 (1983) + """ - po.ovarre( - self.outfile, - "Ratio of power for flat-top to start-up (MW)", - "(startupratio)", - cost_variables.startupratio, - ) - po.ovarre( - self.outfile, - "Auxiliary power used for plasma heating only (MW)", - "(p_hcd_primary_extra_heat_mw)", - current_drive_variables.p_hcd_primary_extra_heat_mw - + current_drive_variables.p_hcd_secondary_extra_heat_mw, - ) - po.ovarre( - self.outfile, - "Power injected for current drive (MW)", - "(pcurrentdrivemw)", - current_drive_variables.p_hcd_injected_total_mw - - current_drive_variables.p_hcd_primary_extra_heat_mw - - current_drive_variables.p_hcd_secondary_extra_heat_mw, - ) - po.ovarre( - self.outfile, - "Maximum Allowed Bootstrap current fraction", - "(f_c_plasma_bootstrap_max)", - current_drive_variables.f_c_plasma_bootstrap_max, - ) - if current_drive_variables.i_hcd_secondary != 0: - po.ovarre( - self.outfile, - "Power injected for main current drive (MW)", - "(pcurrentdrivemw1)", - pinjmw1 - current_drive_variables.p_hcd_primary_extra_heat_mw, - ) - po.ovarre( - self.outfile, - "Power injected for secondary current drive (MW)", - "(pcurrentdrivemw2)", - pinjmwfix - current_drive_variables.p_hcd_secondary_extra_heat_mw, - ) + x1 = (t / 10.0) * (eb / 1000.0) * mb / (nelec / 1e20) + x2 = mth / (mth + mb) - po.ovarre( - self.outfile, - "Fusion gain factor Q", - "(bigq)", - current_drive_variables.bigq, - "OP ", - ) - po.ovarre( - self.outfile, - "Auxiliary current drive (A)", - "(auxiliary_cd)", - auxiliary_cd, - "OP ", - ) - if current_drive_variables.i_hcd_secondary != 0: - po.ovarre( - self.outfile, - "Secondary auxiliary current drive (A)", - "(auxiliary_cdfix)", - auxiliary_cdfix, - "OP ", - ) + return 23.7 + np.log(x2 * np.sqrt(x1)) - po.ovarre( - self.outfile, - "Current drive efficiency (A/W)", - "(eta_cd_hcd_primary)", - current_drive_variables.eta_cd_hcd_primary, - "OP ", - ) - po.ovarre( - self.outfile, - "Normalised current drive efficiency of primary HCD system (10^20 A / W m^2)", - "(eta_cd_norm_hcd_primary)", - current_drive_variables.eta_cd_norm_hcd_primary, - "OP ", + +class ElectronCyclotron: + def __init__(self, plasma_profile: PlasmaProfile): + self.outfile = constants.nout + self.plasma_profile = plasma_profile + + def culecd(self): + """Routine to calculate Electron Cyclotron current drive efficiency + author: M R O'Brien, CCFE, Culham Science Centre + author: P J Knight, CCFE, Culham Science Centre + effrfss : output real : electron cyclotron current drive efficiency (A/W) + This routine calculates the current drive parameters for a + electron cyclotron system, based on the AEA FUS 172 model. + AEA FUS 172: Physics Assessment for the European Reactor Study + """ + rrr = 1.0e0 / 3.0e0 + + # Temperature + tlocal = self.plasma_profile.teprofile.calculate_profile_y( + rrr, + physics_variables.rhopedt, + physics_variables.te0, + physics_variables.teped, + physics_variables.tesep, + physics_variables.alphat, + physics_variables.tbeta, ) - po.ovarre( - self.outfile, - "Wall plug to injector efficiency", - "(eta_hcd_primary_injector_wall_plug)", - current_drive_variables.eta_hcd_primary_injector_wall_plug, + + # Density (10**20 m**-3) + dlocal = 1.0e-20 * self.plasma_profile.neprofile.calculate_profile_y( + rrr, + physics_variables.rhopedn, + physics_variables.ne0, + physics_variables.neped, + physics_variables.nesep, + physics_variables.alphan, ) - if current_drive_variables.i_hcd_primary == 10: - po.ovarre( - self.outfile, - "ECRH plasma heating efficiency", - "(eta_cd_norm_ecrh)", - current_drive_variables.eta_cd_norm_ecrh, - ) - if current_drive_variables.i_hcd_primary == 12: - po.ovarre( - self.outfile, - "EBW plasma heating efficiency", - "(xi_ebw)", - current_drive_variables.xi_ebw, - ) - if current_drive_variables.i_hcd_primary in [12, 13]: - po.ovarre( - self.outfile, - "EC harmonic number", - "(n_ecrh_harmonic)", - current_drive_variables.n_ecrh_harmonic, - ) - if current_drive_variables.i_hcd_primary == 13: - po.ovarin( - self.outfile, - "EC cutoff wave mode switch", - "(i_ecrh_wave_mode)", - current_drive_variables.i_ecrh_wave_mode, - ) + # Inverse aspect ratio + epsloc = rrr * physics_variables.rminor / physics_variables.rmajor - if current_drive_variables.i_hcd_secondary != 0: - po.ovarre( - self.outfile, - "Secondary current drive efficiency (A/W)", - "(eta_cd_hcd_secondary)", - eta_cd_hcd_secondary, - "OP ", - ) - po.ovarre( - self.outfile, - "Seconday wall plug to injector efficiency", - "(eta_hcd_secondary_injector_wall_plug)", - current_drive_variables.eta_hcd_secondary_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "Normalised secondary current drive efficiency, gamma (10^20 A/W-m2)", - "(gamcdfix)", - gamcdfix, - "OP ", - ) + # Effective charge (use average value) + zlocal = physics_variables.zeff - po.osubhd(self.outfile, "Fractions of current drive :") - po.ovarrf( - self.outfile, - "Bootstrap fraction", - "(f_c_plasma_bootstrap)", - current_drive_variables.f_c_plasma_bootstrap, - "OP ", - ) - po.ovarrf( - self.outfile, - "Diamagnetic fraction", - "(f_c_plasma_diamagnetic)", - current_drive_variables.f_c_plasma_diamagnetic, - "OP ", - ) - po.ovarrf( - self.outfile, - "Pfirsch-Schlueter fraction", - "(f_c_plasma_pfirsch_schluter)", - current_drive_variables.f_c_plasma_pfirsch_schluter, - "OP ", - ) - po.ovarrf( - self.outfile, - "Auxiliary current drive fraction", - "(aux_current_fraction)", - physics_variables.aux_current_fraction, - "OP ", + # Coulomb logarithm for ion-electron collisions + # (From J. A. Wesson, 'Tokamaks', Clarendon Press, Oxford, p.293) + coulog = 15.2e0 - 0.5e0 * np.log(dlocal) + np.log(tlocal) + + # Calculate normalised current drive efficiency at four different + # poloidal angles, and average. + # cosang = cosine of the poloidal angle at which ECCD takes place + # = +1 outside, -1 inside. + cosang = 1.0e0 + ecgam1 = self.eccdef(tlocal, epsloc, zlocal, cosang, coulog) + cosang = 0.5e0 + ecgam2 = self.eccdef(tlocal, epsloc, zlocal, cosang, coulog) + cosang = -0.5e0 + ecgam3 = self.eccdef(tlocal, epsloc, zlocal, cosang, coulog) + cosang = -1.0e0 + ecgam4 = self.eccdef(tlocal, epsloc, zlocal, cosang, coulog) + + # Normalised current drive efficiency (A/W m**-2) + ecgam = 0.25e0 * (ecgam1 + ecgam2 + ecgam3 + ecgam4) + + # Current drive efficiency (A/W) + return ecgam / (dlocal * physics_variables.rmajor) + + def eccdef(self, tlocal, epsloc, zlocal, cosang, coulog): + """Routine to calculate Electron Cyclotron current drive efficiency + author: M R O'Brien, CCFE, Culham Science Centre + author: P J Knight, CCFE, Culham Science Centre + tlocal : input real : local electron temperature (keV) + epsloc : input real : local inverse aspect ratio + zlocal : input real : local plasma effective charge + cosang : input real : cosine of the poloidal angle at which ECCD takes + place (+1 outside, -1 inside) + coulog : input real : local coulomb logarithm for ion-electron collisions + ecgam : output real : normalised current drive efficiency (A/W m**-2) + This routine calculates the current drive parameters for a + electron cyclotron system, based on the AEA FUS 172 model. + It works out the ECCD efficiency using the formula due to Cohen + quoted in the ITER Physics Design Guidelines : 1989 + (but including division by the Coulomb Logarithm omitted from + IPDG89). We have assumed gamma**2-1 << 1, where gamma is the + relativistic factor. The notation follows that in IPDG89. +

The answer ECGAM is the normalised efficiency nIR/P with n the + local density in 10**20 /m**3, I the driven current in MAmps, + R the major radius in metres, and P the absorbed power in MWatts. + AEA FUS 172: Physics Assessment for the European Reactor Study + ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, + ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 + """ + mcsq = ( + constants.electron_mass * 2.9979e8**2 / (1.0e3 * constants.electron_volt) + ) # keV + f = 16.0e0 * (tlocal / mcsq) ** 2 + + # fp is the derivative of f with respect to gamma, the relativistic + # factor, taken equal to 1 + 2T/(m c**2) + + fp = 16.0e0 * tlocal / mcsq + + # lam is IPDG89's lambda. LEGEND calculates the Legendre function of + # order alpha and argument lam, palpha, and its derivative, palphap. + # Here alpha satisfies alpha(alpha+1) = -8/(1+zlocal). alpha is of the + # form (-1/2 + ix), with x a real number and i = sqrt(-1). + + lam = 1.0e0 + palpha, palphap = self.legend(zlocal, lam) + + lams = np.sqrt(2.0e0 * epsloc / (1.0e0 + epsloc)) + palphas, _ = self.legend(zlocal, lams) + + # hp is the derivative of IPDG89's h function with respect to lam + + h = -4.0e0 * lam / (zlocal + 5.0e0) * (1.0e0 - lams * palpha / (lam * palphas)) + hp = -4.0e0 / (zlocal + 5.0e0) * (1.0e0 - lams * palphap / palphas) + + # facm is IPDG89's momentum conserving factor + + facm = 1.5e0 + y = mcsq / (2.0e0 * tlocal) * (1.0e0 + epsloc * cosang) + + # We take the negative of the IPDG89 expression to get a positive + # number + + ecgam = ( + -7.8e0 + * facm + * np.sqrt((1.0e0 + epsloc) / (1.0e0 - epsloc)) + / coulog + * (h * fp - 0.5e0 * y * f * hp) ) - po.ovarrf( - self.outfile, - "Inductive fraction", - "(inductive_current_fraction)", - physics_variables.inductive_current_fraction, - "OP ", + + if ecgam < 0.0e0: + eh.report_error(17) + return ecgam + + +class IonCyclotron: + def __init__(self, plasma_profile: PlasmaProfile): + self.outfile = constants.nout + self.plasma_profile = plasma_profile + + +class ElectronBernstein: + def __init__(self, plasma_profile: PlasmaProfile): + self.outfile = constants.nout + self.plasma_profile = plasma_profile + + +class LowerHybrid: + def __init__(self, plasma_profile: PlasmaProfile): + self.outfile = constants.nout + self.plasma_profile = plasma_profile + + def cullhy(self): + """Routine to calculate Lower Hybrid current drive efficiency + author: P J Knight, CCFE, Culham Science Centre + effrfss : output real : lower hybrid current drive efficiency (A/W) + This routine calculates the current drive parameters for a + lower hybrid system, based on the AEA FUS 172 model. + AEA FUS 172: Physics Assessment for the European Reactor Study + """ + rratio = self.lhrad() + rpenet = rratio * physics_variables.rminor + + # Local density, temperature, toroidal field at this minor radius + + dlocal = 1.0e-19 * self.plasma_profile.neprofile.calculate_profile_y( + rratio, + physics_variables.rhopedn, + physics_variables.ne0, + physics_variables.neped, + physics_variables.nesep, + physics_variables.alphan, ) - # Add total error check. - po.ovarrf( - self.outfile, - "Total", - "(f_c_plasma_internal+aux_current_fraction+inductive_current_fraction)", - current_drive_variables.f_c_plasma_internal - + physics_variables.aux_current_fraction - + physics_variables.inductive_current_fraction, + tlocal = self.plasma_profile.teprofile.calculate_profile_y( + rratio, + physics_variables.rhopedt, + physics_variables.te0, + physics_variables.teped, + physics_variables.tesep, + physics_variables.alphat, + physics_variables.tbeta, ) - if ( - abs( - current_drive_variables.f_c_plasma_internal - + physics_variables.aux_current_fraction - + physics_variables.inductive_current_fraction - - 1.0e0 - ) - > 1.0e-8 - ): - po.ocmmnt(self.outfile, "ERROR: current drive fractions do not add to 1") + blocal = ( + physics_variables.bt + * physics_variables.rmajor + / (physics_variables.rmajor - rpenet) + ) # Calculated on inboard side - # MDK Add physics_variables.fvsbrnni as it can be an iteration variable - po.ovarrf( - self.outfile, - "Fraction of the plasma current produced by non-inductive means", - "(fvsbrnni)", - physics_variables.fvsbrnni, - ) + # Parallel refractive index needed for plasma access - if ( - abs( - current_drive_variables.f_c_plasma_bootstrap - - current_drive_variables.f_c_plasma_bootstrap_max - ) - < 1.0e-8 - ): - po.ocmmnt(self.outfile, "Warning : bootstrap current fraction is at") - po.ocmmnt(self.outfile, " its prescribed maximum.") + frac = np.sqrt(dlocal) / blocal + nplacc = frac + np.sqrt(1.0e0 + frac * frac) - po.oblnkl(self.outfile) + # Local inverse aspect ratio - if abs(current_drive_variables.plhybd) > 1.0e-8: - po.ovarre(self.outfile, "RF efficiency (A/W)", "(effrfss)", effrfss, "OP ") - po.ovarre(self.outfile, "RF gamma (10^20 A/W-m2)", "(gamrf)", gamrf, "OP ") - po.ovarre( - self.outfile, - "Lower hybrid injected power (MW)", - "(plhybd)", - current_drive_variables.plhybd, - "OP ", - ) - po.ovarre( - self.outfile, - "Lower hybrid wall plug efficiency", - "(eta_lowhyb_injector_wall_plug)", - current_drive_variables.eta_lowhyb_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "Lower hybrid wall plug power (MW)", - "(pwplh)", - current_drive_variables.pwplh, - "OP ", - ) + epslh = rpenet / physics_variables.rmajor - # MDK rearranged and added current_drive_variables.p_beam_shine_through_mw - # if (abs(current_drive_variables.pnbeam) > 1.0e-8) : + # LH normalised efficiency (A/W m**-2) + + x = 24.0e0 / (nplacc * np.sqrt(tlocal)) + + term01 = 6.1e0 / (nplacc * nplacc * (physics_variables.zeff + 5.0e0)) + term02 = 1.0e0 + (tlocal / 25.0e0) ** 1.16e0 + term03 = epslh**0.77e0 * np.sqrt(12.25e0 + x * x) + term04 = 3.5e0 * epslh**0.77e0 + x + + if term03 > term04: + eh.fdiags[0] = term03 + eh.fdiags[1] = term04 + eh.report_error(129) + + gamlh = term01 * term02 * (1.0e0 - term03 / term04) + + # Current drive efficiency (A/W) + + return gamlh / ((0.1e0 * dlocal) * physics_variables.rmajor) + + def lhrad(self): + """Routine to calculate Lower Hybrid wave absorption radius + author: P J Knight, CCFE, Culham Science Centre + rratio : output real : minor radius of penetration / rminor + This routine determines numerically the minor radius at which the + damping of Lower Hybrid waves occurs, using a Newton-Raphson method. + AEA FUS 172: Physics Assessment for the European Reactor Study + """ + # Correction to refractive index (kept within valid bounds) + drfind = min(0.7e0, max(0.1e0, 12.5e0 / physics_variables.te0)) + + # Use Newton-Raphson method to establish the correct minor radius + # ratio. g is calculated as a function of r / r_minor, where g is + # the difference between the results of the two formulae for the + # energy E given in AEA FUS 172, p.58. The required minor radius + # ratio has been found when g is sufficiently close to zero. + + # Initial guess for the minor radius ratio + + rat0 = 0.8e0 + + for _ in range(100): + # Minor radius ratios either side of the latest guess + + r1 = rat0 - 1.0e-3 * rat0 + r2 = rat0 + 1.0e-3 * rat0 + + # Evaluate g at rat0, r1, r2 + + g0 = self.lheval(drfind, rat0) + g1 = self.lheval(drfind, r1) + g2 = self.lheval(drfind, r2) + + # Calculate gradient of g with respect to minor radius ratio + + dgdr = (g2 - g1) / (r2 - r1) + + # New approximation + + rat1 = rat0 - g0 / dgdr + + # Force this approximation to lie within bounds + + rat1 = max(0.0001e0, rat1) + rat1 = min(0.9999e0, rat1) + + if abs(g0) <= 0.01e0: + break + rat0 = rat1 + + else: + eh.report_error(16) + rat0 = 0.8e0 + + return rat0 + + +class CurrentDrive: + def __init__( + self, + plasma_profile: PlasmaProfile, + electron_cyclotron: ElectronCyclotron, + ion_cyclotron: IonCyclotron, + lower_hybrid: LowerHybrid, + neutral_beam: NeutralBeam, + electron_bernstein: ElectronBernstein, + ): + self.outfile = constants.nout + self.plasma_profile = plasma_profile + self.electron_cyclotron = electron_cyclotron + self.ion_cyclotron = ion_cyclotron + self.lower_hybrid = lower_hybrid + self.neutral_beam = neutral_beam + self.electron_bernstein = electron_bernstein + + def cudriv(self, output: bool): + """Routine to calculate the current drive power requirements + author: P J Knight, CCFE, Culham Science Centre + outfile : input integer : output file unit + iprint : input integer : switch for writing to output file (1=yes) + This routine calculates the power requirements of the current + drive system, using a choice of models for the current drive + efficiency. + """ + + current_drive_variables.p_ecrh_injected_mw = 0.0e0 + current_drive_variables.pnbeam = 0.0e0 + current_drive_variables.plhybd = 0.0e0 + current_drive_variables.c_beam_total = 0.0e0 + beam_current_fix = 0.0e0 + current_drive_variables.p_beam_orbit_loss_mw = 0.0e0 + porbitlossmwfix = 0.0e0 + + pinjmw1 = 0.0 + pinjmwfix = 0.0 + pinjimw1 = 0.0 + pinjemw1 = 0.0 + pinjemwfix = 0.0 + pinjimwfix = 0.0 + auxiliary_cdfix = 0.0 + aux_current_fraction_fix = 0.0 + gamcdfix = 0.0e0 + + # To stop issues with input file we force + # zero secondary heating if no injection method + if current_drive_variables.i_hcd_secondary == 0: + current_drive_variables.p_hcd_secondary_extra_heat_mw = 0.0 + + # check for unphysically large heating in + # secondary injected power source if ( - (current_drive_variables.i_hcd_primary == 5) - or (current_drive_variables.i_hcd_primary == 8) - or (current_drive_variables.i_hcd_secondary == 5) - or (current_drive_variables.i_hcd_secondary == 8) + current_drive_variables.p_hcd_secondary_extra_heat_mw + > current_drive_variables.p_hcd_secondary_injected_mw ): - po.ovarre( - self.outfile, - "Neutral beam energy (keV)", - "(e_beam_kev)", - current_drive_variables.e_beam_kev, - ) - if (current_drive_variables.i_hcd_primary == 5) or ( - current_drive_variables.i_hcd_primary == 8 - ): - po.ovarre( - self.outfile, - "Neutral beam current (A)", - "(c_beam_total)", - current_drive_variables.c_beam_total, - "OP ", - ) + current_drive_variables.p_hcd_secondary_extra_heat_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + ) - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.ovarre( - self.outfile, - "Secondary fixed neutral beam current (A)", - "(beam_current_fix)", - beam_current_fix, - "OP ", + # current_drive_variables.i_hcd_calculations | switch for current drive calculation + # = 0 | turned off + # = 1 | turned on + if current_drive_variables.i_hcd_calculations != 0: + # put electron density in desired units (10^-20 m-3) + dene20 = physics_variables.dene * 1.0e-20 + + # If present we must calculate second current drive + # efficiencies in units of Amps/Watt using the fixed + # values from user input + # current_drive_variables.i_hcd_secondary | switch for fixed current drive efficiency model + + # Fenstermacher Lower Hybrid model + if current_drive_variables.i_hcd_secondary == 1: + effrfssfix = ( + (0.36e0 * (1.0e0 + (physics_variables.te / 25.0e0) ** 1.16e0)) + / (physics_variables.rmajor * dene20) + * current_drive_variables.feffcd + ) + eta_cd_hcd_secondary = effrfssfix + # Ion-Cyclotron current drive + elif current_drive_variables.i_hcd_secondary == 2: + effrfssfix = ( + 0.63e0 + * 0.1e0 + * physics_variables.ten + / (2.0e0 + physics_variables.zeff) + / (physics_variables.rmajor * dene20) + * current_drive_variables.feffcd + ) + eta_cd_hcd_secondary = effrfssfix + # Fenstermacher Electron Cyclotron Resonance model + elif current_drive_variables.i_hcd_secondary == 3: + effrfssfix = ( + 0.21e0 + * physics_variables.ten + / (physics_variables.rmajor * dene20 * physics_variables.dlamee) + * current_drive_variables.feffcd + ) + eta_cd_hcd_secondary = effrfssfix + # Ehst Lower Hybrid / Fast Wave current drive + elif current_drive_variables.i_hcd_secondary == 4: + effrfssfix = ( + physics_variables.te**0.77e0 + * (0.034e0 + 0.196e0 * physics_variables.beta) + / (physics_variables.rmajor * dene20) + * ( + 32.0e0 / (5.0e0 + physics_variables.zeff) + + 2.0e0 + + (12.0e0 * (6.0e0 + physics_variables.zeff)) + / (5.0e0 + physics_variables.zeff) + / (3.0e0 + physics_variables.zeff) + + 3.76e0 / physics_variables.zeff + ) + / 12.507e0 + * current_drive_variables.feffcd + ) + eta_cd_hcd_secondary = effrfssfix + elif current_drive_variables.i_hcd_secondary == 5: + ( + effnbss, + current_drive_variables.f_p_beam_injected_ions, + current_drive_variables.f_p_beam_shine_through, + ) = self.neutral_beam.iternb() + effnbssfix = effnbss * current_drive_variables.feffcd + eta_cd_hcd_secondary = effnbssfix + # Culham Lower Hybrid current drive model + elif current_drive_variables.i_hcd_secondary == 6: + effrfss = self.lower_hybrid.cullhy() + effrfssfix = effrfss * current_drive_variables.feffcd + eta_cd_hcd_secondary = effrfssfix + # Culham ECCD model + elif current_drive_variables.i_hcd_secondary == 7: + effrfss = self.electron_cyclotron.culecd() + effrfssfix = effrfss * current_drive_variables.feffcd + eta_cd_hcd_secondary = effrfssfix + # Culham Neutral Beam model + elif current_drive_variables.i_hcd_secondary == 8: + ( + effnbss, + current_drive_variables.f_p_beam_injected_ions, + current_drive_variables.f_p_beam_shine_through, + ) = self.neutral_beam.culnbi() + effnbssfix = effnbss * current_drive_variables.feffcd + eta_cd_hcd_secondary = effnbssfix + # ECRH user input gamma + elif current_drive_variables.i_hcd_secondary == 10: + # Normalised current drive efficiency gamma + current_drive_variables.eta_cd_norm_hcd_secondary = ( + current_drive_variables.eta_cd_norm_ecrh ) - if (current_drive_variables.i_hcd_primary == 5) or ( - current_drive_variables.i_hcd_primary == 8 - ): - po.ovarre( - self.outfile, "Beam efficiency (A/W)", "(effnbss)", effnbss, "OP " + # Absolute current drive efficiency + effrfssfix = current_drive_variables.eta_cd_norm_hcd_secondary / ( + dene20 * physics_variables.rmajor ) + eta_cd_hcd_secondary = effrfssfix + # EBW scaling + elif current_drive_variables.i_hcd_secondary == 12: + # Scaling author Simon Freethy + # Ref : PROCESS issue 1262 + # Normalised current drive efficiency gamma + current_drive_variables.eta_cd_norm_hcd_secondary = ( + current_drive_variables.xi_ebw / 32.7e0 + ) * physics_variables.te - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.ovarre( - self.outfile, - "Secondary fixed beam efficiency (A/W)", - "(effnbssfix)", - effnbssfix, - "OP ", + # Absolute current drive efficiency + effrfssfix = current_drive_variables.eta_cd_norm_hcd_secondary / ( + dene20 * physics_variables.rmajor ) + eta_cd_hcd_secondary = effrfssfix - po.ovarre( - self.outfile, "Beam gamma (10^20 A/W-m2)", "(gamnb)", gamnb, "OP " - ) - po.ovarre( - self.outfile, - "Neutral beam wall plug efficiency", - "(eta_beam_injector_wall_plug)", - current_drive_variables.eta_beam_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "Beam decay lengths to centre", - "(n_beam_decay_lengths_core)", - current_drive_variables.n_beam_decay_lengths_core, - "OP ", - ) - po.ovarre( - self.outfile, - "Beam shine-through fraction", - "(f_p_beam_shine_through)", - current_drive_variables.f_p_beam_shine_through, - "OP ", - ) - po.ovarre( - self.outfile, - "Neutral beam wall plug power (MW)", - "(pwpnb)", - current_drive_variables.pwpnb, - "OP ", - ) + # EBWs can only couple to plasma if cyclotron harmonic is above plasma density cut-off; + # this behaviour is captured in the following function (ref issue #1262): + # current_drive_variables.n_ecrh_harmonic = cyclotron harmonic number (fundamental used as default) + # constant 'a' controls sharpness of transition + a = 0.1e0 - po.oblnkl(self.outfile) - po.ocmmnt(self.outfile, "Neutral beam power balance :") - po.ocmmnt(self.outfile, "----------------------------") - if (current_drive_variables.i_hcd_primary == 5) or ( - current_drive_variables.i_hcd_primary == 8 - ): - po.ovarrf( - self.outfile, - "Beam first orbit loss power (MW)", - "(p_beam_orbit_loss_mw)", - current_drive_variables.p_beam_orbit_loss_mw, - "OP ", + fc = ( + 1.0e0 + / (2.0e0 * np.pi) + * current_drive_variables.n_ecrh_harmonic + * constants.electron_charge + * physics_variables.bt + / constants.electron_mass ) - po.ovarrf( - self.outfile, - "Beam shine-through power [MW]", - "(p_beam_shine_through_mw)", - current_drive_variables.p_beam_shine_through_mw, - "OP ", + fp = ( + 1.0e0 + / (2.0e0 * np.pi) + * np.sqrt( + physics_variables.dene + * constants.electron_charge**2 + / (constants.electron_mass * constants.epsilon0) + ) ) - po.ovarrf( - self.outfile, - "Beam power deposited in plasma (MW)", - "(p_hcd_injected_total_mw)", - pinjmw1, - "OP ", + + density_factor = 0.5e0 * ( + 1.0e0 + np.tanh((2.0e0 / a) * ((fp - fc) / fp - a)) ) - po.ovarrf( - self.outfile, - "Maximum allowable beam power (MW)", - "(p_hcd_injected_max)", - current_drive_variables.p_hcd_injected_max, + + eta_cd_hcd_secondary = eta_cd_hcd_secondary * density_factor + effrfssfix = effrfssfix * density_factor + elif current_drive_variables.i_hcd_secondary == 13: + # ECCD model for O-mode cut-off with added Te and Zeff dependance + # Scaling author: Simon Freethy + # Ref : PROCESS issue #2994 + + fc = ( + 1 + / (2 * np.pi) + * constants.electron_charge + * physics_variables.bt + / constants.electron_mass ) - po.ovarrf( - self.outfile, - "Total (MW)", - "(current_drive_variables.p_beam_orbit_loss_mw+current_drive_variables.p_beam_shine_through_mw+current_drive_variables.p_hcd_injected_total_mw)", - current_drive_variables.p_beam_orbit_loss_mw - + current_drive_variables.p_beam_shine_through_mw - + pinjmw1, + fp = ( + 1 + / (2 * np.pi) + * np.sqrt( + (physics_variables.dene / 1.0e19) + * constants.electron_charge**2 + / (constants.electron_mass * constants.epsilon0) + ) ) - po.oblnkl(self.outfile) - po.ovarrf( - self.outfile, - "Beam power entering vacuum vessel (MW)", - "(p_beam_injected_mw)", - current_drive_variables.p_beam_injected_mw, - "OP ", + + xi_CD = 0.18e0 # This is tuned to the results of a GRAY study + xi_CD = xi_CD * ( + 4.8e0 / (2 + physics_variables.zeff) + ) # Zeff correction + effrfssfix = ( + xi_CD + * physics_variables.te + / ( + 3.27e0 + * physics_variables.rmajor + * (physics_variables.dene / 1.0e19) + ) ) - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.oblnkl(self.outfile) - po.ocmmnt(self.outfile, "Secondary fixed neutral beam power balance :") - po.ocmmnt(self.outfile, "----------------------------") - po.ovarrf( - self.outfile, - "Secondary fixed beam first orbit loss power (MW)", - "(porbitlossmwfix)", - porbitlossmwfix, - "OP ", + # O-mode case + if current_drive_variables.i_ecrh_wave_mode == 0: + f_cutoff = fp + + # X-mode case + elif current_drive_variables.i_ecrh_wave_mode == 1: + f_cutoff = 0.5 * ( + fc + + np.sqrt( + current_drive_variables.n_ecrh_harmonic * fc**2 + 4 * fp**2 + ) + ) + + # Plasma coupling only occurs if the plasma cut-off is below the cyclotron harmonic + a = 0.1 # This controls how sharply the transition is reached + cutoff_factor = 0.5 * ( + 1 + + np.tanh( + (2 / (a)) + * ( + (current_drive_variables.n_ecrh_harmonic * fc - f_cutoff) + / fp + - a + ) + ) ) - po.ovarrf( - self.outfile, - "Secondary fixed beam shine-through power [MW]", - "(nbshinemwfix)", - nbshinemwfix, - "OP ", + eta_cd_hcd_secondary = effrfssfix * cutoff_factor + elif current_drive_variables.i_hcd_secondary != 0: + raise ProcessValueError( + f"Current drive switch is invalid: {current_drive_variables.i_hcd_secondary = }" ) - po.ovarrf( - self.outfile, - "Secondary fixed beam power deposited in plasma (MW)", - "(pinjmwfix)", - pinjmwfix, - "OP ", + + if current_drive_variables.i_hcd_secondary in [1, 2, 4, 6]: + # Injected power + pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw + + # Wall plug power + heat_transport_variables.pinjwpfix = ( + current_drive_variables.p_hcd_secondary_injected_mw + / current_drive_variables.eta_lowhyb_injector_wall_plug ) - po.ovarrf( - self.outfile, - "Maximum allowable beam power (MW)", - "(p_hcd_injected_max)", - current_drive_variables.p_hcd_injected_max, + + # Wall plug to injector efficiency + current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( + current_drive_variables.eta_lowhyb_injector_wall_plug ) - po.ovarrf( - self.outfile, - "Secondary fixed total (MW)", - "(porbitlossmwfixed+nbshinemwfix+pinjmwfix)", - porbitlossmwfix + nbshinemwfix + pinjmwfix, + + # Normalised current drive efficiency gamma + gamcdfix = effrfssfix * (dene20 * physics_variables.rmajor) + + # the fixed auxiliary current + auxiliary_cdfix = ( + effrfssfix + * ( + current_drive_variables.p_hcd_secondary_injected_mw + - current_drive_variables.p_hcd_secondary_extra_heat_mw + ) + * 1.0e6 ) - po.oblnkl(self.outfile) - po.ovarrf( - self.outfile, - "Secondary beam power entering vacuum vessel (MW)", - "(pnbitotfix)", - pnbitotfix, - "OP ", + aux_current_fraction_fix = ( + auxiliary_cdfix / physics_variables.plasma_current ) + elif current_drive_variables.i_hcd_secondary in [3, 7, 10, 12, 13]: + # Injected power + pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw - po.oblnkl(self.outfile) + # Wall plug power + heat_transport_variables.pinjwpfix = ( + current_drive_variables.p_hcd_secondary_injected_mw + / current_drive_variables.eta_ecrh_injector_wall_plug + ) - po.ovarre( - self.outfile, - "Fraction of beam energy to ions", - "(f_p_beam_injected_ions)", - current_drive_variables.f_p_beam_injected_ions, - "OP ", - ) - po.ovarre( - self.outfile, - "Beam duct shielding thickness (m)", - "(dx_beam_shield)", - current_drive_variables.dx_beam_shield, - ) - po.ovarre( - self.outfile, - "Beam tangency radius / Plasma major radius", - "(frbeam)", - current_drive_variables.frbeam, - ) - po.ovarre( - self.outfile, - "Beam centreline tangency radius (m)", - "(rtanbeam)", - current_drive_variables.rtanbeam, - "OP ", - ) - po.ovarre( - self.outfile, - "Maximum possible tangency radius (m)", - "(rtanmax)", - current_drive_variables.rtanmax, - "OP ", - ) + # Wall plug to injector efficiency + current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( + current_drive_variables.eta_ecrh_injector_wall_plug + ) - if abs(current_drive_variables.p_ecrh_injected_mw) > 1.0e-8: - po.ovarre( - self.outfile, - "Electron cyclotron injected power (MW)", - "(p_ecrh_injected_mw)", - current_drive_variables.p_ecrh_injected_mw, - "OP ", - ) - po.ovarrf( - self.outfile, - "Maximum allowable ECRH power (MW)", - "(p_hcd_injected_max)", - current_drive_variables.p_hcd_injected_max, - ) - po.ovarre( - self.outfile, - "ECH wall plug efficiency", - "(eta_ecrh_injector_wall_plug)", - current_drive_variables.eta_ecrh_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "ECH wall plug power (MW)", - "(echwpow)", - current_drive_variables.echwpow, - "OP ", - ) + # the fixed auxiliary current + auxiliary_cdfix = ( + effrfssfix + * ( + current_drive_variables.p_hcd_secondary_injected_mw + - current_drive_variables.p_hcd_secondary_extra_heat_mw + ) + * 1.0e6 + ) + aux_current_fraction_fix = ( + auxiliary_cdfix / physics_variables.plasma_current + ) + elif current_drive_variables.i_hcd_secondary in [5, 8]: + # Account for first orbit losses + # (power due to particles that are ionised but not thermalised) [MW]: + # This includes a second order term in shinethrough*(first orbit loss) + current_drive_variables.f_p_beam_orbit_loss = min( + 0.999, current_drive_variables.f_p_beam_orbit_loss + ) # Should never be needed - if abs(current_drive_variables.p_hcd_secondary_injected_mw) > 1.0e-8: - po.ovarrf( - self.outfile, - "Fixed ECRH power (MW)", - "(pinjmwfix)", - current_drive_variables.pinjmwfix, - ) - po.ovarre( - self.outfile, - "ECH wall plug efficiency", - "(eta_ecrh_injector_wall_plug)", - current_drive_variables.eta_ecrh_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "Secondary fixed ECH wall plug power (MW)", - "(pinjwpfix)", - current_drive_variables.pinjwpfix, - "OP ", - ) + pnbitotfix = current_drive_variables.p_hcd_secondary_injected_mw / ( + 1.0e0 + - current_drive_variables.f_p_beam_orbit_loss + + current_drive_variables.f_p_beam_orbit_loss + * current_drive_variables.f_p_beam_shine_through + ) - def iternb(self): - """Routine to calculate ITER Neutral Beam current drive parameters - author: P J Knight, CCFE, Culham Science Centre - effnbss : output real : neutral beam current drive efficiency (A/W) - f_p_beam_injected_ions : output real : fraction of NB power given to ions - fshine : output real : shine-through fraction of beam - This routine calculates the current drive parameters for a - neutral beam system, based on the 1990 ITER model. - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, - ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 - """ - # Check argument sanity - if (1 + physics_variables.eps) < current_drive_variables.frbeam: - raise ProcessValueError( - "Imminent negative square root argument; NBI will miss plasma completely", - eps=physics_variables.eps, - frbeam=current_drive_variables.frbeam, - ) + # Shinethrough power (atoms that are not ionised) [MW]: + nbshinemwfix = ( + pnbitotfix * current_drive_variables.f_p_beam_shine_through + ) - # Calculate beam path length to centre - dpath = physics_variables.rmajor * np.sqrt( - (1.0 + physics_variables.eps) ** 2 - current_drive_variables.frbeam**2 - ) + # First orbit loss + porbitlossmwfix = current_drive_variables.f_p_beam_orbit_loss * ( + pnbitotfix - nbshinemwfix + ) - # Calculate beam stopping cross-section - sigstop = self.sigbeam( - current_drive_variables.e_beam_kev / physics_variables.m_beam_amu, - physics_variables.te, - physics_variables.dene, - physics_variables.f_nd_alpha_electron, - physics_variables.rncne, - physics_variables.rnone, - physics_variables.rnfene, - ) + # Power deposited + pinjmwfix = pnbitotfix - nbshinemwfix - porbitlossmwfix + pinjimwfix = pinjmwfix * current_drive_variables.f_p_beam_injected_ions + pinjemwfix = pinjmwfix * ( + 1.0e0 - current_drive_variables.f_p_beam_injected_ions + ) - # Calculate number of decay lengths to centre - current_drive_variables.n_beam_decay_lengths_core = ( - dpath * physics_variables.dene * sigstop - ) + current_drive_variables.pwpnb = ( + pnbitotfix / current_drive_variables.eta_beam_injector_wall_plug + ) # neutral beam wall plug power + heat_transport_variables.pinjwpfix = current_drive_variables.pwpnb + current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( + current_drive_variables.eta_beam_injector_wall_plug + ) + gamnb = effnbssfix * (dene20 * physics_variables.rmajor) + gamcdfix = gamnb + beam_current_fix = ( + 1.0e-3 * (pnbitotfix * 1.0e6) / current_drive_variables.e_beam_kev + ) # Neutral beam current (A) + auxiliary_cdfix = ( + effnbssfix + * ( + current_drive_variables.p_hcd_secondary_injected_mw + - current_drive_variables.p_hcd_secondary_extra_heat_mw + ) + * 1.0e6 + ) + aux_current_fraction_fix = ( + auxiliary_cdfix / physics_variables.plasma_current + ) - # Shine-through fraction of beam - fshine = np.exp(-2.0 * dpath * physics_variables.dene * sigstop) - fshine = max(fshine, 1e-20) + # Fenstermacher Lower Hybrid model + if current_drive_variables.i_hcd_primary == 1: + effrfss = ( + (0.36e0 * (1.0e0 + (physics_variables.te / 25.0e0) ** 1.16e0)) + / (physics_variables.rmajor * dene20) + * current_drive_variables.feffcd + ) + current_drive_variables.eta_cd_hcd_primary = effrfss + # Ion-Cyclotron current drive + elif current_drive_variables.i_hcd_primary == 2: + effrfss = ( + 0.63e0 + * 0.1e0 + * physics_variables.ten + / (2.0e0 + physics_variables.zeff) + / (physics_variables.rmajor * dene20) + * current_drive_variables.feffcd + ) + current_drive_variables.eta_cd_hcd_primary = effrfss + # Fenstermacher Electron Cyclotron Resonance model + elif current_drive_variables.i_hcd_primary == 3: + effrfss = ( + 0.21e0 + * physics_variables.ten + / (physics_variables.rmajor * dene20 * physics_variables.dlamee) + * current_drive_variables.feffcd + ) + current_drive_variables.eta_cd_hcd_primary = effrfss + # Ehst Lower Hybrid / Fast Wave current drive + elif current_drive_variables.i_hcd_primary == 4: + effrfss = ( + physics_variables.te**0.77e0 + * (0.034e0 + 0.196e0 * physics_variables.beta) + / (physics_variables.rmajor * dene20) + * ( + 32.0e0 / (5.0e0 + physics_variables.zeff) + + 2.0e0 + + (12.0e0 * (6.0e0 + physics_variables.zeff)) + / (5.0e0 + physics_variables.zeff) + / (3.0e0 + physics_variables.zeff) + + 3.76e0 / physics_variables.zeff + ) + / 12.507e0 + * current_drive_variables.feffcd + ) + current_drive_variables.eta_cd_hcd_primary = effrfss + # ITER Neutral Beam current drive + elif current_drive_variables.i_hcd_primary == 5: + ( + effnbss, + current_drive_variables.f_p_beam_injected_ions, + current_drive_variables.f_p_beam_shine_through, + ) = self.neutral_beam.iternb() + effnbss = effnbss * current_drive_variables.feffcd + current_drive_variables.eta_cd_hcd_primary = effnbss + # Culham Lower Hybrid current drive model + elif current_drive_variables.i_hcd_primary == 6: + effrfss = self.lower_hybrid.cullhy() + effrfss = effrfss * current_drive_variables.feffcd + current_drive_variables.eta_cd_hcd_primary = effrfss + # Culham ECCD model + elif current_drive_variables.i_hcd_primary == 7: + effrfss = self.electron_cyclotron.culecd() + effrfss = effrfss * current_drive_variables.feffcd + current_drive_variables.eta_cd_hcd_primary = effrfss + # Culham Neutral Beam model + elif current_drive_variables.i_hcd_primary == 8: + ( + effnbss, + current_drive_variables.f_p_beam_injected_ions, + current_drive_variables.f_p_beam_shine_through, + ) = self.neutral_beam.culnbi() + effnbss = effnbss * current_drive_variables.feffcd + current_drive_variables.eta_cd_hcd_primary = effnbss + # ECRH user input gamma + elif current_drive_variables.i_hcd_primary == 10: + current_drive_variables.eta_cd_norm_hcd_primary = ( + current_drive_variables.eta_cd_norm_ecrh + ) - # Deuterium and tritium beam densities - dend = physics_variables.nd_fuel_ions * ( - 1.0 - current_drive_variables.f_beam_tritium - ) - dent = physics_variables.nd_fuel_ions * current_drive_variables.f_beam_tritium + # Absolute current drive efficiency + effrfss = current_drive_variables.eta_cd_norm_hcd_primary / ( + dene20 * physics_variables.rmajor + ) + current_drive_variables.eta_cd_hcd_primary = effrfss + # EBW scaling + elif current_drive_variables.i_hcd_primary == 12: + # Scaling author Simon Freethy + # Ref : PROCESS issue 1262 - # Power split to ions / electrons - f_p_beam_injected_ions = self.cfnbi( - physics_variables.m_beam_amu, - current_drive_variables.e_beam_kev, - physics_variables.ten, - physics_variables.dene, - dend, - dent, - physics_variables.zeffai, - physics_variables.dlamie, - ) + # Normalised current drive efficiency gamma + current_drive_variables.eta_cd_norm_hcd_primary = ( + current_drive_variables.xi_ebw / 32.7e0 + ) * physics_variables.te - # Current drive efficiency - effnbss = current_drive_variables.frbeam * self.etanb( - physics_variables.m_beam_amu, - physics_variables.alphan, - physics_variables.alphat, - physics_variables.aspect, - physics_variables.dene, - current_drive_variables.e_beam_kev, - physics_variables.rmajor, - physics_variables.ten, - physics_variables.zeff, - ) + # Absolute current drive efficiency + effrfss = current_drive_variables.eta_cd_norm_hcd_primary / ( + dene20 * physics_variables.rmajor + ) + current_drive_variables.eta_cd_hcd_primary = effrfss + # EBWs can only couple to plasma if cyclotron harmonic is above plasma density cut-off; + # this behaviour is captured in the following function (ref issue #1262): + # current_drive_variables.n_ecrh_harmonic = cyclotron harmonic number (fundamental used as default) + # contant 'a' controls sharpness of transition + a = 0.1e0 - return effnbss, f_p_beam_injected_ions, fshine + fc = ( + 1.0e0 + / (2.0e0 * np.pi) + * current_drive_variables.n_ecrh_harmonic + * constants.electron_charge + * physics_variables.bt + / constants.electron_mass + ) + fp = ( + 1.0e0 + / (2.0e0 * np.pi) + * np.sqrt( + physics_variables.dene + * constants.electron_charge**2 + / (constants.electron_mass * constants.epsilon0) + ) + ) - def cullhy(self): - """Routine to calculate Lower Hybrid current drive efficiency - author: P J Knight, CCFE, Culham Science Centre - effrfss : output real : lower hybrid current drive efficiency (A/W) - This routine calculates the current drive parameters for a - lower hybrid system, based on the AEA FUS 172 model. - AEA FUS 172: Physics Assessment for the European Reactor Study - """ - rratio = self.lhrad() - rpenet = rratio * physics_variables.rminor + density_factor = 0.5e0 * ( + 1.0e0 + np.tanh((2.0e0 / a) * ((fp - fc) / fp - a)) + ) - # Local density, temperature, toroidal field at this minor radius + current_drive_variables.eta_cd_hcd_primary = ( + current_drive_variables.eta_cd_hcd_primary * density_factor + ) + effrfss = effrfss * density_factor - dlocal = 1.0e-19 * self.plasma_profile.neprofile.calculate_profile_y( - rratio, - physics_variables.rhopedn, - physics_variables.ne0, - physics_variables.neped, - physics_variables.nesep, - physics_variables.alphan, - ) - tlocal = self.plasma_profile.teprofile.calculate_profile_y( - rratio, - physics_variables.rhopedt, - physics_variables.te0, - physics_variables.teped, - physics_variables.tesep, - physics_variables.alphat, - physics_variables.tbeta, - ) - blocal = ( - physics_variables.bt - * physics_variables.rmajor - / (physics_variables.rmajor - rpenet) - ) # Calculated on inboard side + elif current_drive_variables.i_hcd_primary == 13: + # ECCD model for O-mode cut-off with added Te and Zeff dependance + # Scaling author: Simon Freethy + # Ref : PROCESS issue #2994 - # Parallel refractive index needed for plasma access + fc = ( + 1 + / (2 * np.pi) + * constants.electron_charge + * physics_variables.bt + / constants.electron_mass + ) + fp = ( + 1 + / (2 * np.pi) + * np.sqrt( + (physics_variables.dene / 1.0e19) + * constants.electron_charge**2 + / (constants.electron_mass * constants.epsilon0) + ) + ) - frac = np.sqrt(dlocal) / blocal - nplacc = frac + np.sqrt(1.0e0 + frac * frac) + xi_CD = 0.18e0 # This is tuned to the results of a GRAY study + xi_CD = xi_CD * ( + 4.8e0 / (2 + physics_variables.zeff) + ) # Zeff correction + effrfss = ( + xi_CD + * physics_variables.te + / ( + 3.27e0 + * physics_variables.rmajor + * (physics_variables.dene / 1.0e19) + ) + ) - # Local inverse aspect ratio + # O-mode case + if current_drive_variables.i_ecrh_wave_mode == 0: + f_cutoff = fp - epslh = rpenet / physics_variables.rmajor + # X-mode case + elif current_drive_variables.i_ecrh_wave_mode == 1: + f_cutoff = 0.5 * ( + fc + + np.sqrt( + current_drive_variables.n_ecrh_harmonic * fc**2 + 4 * fp**2 + ) + ) - # LH normalised efficiency (A/W m**-2) + # Plasma coupling only occurs if the plasma cut-off is below the cyclotron harmonic + a = 0.1 # This controls how sharply the transition is reached + cutoff_factor = 0.5 * ( + 1 + + np.tanh( + (2 / (a)) + * ( + (current_drive_variables.n_ecrh_harmonic * fc - f_cutoff) + / fp + - a + ) + ) + ) + current_drive_variables.eta_cd_hcd_primary = effrfss * cutoff_factor + else: + raise ProcessValueError( + f"Current drive switch is invalid: {current_drive_variables.i_hcd_primary = }" + ) - x = 24.0e0 / (nplacc * np.sqrt(tlocal)) + # Compute current drive wall plug and injected powers (MW) and efficiencies + auxiliary_cd = ( + physics_variables.aux_current_fraction + * physics_variables.plasma_current + ) - term01 = 6.1e0 / (nplacc * nplacc * (physics_variables.zeff + 5.0e0)) - term02 = 1.0e0 + (tlocal / 25.0e0) ** 1.16e0 - term03 = epslh**0.77e0 * np.sqrt(12.25e0 + x * x) - term04 = 3.5e0 * epslh**0.77e0 + x + # LHCD or ICCD + if current_drive_variables.i_hcd_primary in [1, 2, 4, 6]: + # Injected power + current_drive_variables.plhybd = ( + 1.0e-6 + * ( + physics_variables.aux_current_fraction + - aux_current_fraction_fix + ) + * physics_variables.plasma_current + / effrfss + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + pinjimw1 = 0.0e0 + pinjemw1 = current_drive_variables.plhybd - if term03 > term04: - raise ProcessValueError( - "Normalised LH efficiency < 0; use a different value of iefrf", - term03=term03, - term04=term04, - ) + # Wall plug power + current_drive_variables.pwplh = ( + current_drive_variables.plhybd + / current_drive_variables.eta_lowhyb_injector_wall_plug + ) + pinjwp1 = current_drive_variables.pwplh - gamlh = term01 * term02 * (1.0e0 - term03 / term04) + # Wall plug to injector efficiency + current_drive_variables.eta_hcd_primary_injector_wall_plug = ( + current_drive_variables.eta_lowhyb_injector_wall_plug + ) - # Current drive efficiency (A/W) + # Normalised current drive efficiency gamma + gamrf = effrfss * (dene20 * physics_variables.rmajor) + current_drive_variables.eta_cd_norm_hcd_primary = gamrf + # ECCD + elif current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: + # Injected power (set to close to close the Steady-state current equilibrium) + current_drive_variables.p_ecrh_injected_mw = ( + 1.0e-6 + * ( + physics_variables.aux_current_fraction + - aux_current_fraction_fix + ) + * physics_variables.plasma_current + / effrfss + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + pinjemw1 = current_drive_variables.p_ecrh_injected_mw - return gamlh / ((0.1e0 * dlocal) * physics_variables.rmajor) + # Wall plug power + current_drive_variables.echwpow = ( + current_drive_variables.p_ecrh_injected_mw + / current_drive_variables.eta_ecrh_injector_wall_plug + ) - def culecd(self): - """Routine to calculate Electron Cyclotron current drive efficiency - author: M R O'Brien, CCFE, Culham Science Centre - author: P J Knight, CCFE, Culham Science Centre - effrfss : output real : electron cyclotron current drive efficiency (A/W) - This routine calculates the current drive parameters for a - electron cyclotron system, based on the AEA FUS 172 model. - AEA FUS 172: Physics Assessment for the European Reactor Study - """ - rrr = 1.0e0 / 3.0e0 + # Wall plug to injector efficiency + pinjwp1 = current_drive_variables.echwpow + current_drive_variables.eta_hcd_primary_injector_wall_plug = ( + current_drive_variables.eta_ecrh_injector_wall_plug + ) + elif current_drive_variables.i_hcd_primary in [5, 8]: + # MDK. See Gitlab issue #248, and scanned note. + power1 = ( + 1.0e-6 + * ( + physics_variables.aux_current_fraction + - aux_current_fraction_fix + ) + * physics_variables.plasma_current + / effnbss + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) - # Temperature - tlocal = self.plasma_profile.teprofile.calculate_profile_y( - rrr, - physics_variables.rhopedt, - physics_variables.te0, - physics_variables.teped, - physics_variables.tesep, - physics_variables.alphat, - physics_variables.tbeta, - ) + # Account for first orbit losses + # (power due to particles that are ionised but not thermalised) [MW]: + # This includes a second order term in shinethrough*(first orbit loss) + current_drive_variables.f_p_beam_orbit_loss = min( + 0.999, current_drive_variables.f_p_beam_orbit_loss + ) # Should never be needed - # Density (10**20 m**-3) - dlocal = 1.0e-20 * self.plasma_profile.neprofile.calculate_profile_y( - rrr, - physics_variables.rhopedn, - physics_variables.ne0, - physics_variables.neped, - physics_variables.nesep, - physics_variables.alphan, - ) + current_drive_variables.p_beam_injected_mw = power1 / ( + 1.0e0 + - current_drive_variables.f_p_beam_orbit_loss + + current_drive_variables.f_p_beam_orbit_loss + * current_drive_variables.f_p_beam_shine_through + ) - # Inverse aspect ratio - epsloc = rrr * physics_variables.rminor / physics_variables.rmajor + # Shinethrough power (atoms that are not ionised) [MW]: + current_drive_variables.p_beam_shine_through_mw = ( + current_drive_variables.p_beam_injected_mw + * current_drive_variables.f_p_beam_shine_through + ) - # Effective charge (use average value) - zlocal = physics_variables.zeff + # First orbit loss + current_drive_variables.p_beam_orbit_loss_mw = ( + current_drive_variables.f_p_beam_orbit_loss + * ( + current_drive_variables.p_beam_injected_mw + - current_drive_variables.p_beam_shine_through_mw + ) + ) - # Coulomb logarithm for ion-electron collisions - # (From J. A. Wesson, 'Tokamaks', Clarendon Press, Oxford, p.293) - coulog = 15.2e0 - 0.5e0 * np.log(dlocal) + np.log(tlocal) + # Power deposited + pinjmw1 = ( + current_drive_variables.p_beam_injected_mw + - current_drive_variables.p_beam_shine_through_mw + - current_drive_variables.p_beam_orbit_loss_mw + ) + pinjimw1 = pinjmw1 * current_drive_variables.f_p_beam_injected_ions + pinjemw1 = pinjmw1 * ( + 1.0e0 - current_drive_variables.f_p_beam_injected_ions + ) - # Calculate normalised current drive efficiency at four different - # poloidal angles, and average. - # cosang = cosine of the poloidal angle at which ECCD takes place - # = +1 outside, -1 inside. - cosang = 1.0e0 - ecgam1 = self.eccdef(tlocal, epsloc, zlocal, cosang, coulog) - cosang = 0.5e0 - ecgam2 = self.eccdef(tlocal, epsloc, zlocal, cosang, coulog) - cosang = -0.5e0 - ecgam3 = self.eccdef(tlocal, epsloc, zlocal, cosang, coulog) - cosang = -1.0e0 - ecgam4 = self.eccdef(tlocal, epsloc, zlocal, cosang, coulog) + current_drive_variables.pwpnb = ( + current_drive_variables.p_beam_injected_mw + / current_drive_variables.eta_beam_injector_wall_plug + ) # neutral beam wall plug power + pinjwp1 = current_drive_variables.pwpnb + current_drive_variables.eta_hcd_primary_injector_wall_plug = ( + current_drive_variables.eta_beam_injector_wall_plug + ) + gamnb = effnbss * (dene20 * physics_variables.rmajor) + current_drive_variables.eta_cd_norm_hcd_primary = gamnb + current_drive_variables.c_beam_total = ( + 1.0e-3 + * (current_drive_variables.p_beam_injected_mw * 1.0e6) + / current_drive_variables.e_beam_kev + ) # Neutral beam current (A) - # Normalised current drive efficiency (A/W m**-2) - ecgam = 0.25e0 * (ecgam1 + ecgam2 + ecgam3 + ecgam4) + # Total injected power + # sum contributions from primary and secondary systems + current_drive_variables.p_hcd_injected_total_mw = ( + pinjemw1 + pinjimw1 + pinjemwfix + pinjimwfix + ) + pinjmw1 = pinjemw1 + pinjimw1 + pinjmwfix = pinjemwfix + pinjimwfix + current_drive_variables.p_hcd_injected_electrons_mw = pinjemw1 + pinjemwfix + current_drive_variables.p_hcd_injected_ions_mw = pinjimw1 + pinjimwfix + heat_transport_variables.pinjwp = ( + pinjwp1 + heat_transport_variables.pinjwpfix + ) - # Current drive efficiency (A/W) - return ecgam / (dlocal * physics_variables.rmajor) + # Reset injected power to zero for ignited plasma (fudge) + if physics_variables.ignite == 1: + heat_transport_variables.pinjwp = 0.0e0 - def eccdef(self, tlocal, epsloc, zlocal, cosang, coulog): - """Routine to calculate Electron Cyclotron current drive efficiency - author: M R O'Brien, CCFE, Culham Science Centre - author: P J Knight, CCFE, Culham Science Centre - tlocal : input real : local electron temperature (keV) - epsloc : input real : local inverse aspect ratio - zlocal : input real : local plasma effective charge - cosang : input real : cosine of the poloidal angle at which ECCD takes - place (+1 outside, -1 inside) - coulog : input real : local coulomb logarithm for ion-electron collisions - ecgam : output real : normalised current drive efficiency (A/W m**-2) - This routine calculates the current drive parameters for a - electron cyclotron system, based on the AEA FUS 172 model. - It works out the ECCD efficiency using the formula due to Cohen - quoted in the ITER Physics Design Guidelines : 1989 - (but including division by the Coulomb Logarithm omitted from - IPDG89). We have assumed gamma**2-1 << 1, where gamma is the - relativistic factor. The notation follows that in IPDG89. -

The answer ECGAM is the normalised efficiency nIR/P with n the - local density in 10**20 /m**3, I the driven current in MAmps, - R the major radius in metres, and P the absorbed power in MWatts. - AEA FUS 172: Physics Assessment for the European Reactor Study - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, - ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 - """ - mcsq = ( - constants.electron_mass * 2.9979e8**2 / (1.0e3 * constants.electron_volt) - ) # keV - f = 16.0e0 * (tlocal / mcsq) ** 2 + # Ratio of fusion to input (injection+ohmic) power + if ( + abs( + current_drive_variables.p_hcd_injected_total_mw + + current_drive_variables.p_beam_orbit_loss_mw + + physics_variables.p_plasma_ohmic_mw + ) + < 1.0e-6 + ): + current_drive_variables.bigq = 1.0e18 + else: + current_drive_variables.bigq = physics_variables.fusion_power / ( + current_drive_variables.p_hcd_injected_total_mw + + current_drive_variables.p_beam_orbit_loss_mw + + physics_variables.p_plasma_ohmic_mw + ) - # fp is the derivative of f with respect to gamma, the relativistic - # factor, taken equal to 1 + 2T/(m c**2) + if not output: + return - fp = 16.0e0 * tlocal / mcsq + po.oheadr(self.outfile, "Current Drive System") - # lam is IPDG89's lambda. LEGEND calculates the Legendre function of - # order alpha and argument lam, palpha, and its derivative, palphap. - # Here alpha satisfies alpha(alpha+1) = -8/(1+zlocal). alpha is of the - # form (-1/2 + ix), with x a real number and i = sqrt(-1). + if current_drive_variables.i_hcd_calculations == 0: + po.ocmmnt(self.outfile, "No current drive used") + po.oblnkl(self.outfile) + return - lam = 1.0e0 - palpha, palphap = self.legend(zlocal, lam) + if current_drive_variables.i_hcd_primary in [1, 4, 6]: + po.ocmmnt(self.outfile, "Lower Hybrid Current Drive") + elif current_drive_variables.i_hcd_primary == 2: + po.ocmmnt(self.outfile, "Ion Cyclotron Current Drive") + elif current_drive_variables.i_hcd_primary in [3, 7]: + po.ocmmnt(self.outfile, "Electron Cyclotron Current Drive") + elif current_drive_variables.i_hcd_primary in [5, 8]: + po.ocmmnt(self.outfile, "Neutral Beam Current Drive") + elif current_drive_variables.i_hcd_primary == 10: + po.ocmmnt( + self.outfile, "Electron Cyclotron Current Drive (user input gamma_CD)" + ) + elif current_drive_variables.i_hcd_primary == 12: + po.ocmmnt(self.outfile, "EBW current drive") + elif current_drive_variables.i_hcd_primary == 13: + po.ocmmnt( + self.outfile, + "Electron Cyclotron Current Drive (O-mode cutoff with Zeff & Te)", + ) - lams = np.sqrt(2.0e0 * epsloc / (1.0e0 + epsloc)) - palphas, _ = self.legend(zlocal, lams) + po.ovarin( + self.outfile, + "Current drive efficiency model", + "(i_hcd_primary)", + current_drive_variables.i_hcd_primary, + ) - # hp is the derivative of IPDG89's h function with respect to lam + if current_drive_variables.i_hcd_secondary in [1, 4, 6]: + po.ocmmnt(self.outfile, "Lower Hybrid Current Drive") + elif current_drive_variables.i_hcd_secondary == 2: + po.ocmmnt(self.outfile, "Ion Cyclotron Current Drive") + elif current_drive_variables.i_hcd_secondary in [3, 7]: + po.ocmmnt(self.outfile, "Electron Cyclotron Current Drive") + elif current_drive_variables.i_hcd_secondary in [5, 8]: + po.ocmmnt(self.outfile, "Neutral Beam Current Drive") + elif current_drive_variables.i_hcd_secondary == 10: + po.ocmmnt( + self.outfile, "Electron Cyclotron Current Drive (user input gamma_CD)" + ) + elif current_drive_variables.i_hcd_secondary == 12: + po.ocmmnt(self.outfile, "EBW current drive") + elif current_drive_variables.i_hcd_secondary == 13: + po.ocmmnt( + self.outfile, + "Electron Cyclotron Current Drive (O-mode cutoff with Zeff & Te)", + ) - h = -4.0e0 * lam / (zlocal + 5.0e0) * (1.0e0 - lams * palpha / (lam * palphas)) - hp = -4.0e0 / (zlocal + 5.0e0) * (1.0e0 - lams * palphap / palphas) + po.ovarin( + self.outfile, + "Secondary current drive efficiency model", + "(i_hcd_secondary)", + current_drive_variables.i_hcd_secondary, + ) - # facm is IPDG89's momentum conserving factor + if physics_variables.ignite == 1: + po.ocmmnt( + self.outfile, + "Ignited plasma; injected power only used for start-up phase", + ) - facm = 1.5e0 - y = mcsq / (2.0e0 * tlocal) * (1.0e0 + epsloc * cosang) + po.oblnkl(self.outfile) - # We take the negative of the IPDG89 expression to get a positive - # number + if abs(physics_variables.inductive_current_fraction) > 1.0e-8: + po.ocmmnt(self.outfile, "Current is driven by both inductive") + po.ocmmnt(self.outfile, "and non-inductive means.") - ecgam = ( - -7.8e0 - * facm - * np.sqrt((1.0e0 + epsloc) / (1.0e0 - epsloc)) - / coulog - * (h * fp - 0.5e0 * y * f * hp) + po.ovarre( + self.outfile, + "Ratio of power for flat-top to start-up (MW)", + "(startupratio)", + cost_variables.startupratio, + ) + po.ovarre( + self.outfile, + "Auxiliary power used for plasma heating only (MW)", + "(p_hcd_primary_extra_heat_mw)", + current_drive_variables.p_hcd_primary_extra_heat_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw, + ) + po.ovarre( + self.outfile, + "Power injected for current drive (MW)", + "(pcurrentdrivemw)", + current_drive_variables.p_hcd_injected_total_mw + - current_drive_variables.p_hcd_primary_extra_heat_mw + - current_drive_variables.p_hcd_secondary_extra_heat_mw, + ) + po.ovarre( + self.outfile, + "Maximum Allowed Bootstrap current fraction", + "(f_c_plasma_bootstrap_max)", + current_drive_variables.f_c_plasma_bootstrap_max, ) + if current_drive_variables.i_hcd_secondary != 0: + po.ovarre( + self.outfile, + "Power injected for main current drive (MW)", + "(pcurrentdrivemw1)", + pinjmw1 - current_drive_variables.p_hcd_primary_extra_heat_mw, + ) + po.ovarre( + self.outfile, + "Power injected for secondary current drive (MW)", + "(pcurrentdrivemw2)", + pinjmwfix - current_drive_variables.p_hcd_secondary_extra_heat_mw, + ) - if ecgam < 0.0e0: - raise ProcessValueError("Negative normalised current drive efficiency") - return ecgam + po.ovarre( + self.outfile, + "Fusion gain factor Q", + "(bigq)", + current_drive_variables.bigq, + "OP ", + ) + po.ovarre( + self.outfile, + "Auxiliary current drive (A)", + "(auxiliary_cd)", + auxiliary_cd, + "OP ", + ) + if current_drive_variables.i_hcd_secondary != 0: + po.ovarre( + self.outfile, + "Secondary auxiliary current drive (A)", + "(auxiliary_cdfix)", + auxiliary_cdfix, + "OP ", + ) - def culnbi(self): - """Routine to calculate Neutral Beam current drive parameters - author: P J Knight, CCFE, Culham Science Centre - effnbss : output real : neutral beam current drive efficiency (A/W) - f_p_beam_injected_ions : output real : fraction of NB power given to ions - fshine : output real : shine-through fraction of beam - This routine calculates Neutral Beam current drive parameters - using the corrections outlined in AEA FUS 172 to the ITER method. -

The result cannot be guaranteed for devices with aspect ratios far - from that of ITER (approx. 2.8). - AEA FUS 172: Physics Assessment for the European Reactor Study - """ - if (1.0e0 + physics_variables.eps) < current_drive_variables.frbeam: - raise ProcessValueError( - "Imminent negative square root argument; NBI will miss plasma completely", - eps=physics_variables.eps, - frbeam=current_drive_variables.frbeam, + po.ovarre( + self.outfile, + "Current drive efficiency (A/W)", + "(eta_cd_hcd_primary)", + current_drive_variables.eta_cd_hcd_primary, + "OP ", + ) + po.ovarre( + self.outfile, + "Normalised current drive efficiency of primary HCD system (10^20 A / W m^2)", + "(eta_cd_norm_hcd_primary)", + current_drive_variables.eta_cd_norm_hcd_primary, + "OP ", + ) + po.ovarre( + self.outfile, + "Wall plug to injector efficiency", + "(eta_hcd_primary_injector_wall_plug)", + current_drive_variables.eta_hcd_primary_injector_wall_plug, + ) + + if current_drive_variables.i_hcd_primary == 10: + po.ovarre( + self.outfile, + "ECRH plasma heating efficiency", + "(eta_cd_norm_ecrh)", + current_drive_variables.eta_cd_norm_ecrh, + ) + if current_drive_variables.i_hcd_primary == 12: + po.ovarre( + self.outfile, + "EBW plasma heating efficiency", + "(xi_ebw)", + current_drive_variables.xi_ebw, + ) + if current_drive_variables.i_hcd_primary in [12, 13]: + po.ovarre( + self.outfile, + "EC harmonic number", + "(n_ecrh_harmonic)", + current_drive_variables.n_ecrh_harmonic, + ) + if current_drive_variables.i_hcd_primary == 13: + po.ovarin( + self.outfile, + "EC cutoff wave mode switch", + "(i_ecrh_wave_mode)", + current_drive_variables.i_ecrh_wave_mode, ) - # Calculate beam path length to centre + if current_drive_variables.i_hcd_secondary != 0: + po.ovarre( + self.outfile, + "Secondary current drive efficiency (A/W)", + "(eta_cd_hcd_secondary)", + eta_cd_hcd_secondary, + "OP ", + ) + po.ovarre( + self.outfile, + "Seconday wall plug to injector efficiency", + "(eta_hcd_secondary_injector_wall_plug)", + current_drive_variables.eta_hcd_secondary_injector_wall_plug, + ) + po.ovarre( + self.outfile, + "Normalised secondary current drive efficiency, gamma (10^20 A/W-m2)", + "(gamcdfix)", + gamcdfix, + "OP ", + ) - dpath = physics_variables.rmajor * np.sqrt( - (1.0e0 + physics_variables.eps) ** 2 - current_drive_variables.frbeam**2 + po.osubhd(self.outfile, "Fractions of current drive :") + po.ovarrf( + self.outfile, + "Bootstrap fraction", + "(f_c_plasma_bootstrap)", + current_drive_variables.f_c_plasma_bootstrap, + "OP ", ) - - # Calculate beam stopping cross-section - - sigstop = self.sigbeam( - current_drive_variables.e_beam_kev / physics_variables.m_beam_amu, - physics_variables.te, - physics_variables.dene, - physics_variables.f_nd_alpha_electron, - physics_variables.rncne, - physics_variables.rnone, - physics_variables.rnfene, + po.ovarrf( + self.outfile, + "Diamagnetic fraction", + "(f_c_plasma_diamagnetic)", + current_drive_variables.f_c_plasma_diamagnetic, + "OP ", ) - - # Calculate number of decay lengths to centre - - current_drive_variables.n_beam_decay_lengths_core = ( - dpath * physics_variables.dnla * sigstop + po.ovarrf( + self.outfile, + "Pfirsch-Schlueter fraction", + "(f_c_plasma_pfirsch_schluter)", + current_drive_variables.f_c_plasma_pfirsch_schluter, + "OP ", ) - - # Shine-through fraction of beam - - fshine = np.exp(-2.0e0 * dpath * physics_variables.dnla * sigstop) - fshine = max(fshine, 1.0e-20) - - # Deuterium and tritium beam densities - - dend = physics_variables.nd_fuel_ions * ( - 1.0e0 - current_drive_variables.f_beam_tritium + po.ovarrf( + self.outfile, + "Auxiliary current drive fraction", + "(aux_current_fraction)", + physics_variables.aux_current_fraction, + "OP ", ) - dent = physics_variables.nd_fuel_ions * current_drive_variables.f_beam_tritium - - # Power split to ions / electrons - - f_p_beam_injected_ions = self.cfnbi( - physics_variables.m_beam_amu, - current_drive_variables.e_beam_kev, - physics_variables.ten, - physics_variables.dene, - dend, - dent, - physics_variables.zeffai, - physics_variables.dlamie, + po.ovarrf( + self.outfile, + "Inductive fraction", + "(inductive_current_fraction)", + physics_variables.inductive_current_fraction, + "OP ", ) - - # Current drive efficiency - - effnbss = self.etanb2( - physics_variables.m_beam_amu, - physics_variables.alphan, - physics_variables.alphat, - physics_variables.aspect, - physics_variables.dene, - physics_variables.dnla, - current_drive_variables.e_beam_kev, - current_drive_variables.frbeam, - fshine, - physics_variables.rmajor, - physics_variables.rminor, - physics_variables.ten, - physics_variables.zeff, + # Add total error check. + po.ovarrf( + self.outfile, + "Total", + "(f_c_plasma_internal+aux_current_fraction+inductive_current_fraction)", + current_drive_variables.f_c_plasma_internal + + physics_variables.aux_current_fraction + + physics_variables.inductive_current_fraction, ) + if ( + abs( + current_drive_variables.f_c_plasma_internal + + physics_variables.aux_current_fraction + + physics_variables.inductive_current_fraction + - 1.0e0 + ) + > 1.0e-8 + ): + po.ocmmnt(self.outfile, "ERROR: current drive fractions do not add to 1") - return effnbss, f_p_beam_injected_ions, fshine - - def lhrad(self): - """Routine to calculate Lower Hybrid wave absorption radius - author: P J Knight, CCFE, Culham Science Centre - rratio : output real : minor radius of penetration / rminor - This routine determines numerically the minor radius at which the - damping of Lower Hybrid waves occurs, using a Newton-Raphson method. - AEA FUS 172: Physics Assessment for the European Reactor Study - """ - # Correction to refractive index (kept within valid bounds) - drfind = min(0.7e0, max(0.1e0, 12.5e0 / physics_variables.te0)) - - # Use Newton-Raphson method to establish the correct minor radius - # ratio. g is calculated as a function of r / r_minor, where g is - # the difference between the results of the two formulae for the - # energy E given in AEA FUS 172, p.58. The required minor radius - # ratio has been found when g is sufficiently close to zero. - - # Initial guess for the minor radius ratio - - rat0 = 0.8e0 - - for _ in range(100): - # Minor radius ratios either side of the latest guess - - r1 = rat0 - 1.0e-3 * rat0 - r2 = rat0 + 1.0e-3 * rat0 - - # Evaluate g at rat0, r1, r2 - - g0 = self.lheval(drfind, rat0) - g1 = self.lheval(drfind, r1) - g2 = self.lheval(drfind, r2) - - # Calculate gradient of g with respect to minor radius ratio - - dgdr = (g2 - g1) / (r2 - r1) - - # New approximation - - rat1 = rat0 - g0 / dgdr - - # Force this approximation to lie within bounds - - rat1 = max(0.0001e0, rat1) - rat1 = min(0.9999e0, rat1) - - if abs(g0) <= 0.01e0: - break - rat0 = rat1 - - else: - eh.report_error(16) - rat0 = 0.8e0 - - return rat0 - - def etanb2( - self, - m_beam_amu, - alphan, - alphat, - aspect, - dene, - dnla, - e_beam_kev, - frbeam, - fshine, - rmajor, - rminor, - ten, - zeff, - ): - """Routine to find neutral beam current drive efficiency - using the ITER 1990 formulation, plus correction terms - outlined in Culham Report AEA FUS 172 - author: P J Knight, CCFE, Culham Science Centre - m_beam_amu : input real : beam ion mass (amu) - alphan : input real : density profile factor - alphat : input real : temperature profile factor - aspect : input real : aspect ratio - dene : input real : volume averaged electron density (m**-3) - dnla : input real : line averaged electron density (m**-3) - e_beam_kev : input real : neutral beam energy (keV) - frbeam : input real : R_tangent / R_major for neutral beam injection - fshine : input real : shine-through fraction of beam - rmajor : input real : plasma major radius (m) - rminor : input real : plasma minor radius (m) - ten : input real : density weighted average electron temperature (keV) - zeff : input real : plasma effective charge - This routine calculates the current drive efficiency in A/W of - a neutral beam system, based on the 1990 ITER model, - plus correction terms outlined in Culham Report AEA FUS 172. -

The formulae are from AEA FUS 172, unless denoted by IPDG89. - AEA FUS 172: Physics Assessment for the European Reactor Study - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, - ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 - """ - # Charge of beam ions - zbeam = 1.0 - - # Fitting factor (IPDG89) - bbd = 1.0 - - # Volume averaged electron density (10**20 m**-3) - dene20 = dene / 1e20 + # MDK Add physics_variables.fvsbrnni as it can be an iteration variable + po.ovarrf( + self.outfile, + "Fraction of the plasma current produced by non-inductive means", + "(fvsbrnni)", + physics_variables.fvsbrnni, + ) - # Line averaged electron density (10**20 m**-3) - dnla20 = dnla / 1e20 + if ( + abs( + current_drive_variables.f_c_plasma_bootstrap + - current_drive_variables.f_c_plasma_bootstrap_max + ) + < 1.0e-8 + ): + po.ocmmnt(self.outfile, "Warning : bootstrap current fraction is at") + po.ocmmnt(self.outfile, " its prescribed maximum.") - # Critical energy (MeV) (power to electrons = power to ions) (IPDG89) - # N.B. ten is in keV - ecrit = 0.01 * m_beam_amu * ten + po.oblnkl(self.outfile) - # Beam energy in MeV - ebmev = e_beam_kev / 1e3 + if abs(current_drive_variables.plhybd) > 1.0e-8: + po.ovarre(self.outfile, "RF efficiency (A/W)", "(effrfss)", effrfss, "OP ") + po.ovarre(self.outfile, "RF gamma (10^20 A/W-m2)", "(gamrf)", gamrf, "OP ") + po.ovarre( + self.outfile, + "Lower hybrid injected power (MW)", + "(plhybd)", + current_drive_variables.plhybd, + "OP ", + ) + po.ovarre( + self.outfile, + "Lower hybrid wall plug efficiency", + "(eta_lowhyb_injector_wall_plug)", + current_drive_variables.eta_lowhyb_injector_wall_plug, + ) + po.ovarre( + self.outfile, + "Lower hybrid wall plug power (MW)", + "(pwplh)", + current_drive_variables.pwplh, + "OP ", + ) - # x and y coefficients of function J0(x,y) (IPDG89) - xjs = ebmev / (bbd * ecrit) - xj = np.sqrt(xjs) + # MDK rearranged and added current_drive_variables.p_beam_shine_through_mw + # if (abs(current_drive_variables.pnbeam) > 1.0e-8) : + if ( + (current_drive_variables.i_hcd_primary == 5) + or (current_drive_variables.i_hcd_primary == 8) + or (current_drive_variables.i_hcd_secondary == 5) + or (current_drive_variables.i_hcd_secondary == 8) + ): + po.ovarre( + self.outfile, + "Neutral beam energy (keV)", + "(e_beam_kev)", + current_drive_variables.e_beam_kev, + ) + if (current_drive_variables.i_hcd_primary == 5) or ( + current_drive_variables.i_hcd_primary == 8 + ): + po.ovarre( + self.outfile, + "Neutral beam current (A)", + "(c_beam_total)", + current_drive_variables.c_beam_total, + "OP ", + ) - yj = 0.8 * zeff / m_beam_amu + if (current_drive_variables.i_hcd_secondary == 5) or ( + current_drive_variables.i_hcd_secondary == 8 + ): + po.ovarre( + self.outfile, + "Secondary fixed neutral beam current (A)", + "(beam_current_fix)", + beam_current_fix, + "OP ", + ) - # Fitting function J0(x,y) - j0 = xjs / (4.0 + 3.0 * yj + xjs * (xj + 1.39 + 0.61 * yj**0.7)) + if (current_drive_variables.i_hcd_primary == 5) or ( + current_drive_variables.i_hcd_primary == 8 + ): + po.ovarre( + self.outfile, "Beam efficiency (A/W)", "(effnbss)", effnbss, "OP " + ) - # Effective inverse aspect ratio, with a limit on its maximum value - epseff = min(0.2, (0.5 / aspect)) + if (current_drive_variables.i_hcd_secondary == 5) or ( + current_drive_variables.i_hcd_secondary == 8 + ): + po.ovarre( + self.outfile, + "Secondary fixed beam efficiency (A/W)", + "(effnbssfix)", + effnbssfix, + "OP ", + ) - # Reduction in the reverse electron current - # due to neoclassical effects - gfac = (1.55 + 0.85 / zeff) * np.sqrt(epseff) - (0.2 + 1.55 / zeff) * epseff + po.ovarre( + self.outfile, "Beam gamma (10^20 A/W-m2)", "(gamnb)", gamnb, "OP " + ) + po.ovarre( + self.outfile, + "Neutral beam wall plug efficiency", + "(eta_beam_injector_wall_plug)", + current_drive_variables.eta_beam_injector_wall_plug, + ) + po.ovarre( + self.outfile, + "Beam decay lengths to centre", + "(n_beam_decay_lengths_core)", + current_drive_variables.n_beam_decay_lengths_core, + "OP ", + ) + po.ovarre( + self.outfile, + "Beam shine-through fraction", + "(f_p_beam_shine_through)", + current_drive_variables.f_p_beam_shine_through, + "OP ", + ) + po.ovarre( + self.outfile, + "Neutral beam wall plug power (MW)", + "(pwpnb)", + current_drive_variables.pwpnb, + "OP ", + ) - # Reduction in the net beam driven current - # due to the reverse electron current - ffac = 1.0 - (zbeam / zeff) * (1.0 - gfac) + po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "Neutral beam power balance :") + po.ocmmnt(self.outfile, "----------------------------") + if (current_drive_variables.i_hcd_primary == 5) or ( + current_drive_variables.i_hcd_primary == 8 + ): + po.ovarrf( + self.outfile, + "Beam first orbit loss power (MW)", + "(p_beam_orbit_loss_mw)", + current_drive_variables.p_beam_orbit_loss_mw, + "OP ", + ) + po.ovarrf( + self.outfile, + "Beam shine-through power [MW]", + "(p_beam_shine_through_mw)", + current_drive_variables.p_beam_shine_through_mw, + "OP ", + ) + po.ovarrf( + self.outfile, + "Beam power deposited in plasma (MW)", + "(p_hcd_injected_total_mw)", + pinjmw1, + "OP ", + ) + po.ovarrf( + self.outfile, + "Maximum allowable beam power (MW)", + "(p_hcd_injected_max)", + current_drive_variables.p_hcd_injected_max, + ) + po.ovarrf( + self.outfile, + "Total (MW)", + "(current_drive_variables.p_beam_orbit_loss_mw+current_drive_variables.p_beam_shine_through_mw+current_drive_variables.p_hcd_injected_total_mw)", + current_drive_variables.p_beam_orbit_loss_mw + + current_drive_variables.p_beam_shine_through_mw + + pinjmw1, + ) + po.oblnkl(self.outfile) + po.ovarrf( + self.outfile, + "Beam power entering vacuum vessel (MW)", + "(p_beam_injected_mw)", + current_drive_variables.p_beam_injected_mw, + "OP ", + ) - # Normalisation to allow results to be valid for - # non-ITER plasma size and density: + if (current_drive_variables.i_hcd_secondary == 5) or ( + current_drive_variables.i_hcd_secondary == 8 + ): + po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "Secondary fixed neutral beam power balance :") + po.ocmmnt(self.outfile, "----------------------------") + po.ovarrf( + self.outfile, + "Secondary fixed beam first orbit loss power (MW)", + "(porbitlossmwfix)", + porbitlossmwfix, + "OP ", + ) + po.ovarrf( + self.outfile, + "Secondary fixed beam shine-through power [MW]", + "(nbshinemwfix)", + nbshinemwfix, + "OP ", + ) + po.ovarrf( + self.outfile, + "Secondary fixed beam power deposited in plasma (MW)", + "(pinjmwfix)", + pinjmwfix, + "OP ", + ) + po.ovarrf( + self.outfile, + "Maximum allowable beam power (MW)", + "(p_hcd_injected_max)", + current_drive_variables.p_hcd_injected_max, + ) + po.ovarrf( + self.outfile, + "Secondary fixed total (MW)", + "(porbitlossmwfixed+nbshinemwfix+pinjmwfix)", + porbitlossmwfix + nbshinemwfix + pinjmwfix, + ) + po.oblnkl(self.outfile) + po.ovarrf( + self.outfile, + "Secondary beam power entering vacuum vessel (MW)", + "(pnbitotfix)", + pnbitotfix, + "OP ", + ) - # Line averaged electron density (10**20 m**-3) normalised to ITER - nnorm = 1.0 + po.oblnkl(self.outfile) - # Distance along beam to plasma centre - r = max(rmajor, rmajor * frbeam) - eps1 = rminor / r + po.ovarre( + self.outfile, + "Fraction of beam energy to ions", + "(f_p_beam_injected_ions)", + current_drive_variables.f_p_beam_injected_ions, + "OP ", + ) + po.ovarre( + self.outfile, + "Beam duct shielding thickness (m)", + "(dx_beam_shield)", + current_drive_variables.dx_beam_shield, + ) + po.ovarre( + self.outfile, + "Beam tangency radius / Plasma major radius", + "(frbeam)", + current_drive_variables.frbeam, + ) + po.ovarre( + self.outfile, + "Beam centreline tangency radius (m)", + "(rtanbeam)", + current_drive_variables.rtanbeam, + "OP ", + ) + po.ovarre( + self.outfile, + "Maximum possible tangency radius (m)", + "(rtanmax)", + current_drive_variables.rtanmax, + "OP ", + ) - if (1.0 + eps1) < frbeam: - raise ProcessValueError( - "Imminent negative square root argument; NBI will miss plasma completely", - eps=eps1, - frbeam=frbeam, + if abs(current_drive_variables.p_ecrh_injected_mw) > 1.0e-8: + po.ovarre( + self.outfile, + "Electron cyclotron injected power (MW)", + "(p_ecrh_injected_mw)", + current_drive_variables.p_ecrh_injected_mw, + "OP ", + ) + po.ovarrf( + self.outfile, + "Maximum allowable ECRH power (MW)", + "(p_hcd_injected_max)", + current_drive_variables.p_hcd_injected_max, + ) + po.ovarre( + self.outfile, + "ECH wall plug efficiency", + "(eta_ecrh_injector_wall_plug)", + current_drive_variables.eta_ecrh_injector_wall_plug, + ) + po.ovarre( + self.outfile, + "ECH wall plug power (MW)", + "(echwpow)", + current_drive_variables.echwpow, + "OP ", ) - d = rmajor * np.sqrt((1.0 + eps1) ** 2 - frbeam**2) - - # Distance along beam to plasma centre for ITER - # assuming a tangency radius equal to the major radius - epsitr = 2.15 / 6.0 - dnorm = 6.0 * np.sqrt(2.0 * epsitr + epsitr**2) - - # Normalisation to beam energy (assumes a simplified formula for - # the beam stopping cross-section) - ebnorm = ebmev * ((nnorm * dnorm) / (dnla20 * d)) ** (1.0 / 0.78) - - # A_bd fitting coefficient, after normalisation with ebnorm - abd = ( - 0.107 - * (1.0 - 0.35 * alphan + 0.14 * alphan**2) - * (1.0 - 0.21 * alphat) - * (1.0 - 0.2 * ebnorm + 0.09 * ebnorm**2) - ) - - # Normalised current drive efficiency (A/W m**-2) (IPDG89) - gamnb = 5.0 * abd * 0.1 * ten * (1.0 - fshine) * frbeam * j0 / 0.2 * ffac - - # Current drive efficiency (A/W) - return gamnb / (dene20 * rmajor) + if abs(current_drive_variables.p_hcd_secondary_injected_mw) > 1.0e-8: + po.ovarrf( + self.outfile, + "Fixed ECRH power (MW)", + "(pinjmwfix)", + current_drive_variables.pinjmwfix, + ) + po.ovarre( + self.outfile, + "ECH wall plug efficiency", + "(eta_ecrh_injector_wall_plug)", + current_drive_variables.eta_ecrh_injector_wall_plug, + ) + po.ovarre( + self.outfile, + "Secondary fixed ECH wall plug power (MW)", + "(pinjwpfix)", + current_drive_variables.pinjwpfix, + "OP ", + ) def lheval(self, drfind, rratio): """Routine to evaluate the difference between electron energy @@ -1941,123 +2184,6 @@ def lheval(self, drfind, rratio): return e1 - e2 - def etanb(self, m_beam_amu, alphan, alphat, aspect, dene, ebeam, rmajor, ten, zeff): - """Routine to find neutral beam current drive efficiency - using the ITER 1990 formulation - author: P J Knight, CCFE, Culham Science Centre - m_beam_amu : input real : beam ion mass (amu) - alphan : input real : density profile factor - alphat : input real : temperature profile factor - aspect : input real : aspect ratio - dene : input real : volume averaged electron density (m**-3) - ebeam : input real : neutral beam energy (keV) - rmajor : input real : plasma major radius (m) - ten : input real : density weighted average electron temp. (keV) - zeff : input real : plasma effective charge - This routine calculates the current drive efficiency of - a neutral beam system, based on the 1990 ITER model. - ITER Physics Design Guidelines: 1989 [IPDG89], N. A. Uckan et al, - ITER Documentation Series No.10, IAEA/ITER/DS/10, IAEA, Vienna, 1990 - """ - - zbeam = 1.0 - bbd = 1.0 - - dene20 = 1e-20 * dene - - # Ratio of E_beam/E_crit - xjs = ebeam / (bbd * 10.0 * m_beam_amu * ten) - xj = np.sqrt(xjs) - - yj = 0.8 * zeff / m_beam_amu - - rjfunc = xjs / (4.0 + 3.0 * yj + xjs * (xj + 1.39 + 0.61 * yj**0.7)) - - epseff = 0.5 / aspect - gfac = (1.55 + 0.85 / zeff) * np.sqrt(epseff) - (0.2 + 1.55 / zeff) * epseff - ffac = 1.0 / zbeam - (1.0 - gfac) / zeff - - abd = ( - 0.107 - * (1.0 - 0.35 * alphan + 0.14 * alphan**2) - * (1.0 - 0.21 * alphat) - * (1.0 - 0.2e-3 * ebeam + 0.09e-6 * ebeam**2) - ) - - return abd * (5.0 / rmajor) * (0.1 * ten / dene20) * rjfunc / 0.2 * ffac - - def cfnbi(self, afast, efast, te, ne, _nd, _nt, zeffai, xlmbda): - """Routine to calculate the fraction of the fast particle energy - coupled to the ions - author: P J Knight, CCFE, Culham Science Centre - afast : input real : mass of fast particle (units of proton mass) - efast : input real : energy of fast particle (keV) - te : input real : density weighted average electron temp. (keV) - ne : input real : volume averaged electron density (m**-3) - nd : input real : deuterium beam density (m**-3) - nt : input real : tritium beam density (m**-3) - zeffai : input real : mass weighted plasma effective charge - xlmbda : input real : ion-electron coulomb logarithm - f_p_beam_injected_ions : output real : fraction of fast particle energy coupled to ions - This routine calculates the fast particle energy coupled to - the ions in the neutral beam system. - """ - # atmd = 2.0 - atmdt = 2.5 - # atmt = 3.0 - c = 3.0e8 - me = constants.electron_mass - # zd = 1.0 - # zt = 1.0 - - # xlbd = self.xlmbdabi(afast, atmd, efast, te, ne) - # xlbt = self.xlmbdabi(afast, atmt, efast, te, ne) - - # sum = nd * zd * zd * xlbd / atmd + nt * zt * zt * xlbt / atmt - # ecritfix = 16.0e0 * te * afast * (sum / (ne * xlmbda)) ** (2.0e0 / 3.0e0) - - xlmbdai = self.xlmbdabi(afast, atmdt, efast, te, ne) - sumln = zeffai * xlmbdai / xlmbda - xlnrat = ( - 3.0e0 * np.sqrt(np.pi) / 4.0e0 * me / constants.proton_mass * sumln - ) ** (2.0e0 / 3.0e0) - ve = c * np.sqrt(2.0e0 * te / 511.0e0) - - ecritfi = ( - afast - * constants.proton_mass - * ve - * ve - * xlnrat - / (2.0e0 * constants.electron_charge * 1.0e3) - ) - - x = np.sqrt(efast / ecritfi) - t1 = np.log((x * x - x + 1.0e0) / ((x + 1.0e0) ** 2)) - thx = (2.0e0 * x - 1.0e0) / np.sqrt(3.0e0) - t2 = 2.0e0 * np.sqrt(3.0e0) * (np.arctan(thx) + np.pi / 6.0e0) - - return (t1 + t2) / (3.0e0 * x * x) - - def xlmbdabi(self, mb, mth, eb, t, nelec): - """Calculates the Coulomb logarithm for ion-ion collisions - author: P J Knight, CCFE, Culham Science Centre - mb : input real : mass of fast particle (units of proton mass) - mth : input real : mass of background ions (units of proton mass) - eb : input real : energy of fast particle (keV) - t : input real : density weighted average electron temp. (keV) - nelec : input real : volume averaged electron density (m**-3) - This function calculates the Coulomb logarithm for ion-ion - collisions where the relative velocity may be large compared - with the background ('mt') thermal velocity. - Mikkelson and Singer, Nuc Tech/Fus, 4, 237 (1983) - """ - - x1 = (t / 10.0) * (eb / 1000.0) * mb / (nelec / 1e20) - x2 = mth / (mth + mb) - - return 23.7 + np.log(x2 * np.sqrt(x1)) - def legend(self, zlocal, arg): """Routine to calculate Legendre function and its derivative author: M R O'Brien, CCFE, Culham Science Centre @@ -2117,166 +2243,5 @@ def legend(self, zlocal, arg): palpha = palpha + pterm palphap = palphap - n * pterm / (1.0e0 - arg2) else: - raise ProcessError("legend: Solution has not converged") - - def sigbeam(self, eb, te, ne, rnhe, rnc, rno, rnfe): - """Calculates the stopping cross-section for a hydrogen - beam in a fusion plasma - author: P J Knight, CCFE, Culham Science Centre - eb : input real : beam energy (kev/amu) - te : input real : electron temperature (keV) - ne : input real : electron density (10^20m-3) - rnhe : input real : alpha density / ne - rnc : input real : carbon density /ne - rno : input real : oxygen density /ne - rnfe : input real : iron density /ne - This function calculates the stopping cross-section (m^-2) - for a hydrogen beam in a fusion plasma. - Janev, Boley and Post, Nuclear Fusion 29 (1989) 2125 - """ - a = np.array([ - [ - [4.4, -2.49e-2], - [7.46e-2, 2.27e-3], - [3.16e-3, -2.78e-5], - ], - [ - [2.3e-1, -1.15e-2], - [-2.55e-3, -6.2e-4], - [1.32e-3, 3.38e-5], - ], - ]) - - b = np.array([ - [ - [[-2.36, -1.49, -1.41, -1.03], [0.185, -0.0154, -4.08e-4, 0.106]], - [ - [-0.25, -0.119, -0.108, -0.0558], - [-0.0381, -0.015, -0.0138, -3.72e-3], - ], - ], - [ - [ - [0.849, 0.518, 0.477, 0.322], - [-0.0478, 7.18e-3, 1.57e-3, -0.0375], - ], - [ - [0.0677, 0.0292, 0.0259, 0.0124], - [0.0105, 3.66e-3, 3.33e-3, 8.61e-4], - ], - ], - [ - [ - [-0.0588, -0.0336, -0.0305, -0.0187], - [4.34e-3, 3.41e-4, 7.35e-4, 3.53e-3], - ], - [ - [-4.48e-3, -1.79e-3, -1.57e-3, -7.43e-4], - [-6.76e-4, -2.04e-4, -1.86e-4, -5.12e-5], - ], - ], - ]) - - z = np.array([2.0, 6.0, 8.0, 26.0]) - nn = np.array([rnhe, rnc, rno, rnfe]) - - nen = ne * 1e-19 - - s1 = 0.0 - for k in range(2): - for j in range(3): - for i in range(2): - s1 += ( - a[i, j, k] - * (np.log(eb)) ** i - * (np.log(nen)) ** j - * (np.log(te)) ** k - ) - - sz = 0.0 - for l in range(4): # noqa: E741 - for k in range(2): - for j in range(2): - for i in range(3): - sz += ( - b[i, j, k, l] - * (np.log(eb)) ** i - * (np.log(nen)) ** j - * (np.log(te)) ** k - * nn[l] - * z[l] - * (z[l] - 1.0) - ) - - return max(1e-20 * (np.exp(s1) / eb * (1.0 + sz)), 1e-23) - - -def init_current_drive_variables(): - """Initialise current drive variables""" - current_drive_variables.beamwd = 0.58 - current_drive_variables.bigq = 0.0 - current_drive_variables.f_c_plasma_bootstrap = 0.0 - current_drive_variables.f_c_plasma_bootstrap_max = 0.9 - current_drive_variables.f_c_plasma_bootstrap_iter89 = 0.0 - current_drive_variables.f_c_plasma_bootstrap_nevins = 0.0 - current_drive_variables.f_c_plasma_bootstrap_sauter = 0.0 - current_drive_variables.f_c_plasma_bootstrap_wilson = 0.0 - current_drive_variables.f_c_plasma_bootstrap_sakai = 0.0 - current_drive_variables.f_c_plasma_bootstrap_aries = 0.0 - current_drive_variables.f_c_plasma_bootstrap_andrade = 0.0 - current_drive_variables.f_c_plasma_bootstrap_hoang = 0.0 - current_drive_variables.f_c_plasma_bootstrap_wong = 0.0 - current_drive_variables.bscf_gi_i = 0.0 - current_drive_variables.bscf_gi_ii = 0.0 - current_drive_variables.cboot = 1.0 - current_drive_variables.c_beam_total = 0.0 - current_drive_variables.f_c_plasma_diamagnetic_hender = 0.0 - current_drive_variables.f_c_plasma_diamagnetic_scene = 0.0 - current_drive_variables.f_c_plasma_diamagnetic = 0.0 - current_drive_variables.p_ecrh_injected_mw = 0.0 - current_drive_variables.echwpow = 0.0 - current_drive_variables.eta_cd_hcd_primary = 0.0 - current_drive_variables.n_ecrh_harmonic = 2.0 - current_drive_variables.i_ecrh_wave_mode = 0 - current_drive_variables.e_beam_kev = 1.0e3 - current_drive_variables.eta_hcd_primary_injector_wall_plug = 0.0 - current_drive_variables.eta_hcd_secondary_injector_wall_plug = 0.0 - current_drive_variables.eta_ecrh_injector_wall_plug = 0.3 - current_drive_variables.eta_lowhyb_injector_wall_plug = 0.3 - current_drive_variables.eta_beam_injector_wall_plug = 0.3 - current_drive_variables.f_p_beam_injected_ions = 0.5 - current_drive_variables.p_beam_injected_mw = 0.0 - current_drive_variables.f_c_plasma_pfirsch_schluter_scene = 0.0 - current_drive_variables.p_beam_shine_through_mw = 0.0 - current_drive_variables.feffcd = 1.0 - current_drive_variables.f_p_beam_orbit_loss = 0.0 - current_drive_variables.frbeam = 1.05 - current_drive_variables.f_beam_tritium = 1e-6 - current_drive_variables.eta_cd_norm_hcd_primary = 0.0 - current_drive_variables.eta_cd_norm_ecrh = 0.35 - current_drive_variables.xi_ebw = 0.8 - current_drive_variables.i_hcd_primary = 5 - current_drive_variables.i_hcd_secondary = 0 - current_drive_variables.i_hcd_calculations = 1 - current_drive_variables.f_p_beam_shine_through = 0.0 - current_drive_variables.dx_beam_shield = 0.5 - current_drive_variables.p_hcd_primary_extra_heat_mw = 0.0 - current_drive_variables.p_hcd_secondary_extra_heat_mw = 0.0 - current_drive_variables.p_hcd_injected_max = 150.0 - current_drive_variables.p_hcd_injected_electrons_mw = 0.0 - current_drive_variables.p_hcd_injected_ions_mw = 0.0 - current_drive_variables.p_hcd_injected_total_mw = 0.0 - current_drive_variables.p_hcd_secondary_injected_mw = 0.0 - current_drive_variables.f_c_plasma_internal = 0.0 - current_drive_variables.plhybd = 0.0 - current_drive_variables.pnbeam = 0.0 - current_drive_variables.p_beam_orbit_loss_mw = 0.0 - current_drive_variables.f_c_plasma_pfirsch_schluter = 0.0 - current_drive_variables.pwplh = 0.0 - current_drive_variables.pwpnb = 0.0 - current_drive_variables.rtanbeam = 0.0 - current_drive_variables.rtanmax = 0.0 - current_drive_variables.n_beam_decay_lengths_core = 0.0 - current_drive_variables.tbeamin = 3.0 - current_drive_variables.eta_cd_norm_hcd_secondary = 0.0 - current_drive_variables.eta_cd_hcd_secondary = 0.0 + eh.report_error(19) + return None diff --git a/process/main.py b/process/main.py index c1e022ba8e..4fe34b6467 100644 --- a/process/main.py +++ b/process/main.py @@ -59,7 +59,14 @@ from process.costs_2015 import Costs2015 from process.cryostat import Cryostat from process.cs_fatigue import CsFatigue -from process.current_drive import CurrentDrive +from process.current_drive import ( + CurrentDrive, + ElectronBernstein, + ElectronCyclotron, + IonCyclotron, + LowerHybrid, + NeutralBeam, +) from process.dcll import DCLL from process.divertor import Divertor from process.fw import Fw @@ -675,7 +682,19 @@ def __init__(self): self.fw = Fw() self.blanket_library = BlanketLibrary(fw=self.fw) self.ccfe_hcpb = CCFE_HCPB(blanket_library=self.blanket_library) - self.current_drive = CurrentDrive(plasma_profile=self.plasma_profile) + self.electron_cyclotron = ElectronCyclotron(plasma_profile=self.plasma_profile) + self.ion_cyclotron = IonCyclotron(plasma_profile=self.plasma_profile) + self.lower_hybrid = LowerHybrid(plasma_profile=self.plasma_profile) + self.neutral_beam = NeutralBeam(plasma_profile=self.plasma_profile) + self.electron_bernstein = ElectronBernstein(plasma_profile=self.plasma_profile) + self.current_drive = CurrentDrive( + plasma_profile=self.plasma_profile, + electron_cyclotron=self.electron_cyclotron, + ion_cyclotron=self.ion_cyclotron, + lower_hybrid=self.lower_hybrid, + neutral_beam=self.neutral_beam, + electron_bernstein=self.electron_bernstein, + ) self.physics = Physics( plasma_profile=self.plasma_profile, current_drive=self.current_drive ) diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 9ce955253d..e823c79f84 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -2,7 +2,14 @@ import pytest -from process.current_drive import CurrentDrive +from process.current_drive import ( + CurrentDrive, + ElectronBernstein, + ElectronCyclotron, + IonCyclotron, + LowerHybrid, + NeutralBeam, +) from process.fortran import ( cost_variables, current_drive_variables, @@ -19,7 +26,14 @@ def current_drive(): :returns current_drive: initialised CurrentDrive object :rtype: process.current_drive.CurrentDrive """ - return CurrentDrive(PlasmaProfile()) + return CurrentDrive( + PlasmaProfile(), + electron_cyclotron=ElectronCyclotron(plasma_profile=PlasmaProfile()), + electron_bernstein=ElectronBernstein(plasma_profile=PlasmaProfile()), + neutral_beam=NeutralBeam(plasma_profile=PlasmaProfile()), + lower_hybrid=LowerHybrid(plasma_profile=PlasmaProfile()), + ion_cyclotron=IonCyclotron(plasma_profile=PlasmaProfile()), + ) class CudrivParam(NamedTuple): @@ -708,6 +722,6 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): def test_sigbeam(current_drive): - assert current_drive.sigbeam( + assert current_drive.neutral_beam.sigbeam( 1e3, 13.07, 8.0e-1, 0.1, 1e-4, 1e-4, 1e-4 ) == pytest.approx(2.013589662302492e-11) diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index f59083379f..4dfebb4b27 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -5,7 +5,14 @@ import numpy as np import pytest -from process.current_drive import CurrentDrive +from process.current_drive import ( + CurrentDrive, + ElectronBernstein, + ElectronCyclotron, + IonCyclotron, + LowerHybrid, + NeutralBeam, +) from process.fortran import ( constants, current_drive_variables, @@ -38,7 +45,17 @@ def physics(): :returns: initialised Physics object :rtype: process.physics.Physics """ - return Physics(PlasmaProfile(), CurrentDrive(PlasmaProfile())) + return Physics( + PlasmaProfile(), + CurrentDrive( + PlasmaProfile(), + electron_cyclotron=ElectronCyclotron(plasma_profile=PlasmaProfile()), + ion_cyclotron=IonCyclotron(plasma_profile=PlasmaProfile()), + neutral_beam=NeutralBeam(plasma_profile=PlasmaProfile()), + electron_bernstein=ElectronBernstein(plasma_profile=PlasmaProfile()), + lower_hybrid=LowerHybrid(plasma_profile=PlasmaProfile()), + ), + ) def test_calculate_poloidal_beta(): diff --git a/tests/unit/test_stellarator.py b/tests/unit/test_stellarator.py index 1d6490a33d..cf9992eb11 100644 --- a/tests/unit/test_stellarator.py +++ b/tests/unit/test_stellarator.py @@ -7,7 +7,14 @@ from process.blanket_library import BlanketLibrary from process.buildings import Buildings from process.costs import Costs -from process.current_drive import CurrentDrive +from process.current_drive import ( + CurrentDrive, + ElectronBernstein, + ElectronCyclotron, + IonCyclotron, + LowerHybrid, + NeutralBeam, +) from process.fortran import ( build_variables, cost_variables, @@ -44,8 +51,25 @@ def stellarator(): Power(), PlasmaProfile(), CCFE_HCPB(BlanketLibrary(Fw())), - CurrentDrive(PlasmaProfile()), - Physics(PlasmaProfile(), CurrentDrive(PlasmaProfile())), + CurrentDrive( + PlasmaProfile(), + ElectronCyclotron(plasma_profile=PlasmaProfile()), + IonCyclotron(plasma_profile=PlasmaProfile()), + NeutralBeam(plasma_profile=PlasmaProfile()), + LowerHybrid(plasma_profile=PlasmaProfile()), + ElectronBernstein(plasma_profile=PlasmaProfile()), + ), + Physics( + PlasmaProfile(), + CurrentDrive( + PlasmaProfile(), + ElectronCyclotron(plasma_profile=PlasmaProfile()), + IonCyclotron(plasma_profile=PlasmaProfile()), + NeutralBeam(plasma_profile=PlasmaProfile()), + LowerHybrid(plasma_profile=PlasmaProfile()), + ElectronBernstein(plasma_profile=PlasmaProfile()), + ), + ), Neoclassics(), ) From 1ec13cef95b996a5402957400644c9c32570050b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 4 Apr 2025 14:53:09 +0100 Subject: [PATCH 02/41] :sparkle: Add lower_hybrid_fenstermacher function to calculate lower hybrid frequency and update references in CurrentDrive class --- .../RF/fenstermacher_lower_hybrid.md | 2 +- process/current_drive.py | 36 ++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_lower_hybrid.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_lower_hybrid.md index 11c72f2714..0c953c6ee4 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_lower_hybrid.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_lower_hybrid.md @@ -1,4 +1,4 @@ -# Fenstermacher Lower Hybrid +# Fenstermacher Lower Hybrid | `lower_hybrid_fenstermacher()` - `i_hcd_primary/i_hcd_secondary` = 1: diff --git a/process/current_drive.py b/process/current_drive.py index ec8503d8ec..dc43fa6ae4 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -788,6 +788,31 @@ def lhrad(self): return rat0 + def lower_hybrid_fenstermacher( + self, te: float, rmajor: float, dene20: float + ) -> float: + """ + Calculate the lower hybrid frequency using the Fenstermacher formula. + This function computes the lower hybrid frequency based on the electron + temperature, major radius, and electron density. + + :param te: Volume averaged electron temperature in keV. + :type te: float + :param rmajor: Major radius of the plasma in meters. + :type rmajor: float + :param dene20: Volume averaged electron density in units of 10^20 m^-3. + :type dene20: float + + :return: The calculated absolute current drive efficiency in A/W. + :rtype: float + + :notes: + + :references: + """ + + return (0.36e0 * (1.0e0 + (te / 25.0e0) ** 1.16e0)) / (rmajor * dene20) + class CurrentDrive: def __init__( @@ -865,10 +890,12 @@ def cudriv(self, output: bool): # Fenstermacher Lower Hybrid model if current_drive_variables.i_hcd_secondary == 1: effrfssfix = ( - (0.36e0 * (1.0e0 + (physics_variables.te / 25.0e0) ** 1.16e0)) - / (physics_variables.rmajor * dene20) + self.lower_hybrid.lower_hybrid_fenstermacher( + physics_variables.te, physics_variables.rmajor, dene20 + ) * current_drive_variables.feffcd ) + eta_cd_hcd_secondary = effrfssfix # Ion-Cyclotron current drive elif current_drive_variables.i_hcd_secondary == 2: @@ -1176,8 +1203,9 @@ def cudriv(self, output: bool): # Fenstermacher Lower Hybrid model if current_drive_variables.i_hcd_primary == 1: effrfss = ( - (0.36e0 * (1.0e0 + (physics_variables.te / 25.0e0) ** 1.16e0)) - / (physics_variables.rmajor * dene20) + self.lower_hybrid.lower_hybrid_fenstermacher( + physics_variables.te, physics_variables.rmajor, dene20 + ) * current_drive_variables.feffcd ) current_drive_variables.eta_cd_hcd_primary = effrfss From fc38b75d5962f48e758964a5f565d47f1ec5cd8c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 4 Apr 2025 15:22:53 +0100 Subject: [PATCH 03/41] =?UTF-8?q?=E2=9C=A8=20Add=20ion=5Fcyclotron=5Fipdg8?= =?UTF-8?q?9=20function=20for=20calculating=20ion=20cyclotron=20heating=20?= =?UTF-8?q?efficiency=20and=20update=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heating_and_current_drive/RF/ic_model.md | 8 ++- process/current_drive.py | 58 +++++++++++++++---- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_model.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_model.md index c1cff1ae44..880a68e797 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_model.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_model.md @@ -1,7 +1,11 @@ -# Ion cyclotron model +# IPDG89 ion cyclotron model | `ion_cyclotron_ipdg89()` -- `i_hcd_primary/i_hcd_secondary` = 2 +- `i_hcd_primary/i_hcd_secondary` = 2 [^1] [^2] $$ \text{Current drive efficiency [A/W]} = \frac{\frac{0.063 T_{\langle \text{e}, n_{\text{e}}\rangle}}{2+Z_{\text{eff}}}}{R_0n_{\text{e,20}}} $$ + +[^1]: N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', https://inis.iaea.org/collection/NCLCollectionStore/_Public/21/068/21068960.pdf + +[^2] T.C. Hender et al., 'Physics Assessment of the European Reactor Study', AEA FUS 172, 1992. diff --git a/process/current_drive.py b/process/current_drive.py index dc43fa6ae4..a10c962da6 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -655,6 +655,41 @@ def __init__(self, plasma_profile: PlasmaProfile): self.outfile = constants.nout self.plasma_profile = plasma_profile + def ion_cyclotron_ipdg89( + self, ten: float, zeff: float, rmajor: float, dene20: float + ) -> float: + """ + Routine to calculate IPDG89 Ion Cyclotron heating efficiency. + + This function computes the ion cyclotron heating efficiency based on + the electron temperature, effective charge, major radius, and electron density. + + :param ten: Density weighted average electron temperature keV. + :type ten: float + :param zeff: Plasma effective charge. + :type zeff: float + :param rmajor: Major radius of the plasma in meters. + :type rmajor: float + :param dene: Volume averaged electron density in 1x10^20 m^-3. + :type dene: float + + :return: The calculated ion cyclotron heating efficiency in A/W. + :rtype: float + + :notes: + - The 0.1 term is to convert the temperature into 10 keV units + - The original formula is for the normalised current drive efficnecy + hence the addition of the density and majro radius terms to get back to an absolute value + + :references: + - N.A. Uckan and ITER Physics Group, 'ITER Physics Design Guidelines: 1989', + https://inis.iaea.org/collection/NCLCollectionStore/_Public/21/068/21068960.pdf + + - T.C. Hender et al., 'Physics Assessment of the European Reactor Study', AEA FUS 172, 1992. + """ + + return ((0.63e0 * 0.1e0 * ten) / (2.0e0 + zeff)) / (rmajor * dene20) + class ElectronBernstein: def __init__(self, plasma_profile: PlasmaProfile): @@ -900,13 +935,15 @@ def cudriv(self, output: bool): # Ion-Cyclotron current drive elif current_drive_variables.i_hcd_secondary == 2: effrfssfix = ( - 0.63e0 - * 0.1e0 - * physics_variables.ten - / (2.0e0 + physics_variables.zeff) - / (physics_variables.rmajor * dene20) + self.ion_cyclotron.ion_cyclotron_ipdg89( + ten=physics_variables.ten, + zeff=physics_variables.zeff, + rmajor=physics_variables.rmajor, + dene20=dene20, + ) * current_drive_variables.feffcd ) + eta_cd_hcd_secondary = effrfssfix # Fenstermacher Electron Cyclotron Resonance model elif current_drive_variables.i_hcd_secondary == 3: @@ -1212,11 +1249,12 @@ def cudriv(self, output: bool): # Ion-Cyclotron current drive elif current_drive_variables.i_hcd_primary == 2: effrfss = ( - 0.63e0 - * 0.1e0 - * physics_variables.ten - / (2.0e0 + physics_variables.zeff) - / (physics_variables.rmajor * dene20) + self.ion_cyclotron.ion_cyclotron_ipdg89( + ten=physics_variables.ten, + zeff=physics_variables.zeff, + rmajor=physics_variables.rmajor, + dene20=dene20, + ) * current_drive_variables.feffcd ) current_drive_variables.eta_cd_hcd_primary = effrfss From 0a4bf7c9746b2964f23ec041e7c86b6f37e30801 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 4 Apr 2025 15:56:07 +0100 Subject: [PATCH 04/41] =?UTF-8?q?=E2=9C=A8=20Add=20electron=5Fcyclotron=5F?= =?UTF-8?q?fenstermacher=20function=20for=20calculating=20electron=20cyclo?= =?UTF-8?q?tron=20heating=20efficiency=20and=20update=20related=20document?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...stermacher_electron_cyclotron_resonance.md | 7 ++- .../RF/fenstermacher_lower_hybrid.md | 8 ++- process/current_drive.py | 55 +++++++++++++++++-- 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_electron_cyclotron_resonance.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_electron_cyclotron_resonance.md index 0cbdc459a1..2e3c16a7ae 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_electron_cyclotron_resonance.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_electron_cyclotron_resonance.md @@ -1,6 +1,9 @@ -# Fenstermacher Electron Cyclotron Resonance +# Fenstermacher Electron Cyclotron Resonance | `electron_cyclotron_fenstermacher()` + +- `i_hcd_primary/i_hcd_secondary` = 3 [^1] -- `i_hcd_primary/i_hcd_secondary` = 3 $$ \text{Current drive efficiency [A/W]} = \frac{0.21 T_{\langle e,n_{\text{e}} \rangle}}{R_0n_{\text{e,20}}(31.0-(\log{n_{\text{e}}}/2)+(\log{(T_\text{e}}\times1000))} $$ + +[^1]: T.C. Hender et al., 'Physics Assessment of the European Reactor Study', AEA FUS 172, 1992. diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_lower_hybrid.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_lower_hybrid.md index 0c953c6ee4..31b54e6c36 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_lower_hybrid.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/fenstermacher_lower_hybrid.md @@ -2,6 +2,12 @@ - `i_hcd_primary/i_hcd_secondary` = 1: +This forumla was originally in the Oak RidgeSystems Code[^1], attributed to Fenstermacher and is used in the AEA FUS 172 report[^2]. + $$ \text{Current drive efficiency [A/W]} = 0.36 \frac{(1+(T_{\text{e}}/25)^{1.16})}{R_{0} n_{\text{e},20}} -$$ \ No newline at end of file +$$ + +[^1]: R.L.Reid et al, Oak Ridge Report ORNL/FEDC-87-7, 1988 + +[^2]: T.C. Hender et al., 'Physics Assessment of the European Reactor Study', AEA FUS 172, 1992. \ No newline at end of file diff --git a/process/current_drive.py b/process/current_drive.py index a10c962da6..541e6b9399 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -649,6 +649,39 @@ def eccdef(self, tlocal, epsloc, zlocal, cosang, coulog): eh.report_error(17) return ecgam + def electron_cyclotron_fenstermacher( + self, + ten: float, + rmajor: float, + dene20: float, + dlamee: float, + ) -> float: + """ + Routine to calculate Fenstermacher Electron Cyclotron heating efficiency. + + :param ten: Density weighted average electron temperature keV. + :type ten: float + :param zeff: Plasma effective charge. + :type zeff: float + :param rmajor: Major radius of the plasma in meters. + :type rmajor: float + :param dene20: Volume averaged electron density in 1x10^20 m^-3. + :type dene20: float + :param dlamee: Electron collision frequency in 1/s. + :type dlamee: float + + :return: The calculated electron cyclotron heating efficiency in A/W. + :rtype: float + + :notes: + + :references: + - T.C. Hender et al., 'Physics Assessment of the European Reactor Study', AEA FUS 172, 1992. + + """ + + return (0.21e0 * ten) / (rmajor * dene20 * dlamee) + class IonCyclotron: def __init__(self, plasma_profile: PlasmaProfile): @@ -842,8 +875,13 @@ def lower_hybrid_fenstermacher( :rtype: float :notes: + - This forumla was originally in the Oak RidgeSystems Code, attributed to Fenstermacher + and is used in the AEA FUS 172 report. :references: + - T.C. Hender et al., 'Physics Assessment of the European Reactor Study', AEA FUS 172, 1992. + + - R.L.Reid et al, Oak Ridge Report ORNL/FEDC-87-7, 1988 """ return (0.36e0 * (1.0e0 + (te / 25.0e0) ** 1.16e0)) / (rmajor * dene20) @@ -948,11 +986,14 @@ def cudriv(self, output: bool): # Fenstermacher Electron Cyclotron Resonance model elif current_drive_variables.i_hcd_secondary == 3: effrfssfix = ( - 0.21e0 - * physics_variables.ten - / (physics_variables.rmajor * dene20 * physics_variables.dlamee) + self.electron_cyclotron.electron_cyclotron_fenstermacher( + rmajor=physics_variables.rmajor, + dene20=dene20, + dlamee=physics_variables.dlamee, + ) * current_drive_variables.feffcd ) + eta_cd_hcd_secondary = effrfssfix # Ehst Lower Hybrid / Fast Wave current drive elif current_drive_variables.i_hcd_secondary == 4: @@ -1261,9 +1302,11 @@ def cudriv(self, output: bool): # Fenstermacher Electron Cyclotron Resonance model elif current_drive_variables.i_hcd_primary == 3: effrfss = ( - 0.21e0 - * physics_variables.ten - / (physics_variables.rmajor * dene20 * physics_variables.dlamee) + self.electron_cyclotron.electron_cyclotron_fenstermacher( + rmajor=physics_variables.rmajor, + dene20=dene20, + dlamee=physics_variables.dlamee, + ) * current_drive_variables.feffcd ) current_drive_variables.eta_cd_hcd_primary = effrfss From 6fcccc6116489ff9ff891d9a2d291ca3487b9a79 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 4 Apr 2025 16:05:48 +0100 Subject: [PATCH 05/41] =?UTF-8?q?=E2=9C=A8=20Add=20lower=5Fhybrid=5Fehst?= =?UTF-8?q?=20function=20for=20calculating=20Lower=20Hybrid=20current=20dr?= =?UTF-8?q?ive=20efficiency=20and=20update=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RF/ehst_lower_hybrid.md | 5 +- process/current_drive.py | 74 +++++++++++++------ 2 files changed, 56 insertions(+), 23 deletions(-) diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ehst_lower_hybrid.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ehst_lower_hybrid.md index d9d8bbce47..c841f0b07a 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ehst_lower_hybrid.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ehst_lower_hybrid.md @@ -1,5 +1,8 @@ -# Ehst Lower Hybrid +# Ehst Lower Hybrid | `lower_hybrid_ehst()` + + - `i_hcd_primary/i_hcd_secondary` = 4 + $$ \text{Current drive efficiency [A/W]} = \frac{T_{\text{e}}^{0.77} (0.034 + 0.196\beta)}{R_0 n_{\text{e},20}}\frac{\frac{32}{5+Z_{\text{eff}}}+2+\frac{\frac{12\left(6+Z_{\text{eff}}\right)}{5+Z_{\text{eff}}}}{3+Z_{\text{eff}}}+\frac{3.76}{Z_{\text{eff}}}}{12.507} $$ diff --git a/process/current_drive.py b/process/current_drive.py index 541e6b9399..7a264d32c6 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -886,6 +886,46 @@ def lower_hybrid_fenstermacher( return (0.36e0 * (1.0e0 + (te / 25.0e0) ** 1.16e0)) / (rmajor * dene20) + def lower_hybrid_ehst( + self, te: float, beta: float, rmajor: float, dene20: float, zeff: float + ) -> float: + """ + Calculate the Lower Hybrid current drive efficiency using the Ehst model. + + This function computes the current drive efficiency based on the electron + temperature, beta, major radius, electron density, and effective charge. + + :param te: Volume averaged electron temperature in keV. + :type te: float + :param beta: Plasma beta value (ratio of plasma pressure to magnetic pressure). + :type beta: float + :param rmajor: Major radius of the plasma in meters. + :type rmajor: float + :param dene20: Volume averaged electron density in units of 10^20 m^-3. + :type dene20: float + :param zeff: Plasma effective charge. + :type zeff: float + + :return: The calculated absolute current drive efficiency in A/W. + :rtype: float + + :notes: + + :references: + - Ehst, D.A., and Karney, C.F.F., "Lower Hybrid Current Drive in Tokamaks", + Nuclear Fusion, 31(10), 1933-1949, 1991. + """ + return ( + ((te**0.77 * (0.034 + 0.196 * beta)) / (rmajor * dene20)) + * ( + 32.0 / (5.0 + zeff) + + 2.0 + + (12.0 * (6.0 + zeff)) / (5.0 + zeff) / (3.0 + zeff) + + 3.76 / zeff + ) + / 12.507 + ) + class CurrentDrive: def __init__( @@ -998,18 +1038,13 @@ def cudriv(self, output: bool): # Ehst Lower Hybrid / Fast Wave current drive elif current_drive_variables.i_hcd_secondary == 4: effrfssfix = ( - physics_variables.te**0.77e0 - * (0.034e0 + 0.196e0 * physics_variables.beta) - / (physics_variables.rmajor * dene20) - * ( - 32.0e0 / (5.0e0 + physics_variables.zeff) - + 2.0e0 - + (12.0e0 * (6.0e0 + physics_variables.zeff)) - / (5.0e0 + physics_variables.zeff) - / (3.0e0 + physics_variables.zeff) - + 3.76e0 / physics_variables.zeff + self.lower_hybrid.lower_hybrid_ehst( + te=physics_variables.te, + beta=physics_variables.beta, + rmajor=physics_variables.rmajor, + dene20=dene20, + zeff=physics_variables.zeff, ) - / 12.507e0 * current_drive_variables.feffcd ) eta_cd_hcd_secondary = effrfssfix @@ -1313,18 +1348,13 @@ def cudriv(self, output: bool): # Ehst Lower Hybrid / Fast Wave current drive elif current_drive_variables.i_hcd_primary == 4: effrfss = ( - physics_variables.te**0.77e0 - * (0.034e0 + 0.196e0 * physics_variables.beta) - / (physics_variables.rmajor * dene20) - * ( - 32.0e0 / (5.0e0 + physics_variables.zeff) - + 2.0e0 - + (12.0e0 * (6.0e0 + physics_variables.zeff)) - / (5.0e0 + physics_variables.zeff) - / (3.0e0 + physics_variables.zeff) - + 3.76e0 / physics_variables.zeff + self.lower_hybrid.lower_hybrid_ehst( + te=physics_variables.te, + beta=physics_variables.beta, + rmajor=physics_variables.rmajor, + dene20=dene20, + zeff=physics_variables.zeff, ) - / 12.507e0 * current_drive_variables.feffcd ) current_drive_variables.eta_cd_hcd_primary = effrfss From 9ed7bc346e4e343d27afb399126774a946553326 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 08:55:32 +0100 Subject: [PATCH 06/41] =?UTF-8?q?=E2=9C=A8=20Add=20electron=5Fberstein=5Ff?= =?UTF-8?q?reethy=20function=20for=20calculating=20Electron=20Bernstein=20?= =?UTF-8?q?Wave=20current=20drive=20efficiency=20and=20refactor=20CurrentD?= =?UTF-8?q?rive=20class=20to=20utilize=20this=20new=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 173 +++++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 81 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 7a264d32c6..e5ce224fe0 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -729,6 +729,78 @@ def __init__(self, plasma_profile: PlasmaProfile): self.outfile = constants.nout self.plasma_profile = plasma_profile + def electron_berstein_freethy( + self, + te: float, + rmajor: float, + dene20: float, + bt: float, + n_ecrh_harmonic: int, + xi_ebw: float, + ) -> float: + """ + Calculate the Electron Bernstein Wave (EBW) current drive efficiency using the Freethy model. + + This function computes the EBW current drive efficiency based on the electron temperature, + major radius, electron density, magnetic field, harmonic number, and scaling factor. + + :param te: Volume averaged electron temperature in keV. + :type te: float + :param rmajor: Major radius of the plasma in meters. + :type rmajor: float + :param dene20: Volume averaged electron density in units of 10^20 m^-3. + :type dene20: float + :param bt: Toroidal magnetic field in Tesla. + :type bt: float + :param n_ecrh_harmonic: Cyclotron harmonic number (fundamental used as default). + :type n_ecrh_harmonic: int + :param xi_ebw: Scaling factor for EBW efficiency. + :type xi_ebw: float + + :return: The calculated absolute EBW current drive efficiency in A/W. + :rtype: float + + :notes: + - EBWs can only couple to plasma if the cyclotron harmonic is above the plasma density cut-off. + - The density factor accounts for this behavior. + + :references: + - Freethy, S., PROCESS issue #1262. + """ + + # Normalised current drive efficiency gamma + eta_cd_norm = (xi_ebw / 32.7e0) * te + + # Absolute current drive efficiency + eta_cd = eta_cd_norm / (dene20 * rmajor) + + # EBWs can only couple to plasma if cyclotron harmonic is above plasma density cut-off; + # this behavior is captured in the following function: + # constant 'a' controls sharpness of transition + a = 0.1e0 + + fc = ( + 1.0e0 + / (2.0e0 * np.pi) + * n_ecrh_harmonic + * constants.electron_charge + * bt + / constants.electron_mass + ) + fp = ( + 1.0e0 + / (2.0e0 * np.pi) + * np.sqrt( + dene20 + * constants.electron_charge**2 + / (constants.electron_mass * constants.epsilon0) + ) + ) + + density_factor = 0.5e0 * (1.0e0 + np.tanh((2.0e0 / a) * ((fp - fc) / fp - a))) + + return eta_cd * density_factor + class LowerHybrid: def __init__(self, plasma_profile: PlasmaProfile): @@ -1089,49 +1161,20 @@ def cudriv(self, output: bool): eta_cd_hcd_secondary = effrfssfix # EBW scaling elif current_drive_variables.i_hcd_secondary == 12: - # Scaling author Simon Freethy - # Ref : PROCESS issue 1262 - # Normalised current drive efficiency gamma - current_drive_variables.eta_cd_norm_hcd_secondary = ( - current_drive_variables.xi_ebw / 32.7e0 - ) * physics_variables.te - - # Absolute current drive efficiency - effrfssfix = current_drive_variables.eta_cd_norm_hcd_secondary / ( - dene20 * physics_variables.rmajor - ) - eta_cd_hcd_secondary = effrfssfix - - # EBWs can only couple to plasma if cyclotron harmonic is above plasma density cut-off; - # this behaviour is captured in the following function (ref issue #1262): - # current_drive_variables.n_ecrh_harmonic = cyclotron harmonic number (fundamental used as default) - # constant 'a' controls sharpness of transition - a = 0.1e0 - - fc = ( - 1.0e0 - / (2.0e0 * np.pi) - * current_drive_variables.n_ecrh_harmonic - * constants.electron_charge - * physics_variables.bt - / constants.electron_mass - ) - fp = ( - 1.0e0 - / (2.0e0 * np.pi) - * np.sqrt( - physics_variables.dene - * constants.electron_charge**2 - / (constants.electron_mass * constants.epsilon0) + effrfssfix = ( + self.electron_bernstein.electron_berstein_freethy( + te=physics_variables.te, + rmajor=physics_variables.rmajor, + dene20=dene20, + bt=physics_variables.bt, + n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, + xi_ebw=current_drive_variables.xi_ebw, ) + * current_drive_variables.feffcd ) - density_factor = 0.5e0 * ( - 1.0e0 + np.tanh((2.0e0 / a) * ((fp - fc) / fp - a)) - ) + eta_cd_hcd_secondary = effrfssfix - eta_cd_hcd_secondary = eta_cd_hcd_secondary * density_factor - effrfssfix = effrfssfix * density_factor elif current_drive_variables.i_hcd_secondary == 13: # ECCD model for O-mode cut-off with added Te and Zeff dependance # Scaling author: Simon Freethy @@ -1399,51 +1442,19 @@ def cudriv(self, output: bool): current_drive_variables.eta_cd_hcd_primary = effrfss # EBW scaling elif current_drive_variables.i_hcd_primary == 12: - # Scaling author Simon Freethy - # Ref : PROCESS issue 1262 - - # Normalised current drive efficiency gamma - current_drive_variables.eta_cd_norm_hcd_primary = ( - current_drive_variables.xi_ebw / 32.7e0 - ) * physics_variables.te - - # Absolute current drive efficiency - effrfss = current_drive_variables.eta_cd_norm_hcd_primary / ( - dene20 * physics_variables.rmajor - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # EBWs can only couple to plasma if cyclotron harmonic is above plasma density cut-off; - # this behaviour is captured in the following function (ref issue #1262): - # current_drive_variables.n_ecrh_harmonic = cyclotron harmonic number (fundamental used as default) - # contant 'a' controls sharpness of transition - a = 0.1e0 - - fc = ( - 1.0e0 - / (2.0e0 * np.pi) - * current_drive_variables.n_ecrh_harmonic - * constants.electron_charge - * physics_variables.bt - / constants.electron_mass - ) - fp = ( - 1.0e0 - / (2.0e0 * np.pi) - * np.sqrt( - physics_variables.dene - * constants.electron_charge**2 - / (constants.electron_mass * constants.epsilon0) + effrfss = ( + self.electron_bernstein.electron_berstein_freethy( + te=physics_variables.te, + rmajor=physics_variables.rmajor, + dene20=dene20, + bt=physics_variables.bt, + n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, + xi_ebw=current_drive_variables.xi_ebw, ) + * current_drive_variables.feffcd ) - density_factor = 0.5e0 * ( - 1.0e0 + np.tanh((2.0e0 / a) * ((fp - fc) / fp - a)) - ) - - current_drive_variables.eta_cd_hcd_primary = ( - current_drive_variables.eta_cd_hcd_primary * density_factor - ) - effrfss = effrfss * density_factor + current_drive_variables.eta_cd_hcd_primary = effrfss elif current_drive_variables.i_hcd_primary == 13: # ECCD model for O-mode cut-off with added Te and Zeff dependance From 7d6f1f8afaaeec5fd675d37f978de9706d1ddf56 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 09:02:48 +0100 Subject: [PATCH 07/41] =?UTF-8?q?=E2=9C=A8=20Add=20electron=5Fcyclotron=5F?= =?UTF-8?q?freethy=20function=20for=20calculating=20Electron=20Cyclotron?= =?UTF-8?q?=20current=20drive=20efficiency=20and=20refactor=20CurrentDrive?= =?UTF-8?q?=20class=20to=20utilize=20this=20new=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 215 ++++++++++++++++++--------------------- 1 file changed, 99 insertions(+), 116 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index e5ce224fe0..65dfef6726 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -682,6 +682,87 @@ def electron_cyclotron_fenstermacher( return (0.21e0 * ten) / (rmajor * dene20 * dlamee) + def electron_cyclotron_freethy( + self, + te: float, + zeff: float, + rmajor: float, + dene: float, + bt: float, + n_ecrh_harmonic: int, + i_ecrh_wave_mode: int, + ) -> float: + """ + Calculate the Electron Cyclotron current drive efficiency using the Freethy model. + + This function computes the ECCD efficiency based on the electron temperature, + effective charge, major radius, electron density, magnetic field, harmonic number, + and wave mode. + + :param te: Volume averaged electron temperature in keV. + :type te: float + :param zeff: Plasma effective charge. + :type zeff: float + :param rmajor: Major radius of the plasma in meters. + :type rmajor: float + :param dene: Volume averaged electron density in m^-3. + :type dene: float + :param bt: Toroidal magnetic field in Tesla. + :type bt: float + :param n_ecrh_harmonic: Cyclotron harmonic number (fundamental used as default). + :type n_ecrh_harmonic: int + :param i_ecrh_wave_mode: Wave mode switch (0 for O-mode, 1 for X-mode). + :type i_ecrh_wave_mode: int + + :return: The calculated absolute ECCD efficiency in A/W. + :rtype: float + + :notes: + - Plasma coupling only occurs if the plasma cut-off is below the cyclotron harmonic. + - The density factor accounts for this behavior. + + :references: + - Freethy, S., PROCESS issue #2994. + """ + + # Cyclotron frequency + fc = 1 / (2 * np.pi) * constants.electron_charge * bt / constants.electron_mass + + # Plasma frequency + fp = ( + 1 + / (2 * np.pi) + * np.sqrt( + (dene / 1.0e19) + * constants.electron_charge**2 + / (constants.electron_mass * constants.epsilon0) + ) + ) + + # Scaling factor for ECCD efficiency + xi_CD = 0.18e0 # Tuned to the results of a GRAY study + xi_CD *= 4.8e0 / (2 + zeff) # Zeff correction + + # ECCD efficiency + eta_cd = xi_CD * te / (3.27e0 * rmajor * (dene / 1.0e19)) + + # Determine the cut-off frequency based on wave mode + if i_ecrh_wave_mode == 0: # O-mode case + f_cutoff = fp + elif i_ecrh_wave_mode == 1: # X-mode case + f_cutoff = 0.5 * (fc + np.sqrt(n_ecrh_harmonic * fc**2 + 4 * fp**2)) + else: + raise ValueError("Invalid wave mode. Use 0 for O-mode or 1 for X-mode.") + + # Plasma coupling factor + a = 0.1 # Controls sharpness of the transition + cutoff_factor = 0.5 * ( + 1 + np.tanh((2 / a) * ((n_ecrh_harmonic * fc - f_cutoff) / fp - a)) + ) + + # Final ECCD efficiency + return eta_cd * cutoff_factor + class IonCyclotron: def __init__(self, plasma_profile: PlasmaProfile): @@ -1176,68 +1257,19 @@ def cudriv(self, output: bool): eta_cd_hcd_secondary = effrfssfix elif current_drive_variables.i_hcd_secondary == 13: - # ECCD model for O-mode cut-off with added Te and Zeff dependance - # Scaling author: Simon Freethy - # Ref : PROCESS issue #2994 - - fc = ( - 1 - / (2 * np.pi) - * constants.electron_charge - * physics_variables.bt - / constants.electron_mass - ) - fp = ( - 1 - / (2 * np.pi) - * np.sqrt( - (physics_variables.dene / 1.0e19) - * constants.electron_charge**2 - / (constants.electron_mass * constants.epsilon0) - ) - ) - - xi_CD = 0.18e0 # This is tuned to the results of a GRAY study - xi_CD = xi_CD * ( - 4.8e0 / (2 + physics_variables.zeff) - ) # Zeff correction effrfssfix = ( - xi_CD - * physics_variables.te - / ( - 3.27e0 - * physics_variables.rmajor - * (physics_variables.dene / 1.0e19) + self.electron_cyclotron.electron_cyclotron_freethy( + te=physics_variables.te, + rmajor=physics_variables.rmajor, + dene20=dene20, + bt=physics_variables.bt, + n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, + i_ecrh_wave_mode=current_drive_variables.i_ecrh_wave_mode, ) + * current_drive_variables.feffcd ) - # O-mode case - if current_drive_variables.i_ecrh_wave_mode == 0: - f_cutoff = fp - - # X-mode case - elif current_drive_variables.i_ecrh_wave_mode == 1: - f_cutoff = 0.5 * ( - fc - + np.sqrt( - current_drive_variables.n_ecrh_harmonic * fc**2 + 4 * fp**2 - ) - ) - - # Plasma coupling only occurs if the plasma cut-off is below the cyclotron harmonic - a = 0.1 # This controls how sharply the transition is reached - cutoff_factor = 0.5 * ( - 1 - + np.tanh( - (2 / (a)) - * ( - (current_drive_variables.n_ecrh_harmonic * fc - f_cutoff) - / fp - - a - ) - ) - ) - eta_cd_hcd_secondary = effrfssfix * cutoff_factor + eta_cd_hcd_secondary = effrfssfix elif current_drive_variables.i_hcd_secondary != 0: raise ProcessValueError( f"Current drive switch is invalid: {current_drive_variables.i_hcd_secondary = }" @@ -1457,68 +1489,19 @@ def cudriv(self, output: bool): current_drive_variables.eta_cd_hcd_primary = effrfss elif current_drive_variables.i_hcd_primary == 13: - # ECCD model for O-mode cut-off with added Te and Zeff dependance - # Scaling author: Simon Freethy - # Ref : PROCESS issue #2994 - - fc = ( - 1 - / (2 * np.pi) - * constants.electron_charge - * physics_variables.bt - / constants.electron_mass - ) - fp = ( - 1 - / (2 * np.pi) - * np.sqrt( - (physics_variables.dene / 1.0e19) - * constants.electron_charge**2 - / (constants.electron_mass * constants.epsilon0) - ) - ) - - xi_CD = 0.18e0 # This is tuned to the results of a GRAY study - xi_CD = xi_CD * ( - 4.8e0 / (2 + physics_variables.zeff) - ) # Zeff correction effrfss = ( - xi_CD - * physics_variables.te - / ( - 3.27e0 - * physics_variables.rmajor - * (physics_variables.dene / 1.0e19) + self.electron_cyclotron.electron_cyclotron_freethy( + te=physics_variables.te, + rmajor=physics_variables.rmajor, + dene20=dene20, + bt=physics_variables.bt, + n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, + i_ecrh_wave_mode=current_drive_variables.i_ecrh_wave_mode, ) + * current_drive_variables.feffcd ) - # O-mode case - if current_drive_variables.i_ecrh_wave_mode == 0: - f_cutoff = fp - - # X-mode case - elif current_drive_variables.i_ecrh_wave_mode == 1: - f_cutoff = 0.5 * ( - fc - + np.sqrt( - current_drive_variables.n_ecrh_harmonic * fc**2 + 4 * fp**2 - ) - ) - - # Plasma coupling only occurs if the plasma cut-off is below the cyclotron harmonic - a = 0.1 # This controls how sharply the transition is reached - cutoff_factor = 0.5 * ( - 1 - + np.tanh( - (2 / (a)) - * ( - (current_drive_variables.n_ecrh_harmonic * fc - f_cutoff) - / fp - - a - ) - ) - ) - current_drive_variables.eta_cd_hcd_primary = effrfss * cutoff_factor + current_drive_variables.eta_cd_hcd_primary = effrfss else: raise ProcessValueError( f"Current drive switch is invalid: {current_drive_variables.i_hcd_primary = }" From 47d050d57c738f48423c11d2886e518c2ec98d79 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 09:35:03 +0100 Subject: [PATCH 08/41] =?UTF-8?q?=E2=9C=A8=20Refactor=20CurrentDrive=20cla?= =?UTF-8?q?ss=20to=20streamline=20current=20drive=20efficiency=20calculati?= =?UTF-8?q?ons=20using=20a=20dictionary=20of=20models=20and=20remove=20red?= =?UTF-8?q?undant=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 361 ++++++++++----------------------------- 1 file changed, 88 insertions(+), 273 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 65dfef6726..0e4b9ef9aa 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1153,127 +1153,90 @@ def cudriv(self, output: bool): # values from user input # current_drive_variables.i_hcd_secondary | switch for fixed current drive efficiency model - # Fenstermacher Lower Hybrid model - if current_drive_variables.i_hcd_secondary == 1: - effrfssfix = ( - self.lower_hybrid.lower_hybrid_fenstermacher( - physics_variables.te, physics_variables.rmajor, dene20 - ) - * current_drive_variables.feffcd - ) - - eta_cd_hcd_secondary = effrfssfix - # Ion-Cyclotron current drive - elif current_drive_variables.i_hcd_secondary == 2: - effrfssfix = ( - self.ion_cyclotron.ion_cyclotron_ipdg89( - ten=physics_variables.ten, - zeff=physics_variables.zeff, - rmajor=physics_variables.rmajor, - dene20=dene20, - ) - * current_drive_variables.feffcd - ) - - eta_cd_hcd_secondary = effrfssfix - # Fenstermacher Electron Cyclotron Resonance model - elif current_drive_variables.i_hcd_secondary == 3: - effrfssfix = ( - self.electron_cyclotron.electron_cyclotron_fenstermacher( - rmajor=physics_variables.rmajor, - dene20=dene20, - dlamee=physics_variables.dlamee, - ) - * current_drive_variables.feffcd - ) - - eta_cd_hcd_secondary = effrfssfix - # Ehst Lower Hybrid / Fast Wave current drive - elif current_drive_variables.i_hcd_secondary == 4: - effrfssfix = ( - self.lower_hybrid.lower_hybrid_ehst( - te=physics_variables.te, - beta=physics_variables.beta, - rmajor=physics_variables.rmajor, - dene20=dene20, - zeff=physics_variables.zeff, - ) - * current_drive_variables.feffcd - ) - eta_cd_hcd_secondary = effrfssfix - elif current_drive_variables.i_hcd_secondary == 5: - ( - effnbss, - current_drive_variables.f_p_beam_injected_ions, - current_drive_variables.f_p_beam_shine_through, - ) = self.neutral_beam.iternb() - effnbssfix = effnbss * current_drive_variables.feffcd - eta_cd_hcd_secondary = effnbssfix - # Culham Lower Hybrid current drive model - elif current_drive_variables.i_hcd_secondary == 6: - effrfss = self.lower_hybrid.cullhy() - effrfssfix = effrfss * current_drive_variables.feffcd - eta_cd_hcd_secondary = effrfssfix - # Culham ECCD model - elif current_drive_variables.i_hcd_secondary == 7: - effrfss = self.electron_cyclotron.culecd() - effrfssfix = effrfss * current_drive_variables.feffcd - eta_cd_hcd_secondary = effrfssfix - # Culham Neutral Beam model - elif current_drive_variables.i_hcd_secondary == 8: - ( - effnbss, - current_drive_variables.f_p_beam_injected_ions, - current_drive_variables.f_p_beam_shine_through, - ) = self.neutral_beam.culnbi() - effnbssfix = effnbss * current_drive_variables.feffcd - eta_cd_hcd_secondary = effnbssfix - # ECRH user input gamma - elif current_drive_variables.i_hcd_secondary == 10: - # Normalised current drive efficiency gamma - current_drive_variables.eta_cd_norm_hcd_secondary = ( - current_drive_variables.eta_cd_norm_ecrh - ) - - # Absolute current drive efficiency - effrfssfix = current_drive_variables.eta_cd_norm_hcd_secondary / ( - dene20 * physics_variables.rmajor - ) - eta_cd_hcd_secondary = effrfssfix - # EBW scaling - elif current_drive_variables.i_hcd_secondary == 12: - effrfssfix = ( - self.electron_bernstein.electron_berstein_freethy( - te=physics_variables.te, - rmajor=physics_variables.rmajor, - dene20=dene20, - bt=physics_variables.bt, - n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, - xi_ebw=current_drive_variables.xi_ebw, - ) - * current_drive_variables.feffcd - ) - + # Define a dictionary of lambda functions for current drive efficiency models + hcd_models = { + 1: lambda: self.lower_hybrid.lower_hybrid_fenstermacher( + physics_variables.te, physics_variables.rmajor, dene20 + ) + * current_drive_variables.feffcd, + 2: lambda: self.ion_cyclotron.ion_cyclotron_ipdg89( + ten=physics_variables.ten, + zeff=physics_variables.zeff, + rmajor=physics_variables.rmajor, + dene20=dene20, + ) + * current_drive_variables.feffcd, + 3: lambda: self.electron_cyclotron.electron_cyclotron_fenstermacher( + rmajor=physics_variables.rmajor, + dene20=dene20, + dlamee=physics_variables.dlamee, + ) + * current_drive_variables.feffcd, + 4: lambda: self.lower_hybrid.lower_hybrid_ehst( + te=physics_variables.te, + beta=physics_variables.beta, + rmajor=physics_variables.rmajor, + dene20=dene20, + zeff=physics_variables.zeff, + ) + * current_drive_variables.feffcd, + 5: lambda: ( + self.neutral_beam.iternb()[0] * current_drive_variables.feffcd + ), + 6: lambda: self.lower_hybrid.cullhy() * current_drive_variables.feffcd, + 7: lambda: self.electron_cyclotron.culecd() + * current_drive_variables.feffcd, + 8: lambda: ( + self.neutral_beam.culnbi()[0] * current_drive_variables.feffcd + ), + 10: lambda: current_drive_variables.eta_cd_norm_ecrh + / (dene20 * physics_variables.rmajor), + 12: lambda: self.electron_bernstein.electron_berstein_freethy( + te=physics_variables.te, + rmajor=physics_variables.rmajor, + dene20=dene20, + bt=physics_variables.bt, + n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, + xi_ebw=current_drive_variables.xi_ebw, + ) + * current_drive_variables.feffcd, + 13: lambda: self.electron_cyclotron.electron_cyclotron_freethy( + te=physics_variables.te, + rmajor=physics_variables.rmajor, + dene20=dene20, + bt=physics_variables.bt, + n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, + i_ecrh_wave_mode=current_drive_variables.i_ecrh_wave_mode, + ) + * current_drive_variables.feffcd, + } + + # Assign outputs for models that return multiple values + if current_drive_variables.i_hcd_secondary in [5, 8]: + effrfssfix, f_p_beam_injected_ions, f_p_beam_shine_through = ( + self.neutral_beam.iternb() + if current_drive_variables.i_hcd_secondary == 5 + else self.neutral_beam.culnbi() + ) + current_drive_variables.f_p_beam_injected_ions = f_p_beam_injected_ions + current_drive_variables.f_p_beam_shine_through = f_p_beam_shine_through + + # Calculate eta_cd_hcd_secondary based on the selected model + if current_drive_variables.i_hcd_secondary.item() in hcd_models: + effrfssfix = hcd_models[ + current_drive_variables.i_hcd_secondary.item() + ]() eta_cd_hcd_secondary = effrfssfix - elif current_drive_variables.i_hcd_secondary == 13: - effrfssfix = ( - self.electron_cyclotron.electron_cyclotron_freethy( - te=physics_variables.te, - rmajor=physics_variables.rmajor, - dene20=dene20, - bt=physics_variables.bt, - n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, - i_ecrh_wave_mode=current_drive_variables.i_ecrh_wave_mode, - ) - * current_drive_variables.feffcd - ) + # Calculate eta_cd_hcd_primary based on the selected model + if current_drive_variables.i_hcd_primary.item() in hcd_models: + effrfss = hcd_models[current_drive_variables.i_hcd_primary.item()]() + current_drive_variables.eta_cd_hcd_primary = effrfss - eta_cd_hcd_secondary = effrfssfix - elif current_drive_variables.i_hcd_secondary != 0: - raise ProcessValueError( - f"Current drive switch is invalid: {current_drive_variables.i_hcd_secondary = }" - ) + current_drive_variables.eta_cd_norm_hcd_primary = ( + current_drive_variables.eta_cd_hcd_primary + * (dene20 * physics_variables.rmajor) + ) if current_drive_variables.i_hcd_secondary in [1, 2, 4, 6]: # Injected power @@ -1371,141 +1334,11 @@ def cudriv(self, output: bool): current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug ) - gamnb = effnbssfix * (dene20 * physics_variables.rmajor) - gamcdfix = gamnb + # gamnb = effnbssfix * (dene20 * physics_variables.rmajor) + # gamcdfix = gamnb beam_current_fix = ( 1.0e-3 * (pnbitotfix * 1.0e6) / current_drive_variables.e_beam_kev ) # Neutral beam current (A) - auxiliary_cdfix = ( - effnbssfix - * ( - current_drive_variables.p_hcd_secondary_injected_mw - - current_drive_variables.p_hcd_secondary_extra_heat_mw - ) - * 1.0e6 - ) - aux_current_fraction_fix = ( - auxiliary_cdfix / physics_variables.plasma_current - ) - - # Fenstermacher Lower Hybrid model - if current_drive_variables.i_hcd_primary == 1: - effrfss = ( - self.lower_hybrid.lower_hybrid_fenstermacher( - physics_variables.te, physics_variables.rmajor, dene20 - ) - * current_drive_variables.feffcd - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # Ion-Cyclotron current drive - elif current_drive_variables.i_hcd_primary == 2: - effrfss = ( - self.ion_cyclotron.ion_cyclotron_ipdg89( - ten=physics_variables.ten, - zeff=physics_variables.zeff, - rmajor=physics_variables.rmajor, - dene20=dene20, - ) - * current_drive_variables.feffcd - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # Fenstermacher Electron Cyclotron Resonance model - elif current_drive_variables.i_hcd_primary == 3: - effrfss = ( - self.electron_cyclotron.electron_cyclotron_fenstermacher( - rmajor=physics_variables.rmajor, - dene20=dene20, - dlamee=physics_variables.dlamee, - ) - * current_drive_variables.feffcd - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # Ehst Lower Hybrid / Fast Wave current drive - elif current_drive_variables.i_hcd_primary == 4: - effrfss = ( - self.lower_hybrid.lower_hybrid_ehst( - te=physics_variables.te, - beta=physics_variables.beta, - rmajor=physics_variables.rmajor, - dene20=dene20, - zeff=physics_variables.zeff, - ) - * current_drive_variables.feffcd - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # ITER Neutral Beam current drive - elif current_drive_variables.i_hcd_primary == 5: - ( - effnbss, - current_drive_variables.f_p_beam_injected_ions, - current_drive_variables.f_p_beam_shine_through, - ) = self.neutral_beam.iternb() - effnbss = effnbss * current_drive_variables.feffcd - current_drive_variables.eta_cd_hcd_primary = effnbss - # Culham Lower Hybrid current drive model - elif current_drive_variables.i_hcd_primary == 6: - effrfss = self.lower_hybrid.cullhy() - effrfss = effrfss * current_drive_variables.feffcd - current_drive_variables.eta_cd_hcd_primary = effrfss - # Culham ECCD model - elif current_drive_variables.i_hcd_primary == 7: - effrfss = self.electron_cyclotron.culecd() - effrfss = effrfss * current_drive_variables.feffcd - current_drive_variables.eta_cd_hcd_primary = effrfss - # Culham Neutral Beam model - elif current_drive_variables.i_hcd_primary == 8: - ( - effnbss, - current_drive_variables.f_p_beam_injected_ions, - current_drive_variables.f_p_beam_shine_through, - ) = self.neutral_beam.culnbi() - effnbss = effnbss * current_drive_variables.feffcd - current_drive_variables.eta_cd_hcd_primary = effnbss - # ECRH user input gamma - elif current_drive_variables.i_hcd_primary == 10: - current_drive_variables.eta_cd_norm_hcd_primary = ( - current_drive_variables.eta_cd_norm_ecrh - ) - - # Absolute current drive efficiency - effrfss = current_drive_variables.eta_cd_norm_hcd_primary / ( - dene20 * physics_variables.rmajor - ) - current_drive_variables.eta_cd_hcd_primary = effrfss - # EBW scaling - elif current_drive_variables.i_hcd_primary == 12: - effrfss = ( - self.electron_bernstein.electron_berstein_freethy( - te=physics_variables.te, - rmajor=physics_variables.rmajor, - dene20=dene20, - bt=physics_variables.bt, - n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, - xi_ebw=current_drive_variables.xi_ebw, - ) - * current_drive_variables.feffcd - ) - - current_drive_variables.eta_cd_hcd_primary = effrfss - - elif current_drive_variables.i_hcd_primary == 13: - effrfss = ( - self.electron_cyclotron.electron_cyclotron_freethy( - te=physics_variables.te, - rmajor=physics_variables.rmajor, - dene20=dene20, - bt=physics_variables.bt, - n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, - i_ecrh_wave_mode=current_drive_variables.i_ecrh_wave_mode, - ) - * current_drive_variables.feffcd - ) - - current_drive_variables.eta_cd_hcd_primary = effrfss - else: - raise ProcessValueError( - f"Current drive switch is invalid: {current_drive_variables.i_hcd_primary = }" - ) # Compute current drive wall plug and injected powers (MW) and efficiencies auxiliary_cd = ( @@ -1571,6 +1404,9 @@ def cudriv(self, output: bool): current_drive_variables.eta_ecrh_injector_wall_plug ) elif current_drive_variables.i_hcd_primary in [5, 8]: + eta_cd_norm_hcd_primary = ( + current_drive_variables.eta_cd_norm_hcd_primary + ) # MDK. See Gitlab issue #248, and scanned note. power1 = ( 1.0e-6 @@ -1579,7 +1415,7 @@ def cudriv(self, output: bool): - aux_current_fraction_fix ) * physics_variables.plasma_current - / effnbss + / eta_cd_norm_hcd_primary + current_drive_variables.p_hcd_primary_extra_heat_mw ) @@ -1631,7 +1467,7 @@ def cudriv(self, output: bool): current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug ) - gamnb = effnbss * (dene20 * physics_variables.rmajor) + gamnb = eta_cd_norm_hcd_primary * (dene20 * physics_variables.rmajor) current_drive_variables.eta_cd_norm_hcd_primary = gamnb current_drive_variables.c_beam_total = ( 1.0e-3 @@ -2021,27 +1857,6 @@ def cudriv(self, output: bool): "OP ", ) - if (current_drive_variables.i_hcd_primary == 5) or ( - current_drive_variables.i_hcd_primary == 8 - ): - po.ovarre( - self.outfile, "Beam efficiency (A/W)", "(effnbss)", effnbss, "OP " - ) - - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.ovarre( - self.outfile, - "Secondary fixed beam efficiency (A/W)", - "(effnbssfix)", - effnbssfix, - "OP ", - ) - - po.ovarre( - self.outfile, "Beam gamma (10^20 A/W-m2)", "(gamnb)", gamnb, "OP " - ) po.ovarre( self.outfile, "Neutral beam wall plug efficiency", From 7ad3df58cad4d875538b4f91f0bcab8d4dac781e Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 10:58:11 +0100 Subject: [PATCH 09/41] =?UTF-8?q?=F0=9F=94=84=20Make=20eta=5Fcd=5Fhcd=5Fse?= =?UTF-8?q?condary=20a=20proper=20current=5Fdrive=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 4 ++-- source/fortran/current_drive_variables.f90 | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 0e4b9ef9aa..045fac2015 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1226,7 +1226,7 @@ def cudriv(self, output: bool): effrfssfix = hcd_models[ current_drive_variables.i_hcd_secondary.item() ]() - eta_cd_hcd_secondary = effrfssfix + current_drive_variables.eta_cd_hcd_secondary = effrfssfix # Calculate eta_cd_hcd_primary based on the selected model if current_drive_variables.i_hcd_primary.item() in hcd_models: @@ -1704,7 +1704,7 @@ def cudriv(self, output: bool): self.outfile, "Secondary current drive efficiency (A/W)", "(eta_cd_hcd_secondary)", - eta_cd_hcd_secondary, + current_drive_variables.eta_cd_hcd_secondary, "OP ", ) po.ovarre( diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index f1ff175c11..7e4378a4eb 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -85,7 +85,10 @@ module current_drive_variables !! ECH wall plug power (MW) real(dp) :: eta_cd_hcd_primary - !! current drive efficiency (A/W) + !! Current drive efficiency of primary HCD system (A/W) + + real(dp) :: eta_cd_hcd_secondary + !! Current drive efficiency of secondary HCD system (A/W) real(dp) :: n_ecrh_harmonic !! cyclotron harmonic frequency number, used in cut-off function From c4602f5fd014f6062f31d42608f5b25221e59bd4 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 11:06:14 +0100 Subject: [PATCH 10/41] =?UTF-8?q?=E2=9E=95=20Add=20calculation=20for=20the?= =?UTF-8?q?=20normalised=20secondary=20efficiency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 045fac2015..cd264d53a2 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1148,10 +1148,8 @@ def cudriv(self, output: bool): # put electron density in desired units (10^-20 m-3) dene20 = physics_variables.dene * 1.0e-20 - # If present we must calculate second current drive - # efficiencies in units of Amps/Watt using the fixed - # values from user input - # current_drive_variables.i_hcd_secondary | switch for fixed current drive efficiency model + # Calculate current drive efficiencies + # ============================================================== # Define a dictionary of lambda functions for current drive efficiency models hcd_models = { @@ -1238,6 +1236,13 @@ def cudriv(self, output: bool): * (dene20 * physics_variables.rmajor) ) + current_drive_variables.eta_cd_norm_hcd_secondary = ( + current_drive_variables.eta_cd_hcd_secondary + * (dene20 * physics_variables.rmajor) + ) + + # ============================================================== + if current_drive_variables.i_hcd_secondary in [1, 2, 4, 6]: # Injected power pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw From 4af1403944e5842c19ca736176ece38b13340256 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 11:32:07 +0100 Subject: [PATCH 11/41] =?UTF-8?q?=E2=9C=A8=20Create=20new=20current=20driv?= =?UTF-8?q?en=20variables=20for=20the=20hcd=20systems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 48 ++++++++++------------ source/fortran/current_drive_variables.f90 | 6 +++ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index cd264d53a2..5f5075a795 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1122,9 +1122,7 @@ def cudriv(self, output: bool): pinjemw1 = 0.0 pinjemwfix = 0.0 pinjimwfix = 0.0 - auxiliary_cdfix = 0.0 aux_current_fraction_fix = 0.0 - gamcdfix = 0.0e0 # To stop issues with input file we force # zero secondary heating if no injection method @@ -1211,7 +1209,7 @@ def cudriv(self, output: bool): # Assign outputs for models that return multiple values if current_drive_variables.i_hcd_secondary in [5, 8]: - effrfssfix, f_p_beam_injected_ions, f_p_beam_shine_through = ( + eta_cd_hcd_secondary, f_p_beam_injected_ions, f_p_beam_shine_through = ( self.neutral_beam.iternb() if current_drive_variables.i_hcd_secondary == 5 else self.neutral_beam.culnbi() @@ -1221,16 +1219,17 @@ def cudriv(self, output: bool): # Calculate eta_cd_hcd_secondary based on the selected model if current_drive_variables.i_hcd_secondary.item() in hcd_models: - effrfssfix = hcd_models[ + eta_cd_hcd_secondary = hcd_models[ current_drive_variables.i_hcd_secondary.item() ]() - current_drive_variables.eta_cd_hcd_secondary = effrfssfix + current_drive_variables.eta_cd_hcd_secondary = eta_cd_hcd_secondary # Calculate eta_cd_hcd_primary based on the selected model if current_drive_variables.i_hcd_primary.item() in hcd_models: effrfss = hcd_models[current_drive_variables.i_hcd_primary.item()]() current_drive_variables.eta_cd_hcd_primary = effrfss + # Calculate the normalised current drive efficiencies current_drive_variables.eta_cd_norm_hcd_primary = ( current_drive_variables.eta_cd_hcd_primary * (dene20 * physics_variables.rmajor) @@ -1241,6 +1240,12 @@ def cudriv(self, output: bool): * (dene20 * physics_variables.rmajor) ) + current_drive_variables.c_hcd_secondary_driven = ( + current_drive_variables.eta_cd_hcd_secondary + * current_drive_variables.p_hcd_secondary_injected_mw + * 1.0e6 + ) + # ============================================================== if current_drive_variables.i_hcd_secondary in [1, 2, 4, 6]: @@ -1258,20 +1263,9 @@ def cudriv(self, output: bool): current_drive_variables.eta_lowhyb_injector_wall_plug ) - # Normalised current drive efficiency gamma - gamcdfix = effrfssfix * (dene20 * physics_variables.rmajor) - - # the fixed auxiliary current - auxiliary_cdfix = ( - effrfssfix - * ( - current_drive_variables.p_hcd_secondary_injected_mw - - current_drive_variables.p_hcd_secondary_extra_heat_mw - ) - * 1.0e6 - ) aux_current_fraction_fix = ( - auxiliary_cdfix / physics_variables.plasma_current + current_drive_variables.c_hcd_secondary_driven + / physics_variables.plasma_current ) elif current_drive_variables.i_hcd_secondary in [3, 7, 10, 12, 13]: # Injected power @@ -1289,8 +1283,8 @@ def cudriv(self, output: bool): ) # the fixed auxiliary current - auxiliary_cdfix = ( - effrfssfix + current_drive_variables.c_hcd_secondary_driven = ( + eta_cd_hcd_secondary * ( current_drive_variables.p_hcd_secondary_injected_mw - current_drive_variables.p_hcd_secondary_extra_heat_mw @@ -1298,7 +1292,8 @@ def cudriv(self, output: bool): * 1.0e6 ) aux_current_fraction_fix = ( - auxiliary_cdfix / physics_variables.plasma_current + current_drive_variables.c_hcd_secondary_driven + / physics_variables.plasma_current ) elif current_drive_variables.i_hcd_secondary in [5, 8]: # Account for first orbit losses @@ -1339,8 +1334,7 @@ def cudriv(self, output: bool): current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug ) - # gamnb = effnbssfix * (dene20 * physics_variables.rmajor) - # gamcdfix = gamnb + beam_current_fix = ( 1.0e-3 * (pnbitotfix * 1.0e6) / current_drive_variables.e_beam_kev ) # Neutral beam current (A) @@ -1649,8 +1643,8 @@ def cudriv(self, output: bool): po.ovarre( self.outfile, "Secondary auxiliary current drive (A)", - "(auxiliary_cdfix)", - auxiliary_cdfix, + "(c_hcd_secondary_driven)", + current_drive_variables.c_hcd_secondary_driven, "OP ", ) @@ -1721,8 +1715,8 @@ def cudriv(self, output: bool): po.ovarre( self.outfile, "Normalised secondary current drive efficiency, gamma (10^20 A/W-m2)", - "(gamcdfix)", - gamcdfix, + "(eta_cd_norm_hcd_secondary)", + current_drive_variables.eta_cd_norm_hcd_secondary, "OP ", ) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 7e4378a4eb..b2c2778b55 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -90,6 +90,12 @@ module current_drive_variables real(dp) :: eta_cd_hcd_secondary !! Current drive efficiency of secondary HCD system (A/W) + real(dp) :: c_hcd_primary_driven + !! Current in plasma driven by primary HCD system (A) + + real(dp) :: c_hcd_secondary_driven + !! Current in plasma driven by secondary HCD system (A) + real(dp) :: n_ecrh_harmonic !! cyclotron harmonic frequency number, used in cut-off function From 490479cd69fe6d7c84de7bfba9d2f4b5d60f6cda Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 11:41:49 +0100 Subject: [PATCH 12/41] =?UTF-8?q?=E2=9C=A8=20Add=20calculations=20for=20se?= =?UTF-8?q?condary=20heating=20current=20drive=20efficiency=20and=20introd?= =?UTF-8?q?uce=20new=20variables=20for=20driven=20current=20fractions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 26 ++++++++++------------ source/fortran/current_drive_variables.f90 | 6 +++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 5f5075a795..ce6da97b7d 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1122,7 +1122,6 @@ def cudriv(self, output: bool): pinjemw1 = 0.0 pinjemwfix = 0.0 pinjimwfix = 0.0 - aux_current_fraction_fix = 0.0 # To stop issues with input file we force # zero secondary heating if no injection method @@ -1229,22 +1228,28 @@ def cudriv(self, output: bool): effrfss = hcd_models[current_drive_variables.i_hcd_primary.item()]() current_drive_variables.eta_cd_hcd_primary = effrfss - # Calculate the normalised current drive efficiencies + # # Calculate the normalised current drive efficieny for the primary heating method current_drive_variables.eta_cd_norm_hcd_primary = ( current_drive_variables.eta_cd_hcd_primary * (dene20 * physics_variables.rmajor) ) - + # Calculate the normalised current drive efficieny for the secondary heating method current_drive_variables.eta_cd_norm_hcd_secondary = ( current_drive_variables.eta_cd_hcd_secondary * (dene20 * physics_variables.rmajor) ) + # Calculate the driven current for the secondary heating method current_drive_variables.c_hcd_secondary_driven = ( current_drive_variables.eta_cd_hcd_secondary * current_drive_variables.p_hcd_secondary_injected_mw * 1.0e6 ) + # Calculate the fraction of the plasma current driven by the secondary heating method + current_drive_variables.f_c_plasma_hcd_secondary = ( + current_drive_variables.c_hcd_secondary_driven + / physics_variables.plasma_current + ) # ============================================================== @@ -1263,10 +1268,6 @@ def cudriv(self, output: bool): current_drive_variables.eta_lowhyb_injector_wall_plug ) - aux_current_fraction_fix = ( - current_drive_variables.c_hcd_secondary_driven - / physics_variables.plasma_current - ) elif current_drive_variables.i_hcd_secondary in [3, 7, 10, 12, 13]: # Injected power pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw @@ -1291,10 +1292,7 @@ def cudriv(self, output: bool): ) * 1.0e6 ) - aux_current_fraction_fix = ( - current_drive_variables.c_hcd_secondary_driven - / physics_variables.plasma_current - ) + elif current_drive_variables.i_hcd_secondary in [5, 8]: # Account for first orbit losses # (power due to particles that are ionised but not thermalised) [MW]: @@ -1352,7 +1350,7 @@ def cudriv(self, output: bool): 1.0e-6 * ( physics_variables.aux_current_fraction - - aux_current_fraction_fix + - current_drive_variables.f_c_plasma_hcd_secondary ) * physics_variables.plasma_current / effrfss @@ -1383,7 +1381,7 @@ def cudriv(self, output: bool): 1.0e-6 * ( physics_variables.aux_current_fraction - - aux_current_fraction_fix + - current_drive_variables.f_c_plasma_hcd_secondary ) * physics_variables.plasma_current / effrfss @@ -1411,7 +1409,7 @@ def cudriv(self, output: bool): 1.0e-6 * ( physics_variables.aux_current_fraction - - aux_current_fraction_fix + - current_drive_variables.f_c_plasma_hcd_secondary ) * physics_variables.plasma_current / eta_cd_norm_hcd_primary diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index b2c2778b55..19434c583b 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -96,6 +96,12 @@ module current_drive_variables real(dp) :: c_hcd_secondary_driven !! Current in plasma driven by secondary HCD system (A) + real(dp) :: f_c_plasma_hcd_primary + !! Fraction of plasma current driven by primary HCD system + + real(dp) :: f_c_plasma_hcd_secondary + !! Fraction of plasma current driven by secondary HCD system + real(dp) :: n_ecrh_harmonic !! cyclotron harmonic frequency number, used in cut-off function From c03f9e3bc4407c8432f3098156d04238a1d97980 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 11:50:47 +0100 Subject: [PATCH 13/41] =?UTF-8?q?=F0=9F=94=84=20Rename=20pinjwpfix=20to=20?= =?UTF-8?q?p=5Fhcd=5Fsecondary=5Felectric=5Fmw=20for=20clarity=20and=20con?= =?UTF-8?q?sistency=20in=20current=20drive=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 24 +++++++-------------- source/fortran/heat_transport_variables.f90 | 4 ++-- tests/unit/test_current_drive.py | 12 +++++++---- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index ce6da97b7d..b214b47a6b 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1258,7 +1258,7 @@ def cudriv(self, output: bool): pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw # Wall plug power - heat_transport_variables.pinjwpfix = ( + heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw / current_drive_variables.eta_lowhyb_injector_wall_plug ) @@ -1273,7 +1273,7 @@ def cudriv(self, output: bool): pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw # Wall plug power - heat_transport_variables.pinjwpfix = ( + heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw / current_drive_variables.eta_ecrh_injector_wall_plug ) @@ -1283,16 +1283,6 @@ def cudriv(self, output: bool): current_drive_variables.eta_ecrh_injector_wall_plug ) - # the fixed auxiliary current - current_drive_variables.c_hcd_secondary_driven = ( - eta_cd_hcd_secondary - * ( - current_drive_variables.p_hcd_secondary_injected_mw - - current_drive_variables.p_hcd_secondary_extra_heat_mw - ) - * 1.0e6 - ) - elif current_drive_variables.i_hcd_secondary in [5, 8]: # Account for first orbit losses # (power due to particles that are ionised but not thermalised) [MW]: @@ -1328,7 +1318,9 @@ def cudriv(self, output: bool): current_drive_variables.pwpnb = ( pnbitotfix / current_drive_variables.eta_beam_injector_wall_plug ) # neutral beam wall plug power - heat_transport_variables.pinjwpfix = current_drive_variables.pwpnb + heat_transport_variables.p_hcd_secondary_electric_mw = ( + current_drive_variables.pwpnb + ) current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug ) @@ -1482,7 +1474,7 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_injected_electrons_mw = pinjemw1 + pinjemwfix current_drive_variables.p_hcd_injected_ions_mw = pinjimw1 + pinjimwfix heat_transport_variables.pinjwp = ( - pinjwp1 + heat_transport_variables.pinjwpfix + pinjwp1 + heat_transport_variables.p_hcd_secondary_electric_mw ) # Reset injected power to zero for ignited plasma (fudge) @@ -2060,8 +2052,8 @@ def cudriv(self, output: bool): po.ovarre( self.outfile, "Secondary fixed ECH wall plug power (MW)", - "(pinjwpfix)", - current_drive_variables.pinjwpfix, + "(p_hcd_secondary_electric_mw)", + current_drive_variables.p_hcd_secondary_electric_mw, "OP ", ) diff --git a/source/fortran/heat_transport_variables.f90 b/source/fortran/heat_transport_variables.f90 index 4406089039..eda58e1c4b 100644 --- a/source/fortran/heat_transport_variables.f90 +++ b/source/fortran/heat_transport_variables.f90 @@ -136,8 +136,8 @@ module heat_transport_variables real(dp) :: pinjwp !! injector wall plug power (MW) - real(dp) :: pinjwpfix - !! secondary injector wall plug power (MW) + real(dp) :: p_hcd_secondary_electric_mw + !! Secondary HCD system injector wall plug power (MW) real(dp) :: pnetelmw !! net electric power (MW) diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index e823c79f84..d7666bac3f 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -37,7 +37,7 @@ def current_drive(): class CudrivParam(NamedTuple): - pinjwpfix: Any = None + p_hcd_secondary_electric_mw: Any = None pinjwp: Any = None @@ -218,7 +218,7 @@ class CudrivParam(NamedTuple): "cudrivparam", ( CudrivParam( - pinjwpfix=0, + p_hcd_secondary_electric_mw=0, pinjwp=0, p_ecrh_injected_mw=0, pnbeam=0, @@ -308,7 +308,7 @@ class CudrivParam(NamedTuple): expected_bigq=0, ), CudrivParam( - pinjwpfix=0, + p_hcd_secondary_electric_mw=0, pinjwp=240.99200038011492, p_ecrh_injected_mw=120.49600019005746, pnbeam=0, @@ -412,7 +412,11 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): :type monkeypatch: _pytest.monkeypatch.monkeypatch """ - monkeypatch.setattr(heat_transport_variables, "pinjwpfix", cudrivparam.pinjwpfix) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_secondary_electric_mw", + cudrivparam.p_hcd_secondary_electric_mw, + ) monkeypatch.setattr(heat_transport_variables, "pinjwp", cudrivparam.pinjwp) From 20f52a68f3d6172974b125ce56d91168c5f3acf1 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 13:36:51 +0100 Subject: [PATCH 14/41] =?UTF-8?q?=F0=9F=94=84=20Rename=20variable=20plhybd?= =?UTF-8?q?=20to=20p=5Fhcd=5Flowhyb=5Finjected=5Ftotal=5Fmw=20for=20clarit?= =?UTF-8?q?y=20and=20consistency=20in=20current=20drive=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/costs.py | 6 ++- process/current_drive.py | 54 ++++++++++++++-------- process/stellarator.py | 4 +- source/fortran/current_drive_variables.f90 | 2 +- tests/unit/test_costs_1990.py | 12 +++-- tests/unit/test_current_drive.py | 12 +++-- 6 files changed, 58 insertions(+), 32 deletions(-) diff --git a/process/costs.py b/process/costs.py index 6ef2b1ffb0..e55274abf8 100644 --- a/process/costs.py +++ b/process/costs.py @@ -1820,13 +1820,15 @@ def acc223(self): self.c2232 = ( 1.0e-6 * cost_variables.uclh - * (1.0e6 * current_drive_variables.plhybd) ** exprf + * (1.0e6 * current_drive_variables.p_hcd_lowhyb_injected_total_mw) + ** exprf ) else: self.c2232 = ( 1.0e-6 * cost_variables.ucich - * (1.0e6 * current_drive_variables.plhybd) ** exprf + * (1.0e6 * current_drive_variables.p_hcd_lowhyb_injected_total_mw) + ** exprf ) if cost_variables.ifueltyp == 1: diff --git a/process/current_drive.py b/process/current_drive.py index b214b47a6b..9cb88de54e 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1110,7 +1110,7 @@ def cudriv(self, output: bool): current_drive_variables.p_ecrh_injected_mw = 0.0e0 current_drive_variables.pnbeam = 0.0e0 - current_drive_variables.plhybd = 0.0e0 + current_drive_variables.p_hcd_lowhyb_injected_total_mw = 0.0e0 current_drive_variables.c_beam_total = 0.0e0 beam_current_fix = 0.0e0 current_drive_variables.p_beam_orbit_loss_mw = 0.0e0 @@ -1120,7 +1120,7 @@ def cudriv(self, output: bool): pinjmwfix = 0.0 pinjimw1 = 0.0 pinjemw1 = 0.0 - pinjemwfix = 0.0 + p_hcd_secondary_electrons_mw = 0.0 pinjimwfix = 0.0 # To stop issues with input file we force @@ -1251,11 +1251,17 @@ def cudriv(self, output: bool): / physics_variables.plasma_current ) + # =========================================================== + + # Calculate the wall plug power for the secondary heating method # ============================================================== + # Lower hybrid cases if current_drive_variables.i_hcd_secondary in [1, 2, 4, 6]: # Injected power - pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw + p_hcd_secondary_electrons_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + ) # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( @@ -1268,9 +1274,14 @@ def cudriv(self, output: bool): current_drive_variables.eta_lowhyb_injector_wall_plug ) + # ========================================================== + + # Electron cyclotron cases elif current_drive_variables.i_hcd_secondary in [3, 7, 10, 12, 13]: # Injected power - pinjemwfix = current_drive_variables.p_hcd_secondary_injected_mw + p_hcd_secondary_electrons_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + ) # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( @@ -1283,10 +1294,14 @@ def cudriv(self, output: bool): current_drive_variables.eta_ecrh_injector_wall_plug ) + # ========================================================== + + # Neutral beam cases elif current_drive_variables.i_hcd_secondary in [5, 8]: # Account for first orbit losses # (power due to particles that are ionised but not thermalised) [MW]: # This includes a second order term in shinethrough*(first orbit loss) + current_drive_variables.f_p_beam_orbit_loss = min( 0.999, current_drive_variables.f_p_beam_orbit_loss ) # Should never be needed @@ -1311,7 +1326,7 @@ def cudriv(self, output: bool): # Power deposited pinjmwfix = pnbitotfix - nbshinemwfix - porbitlossmwfix pinjimwfix = pinjmwfix * current_drive_variables.f_p_beam_injected_ions - pinjemwfix = pinjmwfix * ( + p_hcd_secondary_electrons_mw = pinjmwfix * ( 1.0e0 - current_drive_variables.f_p_beam_injected_ions ) @@ -1335,10 +1350,12 @@ def cudriv(self, output: bool): * physics_variables.plasma_current ) + # ========================================================== + # LHCD or ICCD if current_drive_variables.i_hcd_primary in [1, 2, 4, 6]: # Injected power - current_drive_variables.plhybd = ( + current_drive_variables.p_hcd_lowhyb_injected_total_mw = ( 1.0e-6 * ( physics_variables.aux_current_fraction @@ -1349,11 +1366,11 @@ def cudriv(self, output: bool): + current_drive_variables.p_hcd_primary_extra_heat_mw ) pinjimw1 = 0.0e0 - pinjemw1 = current_drive_variables.plhybd + pinjemw1 = current_drive_variables.p_hcd_lowhyb_injected_total_mw # Wall plug power current_drive_variables.pwplh = ( - current_drive_variables.plhybd + current_drive_variables.p_hcd_lowhyb_injected_total_mw / current_drive_variables.eta_lowhyb_injector_wall_plug ) pinjwp1 = current_drive_variables.pwplh @@ -1363,9 +1380,8 @@ def cudriv(self, output: bool): current_drive_variables.eta_lowhyb_injector_wall_plug ) - # Normalised current drive efficiency gamma - gamrf = effrfss * (dene20 * physics_variables.rmajor) - current_drive_variables.eta_cd_norm_hcd_primary = gamrf + # =========================================================== + # ECCD elif current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: # Injected power (set to close to close the Steady-state current equilibrium) @@ -1467,11 +1483,13 @@ def cudriv(self, output: bool): # Total injected power # sum contributions from primary and secondary systems current_drive_variables.p_hcd_injected_total_mw = ( - pinjemw1 + pinjimw1 + pinjemwfix + pinjimwfix + pinjemw1 + pinjimw1 + p_hcd_secondary_electrons_mw + pinjimwfix ) pinjmw1 = pinjemw1 + pinjimw1 - pinjmwfix = pinjemwfix + pinjimwfix - current_drive_variables.p_hcd_injected_electrons_mw = pinjemw1 + pinjemwfix + pinjmwfix = p_hcd_secondary_electrons_mw + pinjimwfix + current_drive_variables.p_hcd_injected_electrons_mw = ( + pinjemw1 + p_hcd_secondary_electrons_mw + ) current_drive_variables.p_hcd_injected_ions_mw = pinjimw1 + pinjimwfix heat_transport_variables.pinjwp = ( pinjwp1 + heat_transport_variables.p_hcd_secondary_electric_mw @@ -1786,14 +1804,12 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) - if abs(current_drive_variables.plhybd) > 1.0e-8: - po.ovarre(self.outfile, "RF efficiency (A/W)", "(effrfss)", effrfss, "OP ") - po.ovarre(self.outfile, "RF gamma (10^20 A/W-m2)", "(gamrf)", gamrf, "OP ") + if abs(current_drive_variables.p_hcd_lowhyb_injected_total_mw) > 1.0e-8: po.ovarre( self.outfile, "Lower hybrid injected power (MW)", - "(plhybd)", - current_drive_variables.plhybd, + "(p_hcd_lowhyb_injected_total_mw)", + current_drive_variables.p_hcd_lowhyb_injected_total_mw, "OP ", ) po.ovarre( diff --git a/process/stellarator.py b/process/stellarator.py index 9f2a1ae178..72f1187b30 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -4958,12 +4958,12 @@ def stheat(self, output: bool): + current_drive_variables.p_hcd_injected_electrons_mw ) / current_drive_variables.eta_hcd_primary_injector_wall_plug elif stellarator_variables.isthtr == 2: - current_drive_variables.plhybd = ( + current_drive_variables.p_hcd_lowhyb_injected_total_mw = ( current_drive_variables.p_hcd_primary_extra_heat_mw ) current_drive_variables.p_hcd_injected_ions_mw = 0 current_drive_variables.p_hcd_injected_electrons_mw = ( - current_drive_variables.plhybd + current_drive_variables.p_hcd_lowhyb_injected_total_mw ) current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_lowhyb_injector_wall_plug diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 19434c583b..b8f6e51cd1 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -235,7 +235,7 @@ module current_drive_variables real(dp) :: f_c_plasma_internal !! plasma current fraction driven internally (Bootstrap + Diamagnetic + PS) - real(dp) :: plhybd + real(dp) :: p_hcd_lowhyb_injected_total_mw !! lower hybrid injection power (MW) real(dp) :: pnbeam diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 3cf212ef4e..6af3d1ed00 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -2883,7 +2883,7 @@ class Acc223Param(NamedTuple): fcdfuel: Any = None - plhybd: Any = None + p_hcd_lowhyb_injected_total_mw: Any = None i_hcd_primary: Any = None @@ -2946,7 +2946,7 @@ class Acc223Param(NamedTuple): ifueltyp=1, cdcost=0, fcdfuel=0.10000000000000001, - plhybd=0, + p_hcd_lowhyb_injected_total_mw=0, i_hcd_primary=10, p_ecrh_injected_mw=51.978447720428512, p_beam_injected_mw=0, @@ -2981,7 +2981,7 @@ class Acc223Param(NamedTuple): ifueltyp=1, cdcost=140.341808845157, fcdfuel=0.10000000000000001, - plhybd=0, + p_hcd_lowhyb_injected_total_mw=0, i_hcd_primary=10, p_ecrh_injected_mw=51.978447720428512, p_beam_injected_mw=0, @@ -3038,7 +3038,11 @@ def test_acc223(acc223param, monkeypatch, costs): monkeypatch.setattr(cost_variables, "fcdfuel", acc223param.fcdfuel) - monkeypatch.setattr(current_drive_variables, "plhybd", acc223param.plhybd) + monkeypatch.setattr( + current_drive_variables, + "p_hcd_lowhyb_injected_total_mw", + acc223param.p_hcd_lowhyb_injected_total_mw, + ) monkeypatch.setattr( current_drive_variables, "i_hcd_primary", acc223param.i_hcd_primary diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index d7666bac3f..37696797aa 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -45,7 +45,7 @@ class CudrivParam(NamedTuple): pnbeam: Any = None - plhybd: Any = None + p_hcd_lowhyb_injected_total_mw: Any = None c_beam_total: Any = None @@ -222,7 +222,7 @@ class CudrivParam(NamedTuple): pinjwp=0, p_ecrh_injected_mw=0, pnbeam=0, - plhybd=0, + p_hcd_lowhyb_injected_total_mw=0, c_beam_total=0, p_beam_orbit_loss_mw=0, i_hcd_primary=10, @@ -312,7 +312,7 @@ class CudrivParam(NamedTuple): pinjwp=240.99200038011492, p_ecrh_injected_mw=120.49600019005746, pnbeam=0, - plhybd=0, + p_hcd_lowhyb_injected_total_mw=0, c_beam_total=0, p_beam_orbit_loss_mw=0, i_hcd_primary=10, @@ -426,7 +426,11 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(current_drive_variables, "pnbeam", cudrivparam.pnbeam) - monkeypatch.setattr(current_drive_variables, "plhybd", cudrivparam.plhybd) + monkeypatch.setattr( + current_drive_variables, + "p_hcd_lowhyb_injected_total_mw", + cudrivparam.p_hcd_lowhyb_injected_total_mw, + ) monkeypatch.setattr( current_drive_variables, "c_beam_total", cudrivparam.c_beam_total From 0da8a515585a96623c165afa7b0839c215bcd54c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 13:39:58 +0100 Subject: [PATCH 15/41] =?UTF-8?q?=F0=9F=94=84=20Rename=20variable=20pnbeam?= =?UTF-8?q?=20to=20p=5Fhcd=5Fbeam=5Finjected=5Ftotal=5Fmw=20for=20clarity?= =?UTF-8?q?=20and=20consistency=20in=20current=20drive=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/costs.py | 2 +- process/current_drive.py | 8 ++++++-- process/stellarator.py | 16 +++++++++------- source/fortran/current_drive_variables.f90 | 2 +- tests/unit/test_current_drive.py | 12 ++++++++---- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/process/costs.py b/process/costs.py index e55274abf8..7a174be4a5 100644 --- a/process/costs.py +++ b/process/costs.py @@ -1837,7 +1837,7 @@ def acc223(self): # Account 223.3 : Neutral Beam - # self.c2233 = 1.0e-6 * cost_variables.ucnbi * (1.0e6*pnbeam)**exprf + # self.c2233 = 1.0e-6 * cost_variables.ucnbi * (1.0e6*p_hcd_beam_injected_total_mw)**exprf # #327 self.c2233 = ( diff --git a/process/current_drive.py b/process/current_drive.py index 9cb88de54e..d116f55e5a 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1109,7 +1109,7 @@ def cudriv(self, output: bool): """ current_drive_variables.p_ecrh_injected_mw = 0.0e0 - current_drive_variables.pnbeam = 0.0e0 + current_drive_variables.p_hcd_beam_injected_total_mw = 0.0e0 current_drive_variables.p_hcd_lowhyb_injected_total_mw = 0.0e0 current_drive_variables.c_beam_total = 0.0e0 beam_current_fix = 0.0e0 @@ -1274,6 +1274,10 @@ def cudriv(self, output: bool): current_drive_variables.eta_lowhyb_injector_wall_plug ) + current_drive_variables.p_hcd_lowhyb_injected_total_mw += ( + current_drive_variables.p_hcd_secondary_injected_mw + ) + # ========================================================== # Electron cyclotron cases @@ -1827,7 +1831,7 @@ def cudriv(self, output: bool): ) # MDK rearranged and added current_drive_variables.p_beam_shine_through_mw - # if (abs(current_drive_variables.pnbeam) > 1.0e-8) : + # if (abs(current_drive_variables.p_hcd_beam_injected_total_mw) > 1.0e-8) : if ( (current_drive_variables.i_hcd_primary == 5) or (current_drive_variables.i_hcd_primary == 8) diff --git a/process/stellarator.py b/process/stellarator.py index 72f1187b30..8c3444dac4 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -4215,7 +4215,7 @@ def stphys(self, output): # Calculate neutral beam slowing down effects # If ignited, then ignore beam fusion effects - if (current_drive_variables.pnbeam != 0.0e0) and ( + if (current_drive_variables.p_hcd_beam_injected_total_mw != 0.0e0) and ( physics_variables.ignite == 0 ): ( @@ -4978,7 +4978,7 @@ def stheat(self, output: bool): f_p_beam_injected_ions, current_drive_variables.f_p_beam_shine_through, ) = self.current_drive.culnbi() - current_drive_variables.pnbeam = ( + current_drive_variables.p_hcd_beam_injected_total_mw = ( current_drive_variables.p_hcd_primary_extra_heat_mw * (1 - current_drive_variables.f_p_beam_orbit_loss) ) @@ -4987,10 +4987,12 @@ def stheat(self, output: bool): * current_drive_variables.f_p_beam_orbit_loss ) current_drive_variables.p_hcd_injected_ions_mw = ( - current_drive_variables.pnbeam * f_p_beam_injected_ions + current_drive_variables.p_hcd_beam_injected_total_mw + * f_p_beam_injected_ions ) current_drive_variables.p_hcd_injected_electrons_mw = ( - current_drive_variables.pnbeam * (1 - f_p_beam_injected_ions) + current_drive_variables.p_hcd_beam_injected_total_mw + * (1 - f_p_beam_injected_ions) ) current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug @@ -5013,10 +5015,10 @@ def stheat(self, output: bool): # Calculate neutral beam current - if abs(current_drive_variables.pnbeam) > 1e-8: + if abs(current_drive_variables.p_hcd_beam_injected_total_mw) > 1e-8: current_drive_variables.c_beam_total = ( 1e-3 - * (current_drive_variables.pnbeam * 1e6) + * (current_drive_variables.p_hcd_beam_injected_total_mw * 1e6) / current_drive_variables.e_beam_kev ) else: @@ -5071,7 +5073,7 @@ def stheat(self, output: bool): current_drive_variables.bigq, ) - if abs(current_drive_variables.pnbeam) > 1e-8: + if abs(current_drive_variables.p_hcd_beam_injected_total_mw) > 1e-8: po.ovarre( self.outfile, "Neutral beam energy (KEV)", diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index b8f6e51cd1..5811bc58bf 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -238,7 +238,7 @@ module current_drive_variables real(dp) :: p_hcd_lowhyb_injected_total_mw !! lower hybrid injection power (MW) - real(dp) :: pnbeam + real(dp) :: p_hcd_beam_injected_total_mw !! neutral beam injection power (MW) real(dp) :: p_beam_orbit_loss_mw diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 37696797aa..375f5e4335 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -43,7 +43,7 @@ class CudrivParam(NamedTuple): p_ecrh_injected_mw: Any = None - pnbeam: Any = None + p_hcd_beam_injected_total_mw: Any = None p_hcd_lowhyb_injected_total_mw: Any = None @@ -221,7 +221,7 @@ class CudrivParam(NamedTuple): p_hcd_secondary_electric_mw=0, pinjwp=0, p_ecrh_injected_mw=0, - pnbeam=0, + p_hcd_beam_injected_total_mw=0, p_hcd_lowhyb_injected_total_mw=0, c_beam_total=0, p_beam_orbit_loss_mw=0, @@ -311,7 +311,7 @@ class CudrivParam(NamedTuple): p_hcd_secondary_electric_mw=0, pinjwp=240.99200038011492, p_ecrh_injected_mw=120.49600019005746, - pnbeam=0, + p_hcd_beam_injected_total_mw=0, p_hcd_lowhyb_injected_total_mw=0, c_beam_total=0, p_beam_orbit_loss_mw=0, @@ -424,7 +424,11 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): current_drive_variables, "p_ecrh_injected_mw", cudrivparam.p_ecrh_injected_mw ) - monkeypatch.setattr(current_drive_variables, "pnbeam", cudrivparam.pnbeam) + monkeypatch.setattr( + current_drive_variables, + "p_hcd_beam_injected_total_mw", + cudrivparam.p_hcd_beam_injected_total_mw, + ) monkeypatch.setattr( current_drive_variables, From 32fa0fe11f092131b323ff0bc270674650e0f739 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 13:58:42 +0100 Subject: [PATCH 16/41] =?UTF-8?q?=E2=9C=A8=20Introduce=20p=5Fhcd=5Fprimary?= =?UTF-8?q?=5Finjected=5Fmw=20variable=20and=20update=20calculations=20for?= =?UTF-8?q?=20primary=20heating=20power=20in=20current=20drive=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 54 +++++++++++++--------- source/fortran/current_drive_variables.f90 | 3 ++ 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index d116f55e5a..ae6beb1c10 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1225,8 +1225,9 @@ def cudriv(self, output: bool): # Calculate eta_cd_hcd_primary based on the selected model if current_drive_variables.i_hcd_primary.item() in hcd_models: - effrfss = hcd_models[current_drive_variables.i_hcd_primary.item()]() - current_drive_variables.eta_cd_hcd_primary = effrfss + current_drive_variables.eta_cd_hcd_primary = hcd_models[ + current_drive_variables.i_hcd_primary.item() + ]() # # Calculate the normalised current drive efficieny for the primary heating method current_drive_variables.eta_cd_norm_hcd_primary = ( @@ -1359,18 +1360,21 @@ def cudriv(self, output: bool): # LHCD or ICCD if current_drive_variables.i_hcd_primary in [1, 2, 4, 6]: # Injected power - current_drive_variables.p_hcd_lowhyb_injected_total_mw = ( + current_drive_variables.p_hcd_primary_injected_mw = ( 1.0e-6 * ( physics_variables.aux_current_fraction - current_drive_variables.f_c_plasma_hcd_secondary ) * physics_variables.plasma_current - / effrfss + / current_drive_variables.eta_cd_hcd_primary + current_drive_variables.p_hcd_primary_extra_heat_mw ) - pinjimw1 = 0.0e0 - pinjemw1 = current_drive_variables.p_hcd_lowhyb_injected_total_mw + + pinjemw1 = current_drive_variables.p_hcd_primary_injected_mw + current_drive_variables.p_hcd_lowhyb_injected_total_mw += ( + current_drive_variables.p_hcd_primary_injected_mw + ) # Wall plug power current_drive_variables.pwplh = ( @@ -1386,19 +1390,24 @@ def cudriv(self, output: bool): # =========================================================== - # ECCD + # Electron cyclotron cases + elif current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: # Injected power (set to close to close the Steady-state current equilibrium) - current_drive_variables.p_ecrh_injected_mw = ( + current_drive_variables.p_hcd_primary_injected_mw = ( 1.0e-6 * ( physics_variables.aux_current_fraction - current_drive_variables.f_c_plasma_hcd_secondary ) * physics_variables.plasma_current - / effrfss + / current_drive_variables.eta_cd_hcd_primary + current_drive_variables.p_hcd_primary_extra_heat_mw ) + + current_drive_variables.p_ecrh_injected_mw += ( + current_drive_variables.p_hcd_primary_injected_mw + ) pinjemw1 = current_drive_variables.p_ecrh_injected_mw # Wall plug power @@ -1412,19 +1421,18 @@ def cudriv(self, output: bool): current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ecrh_injector_wall_plug ) + + # =========================================================== + elif current_drive_variables.i_hcd_primary in [5, 8]: - eta_cd_norm_hcd_primary = ( - current_drive_variables.eta_cd_norm_hcd_primary - ) - # MDK. See Gitlab issue #248, and scanned note. - power1 = ( + current_drive_variables.p_hcd_primary_injected_mw = ( 1.0e-6 * ( physics_variables.aux_current_fraction - current_drive_variables.f_c_plasma_hcd_secondary ) * physics_variables.plasma_current - / eta_cd_norm_hcd_primary + / current_drive_variables.eta_cd_norm_hcd_primary + current_drive_variables.p_hcd_primary_extra_heat_mw ) @@ -1435,11 +1443,14 @@ def cudriv(self, output: bool): 0.999, current_drive_variables.f_p_beam_orbit_loss ) # Should never be needed - current_drive_variables.p_beam_injected_mw = power1 / ( - 1.0e0 - - current_drive_variables.f_p_beam_orbit_loss - + current_drive_variables.f_p_beam_orbit_loss - * current_drive_variables.f_p_beam_shine_through + current_drive_variables.p_beam_injected_mw = ( + current_drive_variables.p_hcd_primary_injected_mw + / ( + 1.0e0 + - current_drive_variables.f_p_beam_orbit_loss + + current_drive_variables.f_p_beam_orbit_loss + * current_drive_variables.f_p_beam_shine_through + ) ) # Shinethrough power (atoms that are not ionised) [MW]: @@ -1476,8 +1487,7 @@ def cudriv(self, output: bool): current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug ) - gamnb = eta_cd_norm_hcd_primary * (dene20 * physics_variables.rmajor) - current_drive_variables.eta_cd_norm_hcd_primary = gamnb + current_drive_variables.c_beam_total = ( 1.0e-3 * (current_drive_variables.p_beam_injected_mw * 1.0e6) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 5811bc58bf..2be5e0e73f 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -232,6 +232,9 @@ module current_drive_variables real(dp) :: p_hcd_secondary_injected_mw !! secondary total fixed auxiliary injected power (MW) + real(dp) :: p_hcd_primary_injected_mw + !! primary auxiliary injected power (MW) + real(dp) :: f_c_plasma_internal !! plasma current fraction driven internally (Bootstrap + Diamagnetic + PS) From edd5b9c7cc6a844121a4973b5dc39e512eb37a1b Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 14:17:21 +0100 Subject: [PATCH 17/41] =?UTF-8?q?=E2=9C=A8=20Add=20variables=20for=20ion?= =?UTF-8?q?=20cyclotron=20and=20electron=20Bernstein=20wave=20injection=20?= =?UTF-8?q?power=20in=20current=20drive=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 2 ++ source/fortran/current_drive_variables.f90 | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/process/current_drive.py b/process/current_drive.py index ae6beb1c10..c0253c6360 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1111,6 +1111,8 @@ def cudriv(self, output: bool): current_drive_variables.p_ecrh_injected_mw = 0.0e0 current_drive_variables.p_hcd_beam_injected_total_mw = 0.0e0 current_drive_variables.p_hcd_lowhyb_injected_total_mw = 0.0e0 + current_drive_variables.p_hcd_icrh_injected_total_mw = 0.0e0 + current_drive_variables.p_hcd_ebw_injected_total_mw = 0.0e0 current_drive_variables.c_beam_total = 0.0e0 beam_current_fix = 0.0e0 current_drive_variables.p_beam_orbit_loss_mw = 0.0e0 diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 2be5e0e73f..dc7e27c7cc 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -239,7 +239,13 @@ module current_drive_variables !! plasma current fraction driven internally (Bootstrap + Diamagnetic + PS) real(dp) :: p_hcd_lowhyb_injected_total_mw - !! lower hybrid injection power (MW) + !! Total lower hybrid injection power (MW) + + real(dp) :: p_hcd_icrh_injected_total_mw + !! Total ion cyclotron injection power (MW) + + real(dp) :: p_hcd_ebw_injected_total_mw + !! Total electron bernstein wave injection power (MW) real(dp) :: p_hcd_beam_injected_total_mw !! neutral beam injection power (MW) From 1ebbc029971dbd5b3a1e046f40e3a1145f9701c3 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 14:20:03 +0100 Subject: [PATCH 18/41] =?UTF-8?q?=E2=9C=A8=20Add=20injector=20wall=20plug?= =?UTF-8?q?=20efficiency=20variables=20for=20ion=20cyclotron=20and=20elect?= =?UTF-8?q?ron=20Bernstein=20wave=20in=20current=20drive=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/fortran/current_drive_variables.f90 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index dc7e27c7cc..a26d6511ee 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -126,6 +126,12 @@ module current_drive_variables real(dp) :: eta_lowhyb_injector_wall_plug !! lower hybrid wall plug to injector efficiency + real(dp) :: eta_icrh_injector_wall_plug + !! Ion cyclotron wall plug to injector efficiency + + real(dp) :: eta_ebw_injector_wall_plug + !! Electron bernstein wave wall plug to injector efficiency + real(dp) :: eta_beam_injector_wall_plug !! neutral beam wall plug to injector efficiency From c2a87b213b233e64c949339d224d39e816b3abf0 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 14:36:59 +0100 Subject: [PATCH 19/41] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20current?= =?UTF-8?q?=20drive=20calculations=20to=20introduce=20p=5Fhcd=5Fsecondary?= =?UTF-8?q?=5Fions=5Fmw=20and=20update=20injected=20power=20handling=20for?= =?UTF-8?q?=20ion=20cyclotron=20cases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 80 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index c0253c6360..8713669e32 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1123,7 +1123,7 @@ def cudriv(self, output: bool): pinjimw1 = 0.0 pinjemw1 = 0.0 p_hcd_secondary_electrons_mw = 0.0 - pinjimwfix = 0.0 + p_hcd_secondary_ions_mw = 0.0 # To stop issues with input file we force # zero secondary heating if no injection method @@ -1260,7 +1260,7 @@ def cudriv(self, output: bool): # ============================================================== # Lower hybrid cases - if current_drive_variables.i_hcd_secondary in [1, 2, 4, 6]: + if current_drive_variables.i_hcd_secondary in [1, 4, 6]: # Injected power p_hcd_secondary_electrons_mw = ( current_drive_variables.p_hcd_secondary_injected_mw @@ -1283,6 +1283,30 @@ def cudriv(self, output: bool): # ========================================================== + # Ion cyclotron cases + if current_drive_variables.i_hcd_secondary in [2]: + # Injected power + p_hcd_secondary_ions_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + ) + + # Wall plug power + heat_transport_variables.p_hcd_secondary_electric_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + / current_drive_variables.eta_icrh_injector_wall_plug + ) + + # Wall plug to injector efficiency + current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( + current_drive_variables.eta_icrh_injector_wall_plug + ) + + current_drive_variables.p_hcd_icrh_injected_total_mw += ( + current_drive_variables.p_hcd_secondary_injected_mw + ) + + # ========================================================== + # Electron cyclotron cases elif current_drive_variables.i_hcd_secondary in [3, 7, 10, 12, 13]: # Injected power @@ -1332,7 +1356,9 @@ def cudriv(self, output: bool): # Power deposited pinjmwfix = pnbitotfix - nbshinemwfix - porbitlossmwfix - pinjimwfix = pinjmwfix * current_drive_variables.f_p_beam_injected_ions + p_hcd_secondary_ions_mw = ( + pinjmwfix * current_drive_variables.f_p_beam_injected_ions + ) p_hcd_secondary_electrons_mw = pinjmwfix * ( 1.0e0 - current_drive_variables.f_p_beam_injected_ions ) @@ -1359,8 +1385,8 @@ def cudriv(self, output: bool): # ========================================================== - # LHCD or ICCD - if current_drive_variables.i_hcd_primary in [1, 2, 4, 6]: + # Lower hybrid cases + if current_drive_variables.i_hcd_primary in [1, 4, 6]: # Injected power current_drive_variables.p_hcd_primary_injected_mw = ( 1.0e-6 @@ -1392,6 +1418,39 @@ def cudriv(self, output: bool): # =========================================================== + # Ion cyclotron cases + if current_drive_variables.i_hcd_primary in [2]: + # Injected power + current_drive_variables.p_hcd_primary_injected_mw = ( + 1.0e-6 + * ( + physics_variables.aux_current_fraction + - current_drive_variables.f_c_plasma_hcd_secondary + ) + * physics_variables.plasma_current + / current_drive_variables.eta_cd_hcd_primary + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + + pinjemw1 = current_drive_variables.p_hcd_primary_injected_mw + current_drive_variables.p_hcd_icrh_injected_total_mw += ( + current_drive_variables.p_hcd_primary_injected_mw + ) + + # Wall plug power + current_drive_variables.pwplh = ( + current_drive_variables.p_hcd_icrh_injected_total_mw + / current_drive_variables.eta_icrh_injector_wall_plug + ) + pinjwp1 = current_drive_variables.pwplh + + # Wall plug to injector efficiency + current_drive_variables.eta_hcd_primary_injector_wall_plug = ( + current_drive_variables.eta_icrh_injector_wall_plug + ) + + # =========================================================== + # Electron cyclotron cases elif current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: @@ -1499,14 +1558,19 @@ def cudriv(self, output: bool): # Total injected power # sum contributions from primary and secondary systems current_drive_variables.p_hcd_injected_total_mw = ( - pinjemw1 + pinjimw1 + p_hcd_secondary_electrons_mw + pinjimwfix + pinjemw1 + + pinjimw1 + + p_hcd_secondary_electrons_mw + + p_hcd_secondary_ions_mw ) pinjmw1 = pinjemw1 + pinjimw1 - pinjmwfix = p_hcd_secondary_electrons_mw + pinjimwfix + pinjmwfix = p_hcd_secondary_electrons_mw + p_hcd_secondary_ions_mw current_drive_variables.p_hcd_injected_electrons_mw = ( pinjemw1 + p_hcd_secondary_electrons_mw ) - current_drive_variables.p_hcd_injected_ions_mw = pinjimw1 + pinjimwfix + current_drive_variables.p_hcd_injected_ions_mw = ( + pinjimw1 + p_hcd_secondary_ions_mw + ) heat_transport_variables.pinjwp = ( pinjwp1 + heat_transport_variables.p_hcd_secondary_electric_mw ) From f8af8d23e4e9a4c24a0fca69c6d97251fdc40387 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 14:39:59 +0100 Subject: [PATCH 20/41] =?UTF-8?q?=F0=9F=94=84=20Rename=20pinjwp=20to=20p?= =?UTF-8?q?=5Fhcd=5Felectric=5Ftotal=5Fmw=20for=20clarity=20and=20update?= =?UTF-8?q?=20related=20calculations=20in=20current=20drive=20and=20heat?= =?UTF-8?q?=20transport=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/csv_output_large_tokamak_MFILE.DAT | 2 +- examples/data/large_tokamak_1_MFILE.DAT | 2 +- examples/data/large_tokamak_2_MFILE.DAT | 2 +- examples/data/large_tokamak_3_MFILE.DAT | 2 +- examples/data/large_tokamak_4_MFILE.DAT | 2 +- examples/data/scan_MFILE.DAT | 18 ++++----- process/costs.py | 2 +- process/current_drive.py | 4 +- process/ife.py | 16 ++++---- process/io/sankey_funcs.py | 22 +++++++---- process/power.py | 22 ++++++----- process/stellarator.py | 6 +-- source/fortran/heat_transport_variables.f90 | 2 +- .../data/large_tokamak_1_MFILE.DAT | 2 +- .../data/large_tokamak_2_MFILE.DAT | 2 +- .../data/large_tokamak_3_MFILE.DAT | 2 +- .../data/large_tokamak_4_MFILE.DAT | 2 +- .../integration/data/large_tokamak_MFILE.DAT | 2 +- tests/integration/data/scan_2D_MFILE.DAT | 30 +++++++-------- tests/integration/data/scan_MFILE.DAT | 18 ++++----- tests/unit/data/large_tokamak_MFILE.DAT | 2 +- tests/unit/test_costs_1990.py | 20 ++++++---- tests/unit/test_current_drive.py | 22 +++++++---- tests/unit/test_ife.py | 38 +++++++++++++------ tests/unit/test_power.py | 36 ++++++++++++------ 25 files changed, 163 insertions(+), 115 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index b9cbd5faaf..aab4a0f9bc 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -1158,7 +1158,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1348E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5043E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5043E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.8742E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index e69ca39509..423b100017 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -1153,7 +1153,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.6029E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.6029E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9053E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 76c83a6731..e32b11fe49 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -1153,7 +1153,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.6029E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.6029E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9053E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 0a09b73653..1acaade280 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -1153,7 +1153,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.6029E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.6029E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9053E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index 71d77629a8..7724240462 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -1153,7 +1153,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.6029E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.6029E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9053E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 8c7ce00364..ae0cc0deb8 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -980,7 +980,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -1975,7 +1975,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -2970,7 +2970,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -3965,7 +3965,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -4960,7 +4960,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -5955,7 +5955,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -6950,7 +6950,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -7945,7 +7945,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -8940,7 +8940,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/process/costs.py b/process/costs.py index 7a174be4a5..5b02965561 100644 --- a/process/costs.py +++ b/process/costs.py @@ -2473,7 +2473,7 @@ def acc26(self): if cost_variables.ireactor == 0: pwrrej = ( physics_variables.fusion_power - + heat_transport_variables.pinjwp + + heat_transport_variables.p_hcd_electric_total_mw + tfcoil_variables.tfcmw ) else: diff --git a/process/current_drive.py b/process/current_drive.py index 8713669e32..e6110cbfcf 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1571,13 +1571,13 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_injected_ions_mw = ( pinjimw1 + p_hcd_secondary_ions_mw ) - heat_transport_variables.pinjwp = ( + heat_transport_variables.p_hcd_electric_total_mw = ( pinjwp1 + heat_transport_variables.p_hcd_secondary_electric_mw ) # Reset injected power to zero for ignited plasma (fudge) if physics_variables.ignite == 1: - heat_transport_variables.pinjwp = 0.0e0 + heat_transport_variables.p_hcd_electric_total_mw = 0.0e0 # Ratio of fusion to input (injection+ohmic) power if ( diff --git a/process/ife.py b/process/ife.py index 3391d558be..6daa2aff69 100644 --- a/process/ife.py +++ b/process/ife.py @@ -1954,11 +1954,13 @@ def ifepw1(self): # Wall plug driver power (MW) - heat_transport_variables.pinjwp = pdrvmw / ife_variables.etadrv + heat_transport_variables.p_hcd_electric_total_mw = pdrvmw / ife_variables.etadrv # Waste driver power (MW) - heat_transport_variables.pinjht = heat_transport_variables.pinjwp - pdrvmw + heat_transport_variables.pinjht = ( + heat_transport_variables.p_hcd_electric_total_mw - pdrvmw + ) # Cryogenic power (MW) # Cryogenic temperature is assumed to be 4.5K @@ -2053,8 +2055,8 @@ def ifepw2(self, output: bool = False): process_output.ovarre( self.outfile, "Driver wall plug power (MW)", - "(pinjwp)", - heat_transport_variables.pinjwp, + "(p_hcd_electric_total_mw)", + heat_transport_variables.p_hcd_electric_total_mw, ) process_output.ovarre( self.outfile, @@ -2175,7 +2177,7 @@ def ifeacp(self, output: bool = False): + ife_variables.tfacmw + (ife_variables.htpmw_ife * ife_variables.reprat / 6.0) + heat_transport_variables.trithtmw - + heat_transport_variables.pinjwp + + heat_transport_variables.p_hcd_electric_total_mw + basemw + (buildings_variables.efloor * pmwpm2) + ife_variables.lipmw @@ -2216,8 +2218,8 @@ def ifeacp(self, output: bool = False): process_output.ovarre( self.outfile, "Driver power supplies (MW)", - "(pinjwp)", - heat_transport_variables.pinjwp, + "(p_hcd_electric_total_mw)", + heat_transport_variables.p_hcd_electric_total_mw, ) process_output.ovarre( self.outfile, diff --git a/process/io/sankey_funcs.py b/process/io/sankey_funcs.py index fef61d37b8..f66585cf55 100644 --- a/process/io/sankey_funcs.py +++ b/process/io/sankey_funcs.py @@ -635,7 +635,9 @@ def plot_sankey(mfilename="MFILE.DAT"): # Plot simplified power flow Sankey Dia # Energy required for rest of power plant (MW) pcoresystems = crypmw + fachtmw + tfacpd + trithtmw + vachtmw + pfwpmw + ppumpmw - pinjwp = m_file.data["pinjwp"].get_scan(-1) # injector wall plug power (MW) + p_hcd_electric_total_mw = m_file.data["p_hcd_electric_total_mw"].get_scan( + -1 + ) # injector wall plug power (MW) htpmw = m_file.data["htpmw"].get_scan( -1 ) # heat transport system electrical pump power (MW) @@ -762,13 +764,13 @@ def plot_sankey(mfilename="MFILE.DAT"): # Plot simplified power flow Sankey Dia # -------------------------------- RECIRCULATING POWER - 5 -------------------------------- # Recirculated power, -Core Systems, -Heating System - recirc = [precircmw, -pcoresystems - htpmw, -pinjwp + ppumpmw] + recirc = [precircmw, -pcoresystems - htpmw, -p_hcd_electric_total_mw + ppumpmw] # Check if difference >2 between recirculated power and the output sum if sum(recirc) ** 2 > 2: print( "Recirc. Power Balance", precircmw, - -pcoresystems + ppumpmw - pinjwp - htpmw, + -pcoresystems + ppumpmw - p_hcd_electric_total_mw - htpmw, ) sankey.add( flows=recirc, @@ -783,9 +785,9 @@ def plot_sankey(mfilename="MFILE.DAT"): # Plot simplified power flow Sankey Dia # HCD: Heating system, -Plasma heating, -losses hcd = [ - pinjwp - ppumpmw, + p_hcd_electric_total_mw - ppumpmw, -p_hcd_injected_total_mw, - -pinjwp + p_hcd_injected_total_mw + ppumpmw, + -p_hcd_electric_total_mw + p_hcd_injected_total_mw + ppumpmw, ] sankey.add( flows=hcd, @@ -860,12 +862,12 @@ def plot_sankey(mfilename="MFILE.DAT"): # Plot simplified power flow Sankey Dia if pnetelmw >= 1: t.set_position(( pos[0] + 0.15, - pos[1] + 0.5 * (pinjwp / totalplasma) + 0.2, + pos[1] + 0.5 * (p_hcd_electric_total_mw / totalplasma) + 0.2, )) if pnetelmw < 1: t.set_position(( pos[0] + 0.15, - pos[1] + 0.5 * (pinjwp / totalplasma) + 0.2, + pos[1] + 0.5 * (p_hcd_electric_total_mw / totalplasma) + 0.2, )) if t == diagrams[6].texts[1]: # Plasma Heating t.set_horizontalalignment("left") @@ -878,6 +880,10 @@ def plot_sankey(mfilename="MFILE.DAT"): # Plot simplified power flow Sankey Dia t.set_position(( pos[0] + 0.15, pos[1] - - 0.5 * ((pinjwp - p_hcd_injected_total_mw) / totalplasma) + - 0.5 + * ( + (p_hcd_electric_total_mw - p_hcd_injected_total_mw) + / totalplasma + ) - 0.2, )) diff --git a/process/power.py b/process/power.py index 58d8d5f41a..0f77888a3b 100644 --- a/process/power.py +++ b/process/power.py @@ -441,7 +441,9 @@ def acpow(self, output: bool): ppfmw = ppfmw + heat_transport_variables.peakmva # Power to plasma heating supplies, MW - pheatingmw = heat_transport_variables.pinjwp # Should be zero if ignite==1 + pheatingmw = ( + heat_transport_variables.p_hcd_electric_total_mw + ) # Should be zero if ignite==1 # Power to cryogenic comp. motors, MW crymw = heat_transport_variables.crypmw @@ -790,15 +792,15 @@ def power1(self): # Secondary heat (some of it... rest calculated in POWER2) # Wall plug injection power # MDK - # heat_transport_variables.pinjwp = (current_drive_variables.p_hcd_injected_total_mw + current_drive_variables.p_beam_orbit_loss_mw + physics_variables.p_fw_alpha_mw)/eta_hcd_primary_injector_wall_plug - # heat_transport_variables.pinjwp calculated in current_drive.f90 + # heat_transport_variables.p_hcd_electric_total_mw = (current_drive_variables.p_hcd_injected_total_mw + current_drive_variables.p_beam_orbit_loss_mw + physics_variables.p_fw_alpha_mw)/eta_hcd_primary_injector_wall_plug + # heat_transport_variables.p_hcd_electric_total_mw calculated in current_drive.f90 # Waste injection power if physics_variables.ignite == 0: # MDK - # pinjht = heat_transport_variables.pinjwp - current_drive_variables.p_hcd_injected_total_mw - current_drive_variables.p_beam_orbit_loss_mw - physics_variables.p_fw_alpha_mw + # pinjht = heat_transport_variables.p_hcd_electric_total_mw - current_drive_variables.p_hcd_injected_total_mw - current_drive_variables.p_beam_orbit_loss_mw - physics_variables.p_fw_alpha_mw heat_transport_variables.pinjht = ( - heat_transport_variables.pinjwp + heat_transport_variables.p_hcd_electric_total_mw - current_drive_variables.p_hcd_injected_total_mw ) else: @@ -944,7 +946,7 @@ def power2(self, output: bool): # Total recirculating power heat_transport_variables.precircmw = ( self.pcoresystems - + heat_transport_variables.pinjwp + + heat_transport_variables.p_hcd_electric_total_mw + heat_transport_variables.htpmw ) @@ -1918,8 +1920,8 @@ def power2(self, output: bool): po.ovarrf( self.outfile, "Electric power for heating and current drive (MW)", - "(pinjwp)", - heat_transport_variables.pinjwp, + "(p_hcd_electric_total_mw)", + heat_transport_variables.p_hcd_electric_total_mw, "OP ", ) po.ovarrf( @@ -1971,7 +1973,7 @@ def power2(self, output: bool): ) total_plant_power = ( heat_transport_variables.pnetelmw - + heat_transport_variables.pinjwp + + heat_transport_variables.p_hcd_electric_total_mw + heat_transport_variables.htpmw + heat_transport_variables.vachtmw + heat_transport_variables.trithtmw @@ -2179,7 +2181,7 @@ def power3(self, output: bool): heat_transport_variables.pinjmax / current_drive_variables.eta_hcd_primary_injector_wall_plug ) - p_hcd[3] = heat_transport_variables.pinjwp + p_hcd[3] = heat_transport_variables.p_hcd_electric_total_mw p_hcd[4] = ( heat_transport_variables.pinjmax / current_drive_variables.eta_hcd_primary_injector_wall_plug diff --git a/process/stellarator.py b/process/stellarator.py index 8c3444dac4..ff6d085c3a 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -4953,7 +4953,7 @@ def stheat(self, output: bool): current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ecrh_injector_wall_plug ) - current_drive_variables.pinjwp = ( + current_drive_variables.p_hcd_electric_total_mw = ( current_drive_variables.p_hcd_injected_ions_mw + current_drive_variables.p_hcd_injected_electrons_mw ) / current_drive_variables.eta_hcd_primary_injector_wall_plug @@ -4968,7 +4968,7 @@ def stheat(self, output: bool): current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_lowhyb_injector_wall_plug ) - current_drive_variables.pinjwp = ( + current_drive_variables.p_hcd_electric_total_mw = ( current_drive_variables.p_hcd_injected_ions_mw + current_drive_variables.p_hcd_injected_electrons_mw ) / current_drive_variables.eta_hcd_primary_injector_wall_plug @@ -4997,7 +4997,7 @@ def stheat(self, output: bool): current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug ) - current_drive_variables.pinjwp = ( + current_drive_variables.p_hcd_electric_total_mw = ( current_drive_variables.p_hcd_injected_ions_mw + current_drive_variables.p_hcd_injected_electrons_mw ) / current_drive_variables.eta_hcd_primary_injector_wall_plug diff --git a/source/fortran/heat_transport_variables.f90 b/source/fortran/heat_transport_variables.f90 index eda58e1c4b..beed15f6f3 100644 --- a/source/fortran/heat_transport_variables.f90 +++ b/source/fortran/heat_transport_variables.f90 @@ -133,7 +133,7 @@ module heat_transport_variables real(dp) :: pinjmax !! maximum injector power during pulse (heating and ramp-up/down phase) (MW) - real(dp) :: pinjwp + real(dp) :: p_hcd_electric_total_mw !! injector wall plug power (MW) real(dp) :: p_hcd_secondary_electric_mw diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 0cbfb02e84..a05d6be892 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -1152,7 +1152,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.6029E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.6029E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9053E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 9b774113da..9123ad85c6 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -1153,7 +1153,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.6029E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.6029E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9053E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 59ae41cc9e..711c594bf8 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -1153,7 +1153,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.6029E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.6029E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9053E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 5cab5bfafb..3ac4152855 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -1153,7 +1153,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.6029E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.6029E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9053E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index c81cea6b60..2f61d026ad 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -1156,7 +1156,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1713E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5942E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5942E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9007E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 864b7c3f38..c7d8555210 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -1154,7 +1154,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1424E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0069E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.8762E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -2317,7 +2317,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1614E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0684E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.8935E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -3480,7 +3480,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1722E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0930E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5112E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5112E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9047E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -4643,7 +4643,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1752E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.1139E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9072E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -5806,7 +5806,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1784E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.1204E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9089E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -6969,7 +6969,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1716E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0955E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9016E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -8132,7 +8132,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1758E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.1093E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9051E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -9295,7 +9295,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1789E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.1211E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9091E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -10458,7 +10458,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1711E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.1001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9028E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -11621,7 +11621,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1847E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.1424E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9149E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -12784,7 +12784,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1971E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.1769E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9262E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -13947,7 +13947,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1962E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.1711E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9243E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -15110,7 +15110,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.2076E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.2066E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9345E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -16273,7 +16273,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.2189E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.2438E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9458E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -17436,7 +17436,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.2309E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.2830E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5000E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5000E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9577E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 74537d22ff..37dfd18798 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -980,7 +980,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -1975,7 +1975,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -2970,7 +2970,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -3965,7 +3965,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -4960,7 +4960,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -5955,7 +5955,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -6950,7 +6950,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -7945,7 +7945,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 @@ -8940,7 +8940,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.6502E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 5.0000E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 5.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.2750E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.2750E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 2.3440E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 30a964599c..03ac88a726 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -1156,7 +1156,7 @@ Total_(MW)______________________________________________________________ ______________________________ 2.1713E+03 Net_electric_power_output(MW)___________________________________________ (pnetelmw.)___________________ 4.0001E+02 Required_Net_electric_power_output(MW)__________________________________ (pnetelin)____________________ 4.0000E+02 - Electric_power_for_heating_and_current_drive_(MW)_______________________ (pinjwp)______________________ 1.5942E+02 + Electric_power_for_heating_and_current_drive_(MW)_______________________ (p_hcd_electric_total_mw)______________________ 1.5942E+02 Electric_power_for_primary_coolant_pumps_(MW)___________________________ (htpmw)_______________________ 1.9007E+02 Electric_power_for_vacuum_pumps_(MW)____________________________________ (vachtmw)_____________________ 5.0000E-01 Electric_power_for_tritium_plant_(MW)___________________________________ (trithtmw)____________________ 1.5000E+01 diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 6af3d1ed00..63e1526b3a 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -602,7 +602,7 @@ def acc26_param(**kwargs): defaults = { "ireactor": 0, "fusion_power": 2000.0, - "pinjwp": 250.0, + "p_hcd_electric_total_mw": 250.0, "tfcmw": 50.0, "pthermmw": htv.pthermmw, "pgrossmw": htv.pgrossmw, @@ -627,7 +627,7 @@ def acc26_params(): acc26_param( ireactor=1, fusion_power=fortran.physics_variables.fusion_power, - pinjwp=htv.pinjwp, + p_hcd_electric_total_mw=htv.p_hcd_electric_total_mw, tfcmw=fortran.tfcoil_variables.tfcmw, pthermmw=3000.0, pgrossmw=700.0, @@ -655,7 +655,9 @@ def acc26_fix(request, monkeypatch, costs): monkeypatch.setattr( fortran.physics_variables, "fusion_power", param["fusion_power"] ) - monkeypatch.setattr(htv, "pinjwp", param["pinjwp"]) + monkeypatch.setattr( + htv, "p_hcd_electric_total_mw", param["p_hcd_electric_total_mw"] + ) monkeypatch.setattr(fortran.tfcoil_variables, "tfcmw", param["tfcmw"]) monkeypatch.setattr(htv, "pthermmw", param["pthermmw"]) monkeypatch.setattr(htv, "pgrossmw", param["pgrossmw"]) @@ -5147,7 +5149,7 @@ class Acc26Param(NamedTuple): pthermmw: Any = None - pinjwp: Any = None + p_hcd_electric_total_mw: Any = None pgrossmw: Any = None @@ -5168,7 +5170,7 @@ class Acc26Param(NamedTuple): uchrs=87900000, lsa=2, pthermmw=2620.2218111502593, - pinjwp=129.94611930107126, + p_hcd_electric_total_mw=129.94611930107126, pgrossmw=982.58317918134742, fusion_power=1985.785106643267, tfcmw=0, @@ -5180,7 +5182,7 @@ class Acc26Param(NamedTuple): uchrs=87900000, lsa=2, pthermmw=2619.4223856129224, - pinjwp=129.94611930107126, + p_hcd_electric_total_mw=129.94611930107126, pgrossmw=982.28339460484608, fusion_power=1985.1653095257811, tfcmw=0, @@ -5210,7 +5212,11 @@ def test_acc26_rut(acc26param, monkeypatch, costs): monkeypatch.setattr(heat_transport_variables, "pthermmw", acc26param.pthermmw) - monkeypatch.setattr(heat_transport_variables, "pinjwp", acc26param.pinjwp) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_electric_total_mw", + acc26param.p_hcd_electric_total_mw, + ) monkeypatch.setattr(heat_transport_variables, "pgrossmw", acc26param.pgrossmw) diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 375f5e4335..aeedecda7d 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -39,7 +39,7 @@ def current_drive(): class CudrivParam(NamedTuple): p_hcd_secondary_electric_mw: Any = None - pinjwp: Any = None + p_hcd_electric_total_mw: Any = None p_ecrh_injected_mw: Any = None @@ -195,7 +195,7 @@ class CudrivParam(NamedTuple): outfile: Any = None - expected_pinjwp: Any = None + expected_p_hcd_electric_total_mw: Any = None expected_p_ecrh_injected_mw: Any = None @@ -219,7 +219,7 @@ class CudrivParam(NamedTuple): ( CudrivParam( p_hcd_secondary_electric_mw=0, - pinjwp=0, + p_hcd_electric_total_mw=0, p_ecrh_injected_mw=0, p_hcd_beam_injected_total_mw=0, p_hcd_lowhyb_injected_total_mw=0, @@ -297,7 +297,7 @@ class CudrivParam(NamedTuple): startupratio=1, iprint=0, outfile=11, - expected_pinjwp=240.99200038011492, + expected_p_hcd_electric_total_mw=240.99200038011492, expected_p_ecrh_injected_mw=120.49600019005746, expected_gamcd=0.30000000000000004, expected_etacd=0.5, @@ -309,7 +309,7 @@ class CudrivParam(NamedTuple): ), CudrivParam( p_hcd_secondary_electric_mw=0, - pinjwp=240.99200038011492, + p_hcd_electric_total_mw=240.99200038011492, p_ecrh_injected_mw=120.49600019005746, p_hcd_beam_injected_total_mw=0, p_hcd_lowhyb_injected_total_mw=0, @@ -387,7 +387,7 @@ class CudrivParam(NamedTuple): startupratio=1, iprint=0, outfile=11, - expected_pinjwp=240.99200038011492, + expected_p_hcd_electric_total_mw=240.99200038011492, expected_p_ecrh_injected_mw=120.49600019005746, expected_gamcd=0.30000000000000004, expected_etacd=0.5, @@ -418,7 +418,11 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): cudrivparam.p_hcd_secondary_electric_mw, ) - monkeypatch.setattr(heat_transport_variables, "pinjwp", cudrivparam.pinjwp) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_electric_total_mw", + cudrivparam.p_hcd_electric_total_mw, + ) monkeypatch.setattr( current_drive_variables, "p_ecrh_injected_mw", cudrivparam.p_ecrh_injected_mw @@ -700,7 +704,9 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): current_drive.cudriv(output=False) - assert heat_transport_variables.pinjwp == pytest.approx(cudrivparam.expected_pinjwp) + assert heat_transport_variables.p_hcd_electric_total_mw == pytest.approx( + cudrivparam.expected_p_hcd_electric_total_mw + ) assert current_drive_variables.p_ecrh_injected_mw == pytest.approx( cudrivparam.expected_p_ecrh_injected_mw diff --git a/tests/unit/test_ife.py b/tests/unit/test_ife.py index 8389090913..e7ed06b48f 100644 --- a/tests/unit/test_ife.py +++ b/tests/unit/test_ife.py @@ -2039,7 +2039,7 @@ class Ifepw1Param(NamedTuple): pthermmw: Any = None pfwdiv: Any = None nphx: Any = None - pinjwp: Any = None + p_hcd_electric_total_mw: Any = None pinjht: Any = None crypmw: Any = None helpow: Any = None @@ -2053,7 +2053,7 @@ class Ifepw1Param(NamedTuple): expected_pthermmw: Any = None expected_pfwdiv: Any = None expected_nphx: Any = None - expected_pinjwp: Any = None + expected_p_hcd_electric_total_mw: Any = None expected_pinjht: Any = None expected_crypmw: Any = None expected_helpow: Any = None @@ -2072,7 +2072,7 @@ class Ifepw1Param(NamedTuple): pthermmw=0, pfwdiv=0, nphx=0, - pinjwp=0, + p_hcd_electric_total_mw=0, pinjht=0, crypmw=0, helpow=0, @@ -2086,7 +2086,7 @@ class Ifepw1Param(NamedTuple): expected_pthermmw=2532.2219999999998, expected_pfwdiv=607.73327999999992, expected_nphx=3, - expected_pinjwp=81.914893617021278, + expected_p_hcd_electric_total_mw=81.914893617021278, expected_pinjht=58.814893617021283, expected_crypmw=10, expected_helpow=20277.29636048527, @@ -2118,7 +2118,11 @@ def test_ifepw1(ifepw1param, monkeypatch, ife): monkeypatch.setattr(heat_transport_variables, "pthermmw", ifepw1param.pthermmw) monkeypatch.setattr(heat_transport_variables, "pfwdiv", ifepw1param.pfwdiv) monkeypatch.setattr(heat_transport_variables, "nphx", ifepw1param.nphx) - monkeypatch.setattr(heat_transport_variables, "pinjwp", ifepw1param.pinjwp) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_electric_total_mw", + ifepw1param.p_hcd_electric_total_mw, + ) monkeypatch.setattr(heat_transport_variables, "pinjht", ifepw1param.pinjht) monkeypatch.setattr(heat_transport_variables, "crypmw", ifepw1param.crypmw) monkeypatch.setattr(heat_transport_variables, "helpow", ifepw1param.helpow) @@ -2141,7 +2145,9 @@ def test_ifepw1(ifepw1param, monkeypatch, ife): ) assert heat_transport_variables.pfwdiv == pytest.approx(ifepw1param.expected_pfwdiv) assert heat_transport_variables.nphx == pytest.approx(ifepw1param.expected_nphx) - assert heat_transport_variables.pinjwp == pytest.approx(ifepw1param.expected_pinjwp) + assert heat_transport_variables.p_hcd_electric_total_mw == pytest.approx( + ifepw1param.expected_p_hcd_electric_total_mw + ) assert heat_transport_variables.pinjht == pytest.approx(ifepw1param.expected_pinjht) assert heat_transport_variables.crypmw == pytest.approx(ifepw1param.expected_crypmw) assert heat_transport_variables.helpow == pytest.approx(ifepw1param.expected_helpow) @@ -2575,7 +2581,7 @@ class IfeacpParam(NamedTuple): crypmw: Any = None vachtmw: Any = None trithtmw: Any = None - pinjwp: Any = None + p_hcd_electric_total_mw: Any = None fcsht: Any = None tlvpmw: Any = None tdspmw: Any = None @@ -2600,7 +2606,7 @@ class IfeacpParam(NamedTuple): crypmw=10, vachtmw=0.5, trithtmw=15, - pinjwp=81.914893617021278, + p_hcd_electric_total_mw=81.914893617021278, fcsht=0, tlvpmw=0, tdspmw=0.01, @@ -2634,7 +2640,11 @@ def test_ifeacp(ifeacpparam, monkeypatch, ife): monkeypatch.setattr(heat_transport_variables, "crypmw", ifeacpparam.crypmw) monkeypatch.setattr(heat_transport_variables, "vachtmw", ifeacpparam.vachtmw) monkeypatch.setattr(heat_transport_variables, "trithtmw", ifeacpparam.trithtmw) - monkeypatch.setattr(heat_transport_variables, "pinjwp", ifeacpparam.pinjwp) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_electric_total_mw", + ifeacpparam.p_hcd_electric_total_mw, + ) monkeypatch.setattr(heat_transport_variables, "fcsht", ifeacpparam.fcsht) monkeypatch.setattr(heat_transport_variables, "tlvpmw", ifeacpparam.tlvpmw) monkeypatch.setattr(ife_variables, "tdspmw", ifeacpparam.tdspmw) @@ -2827,7 +2837,7 @@ class Ifepw2Param(NamedTuple): precircmw: Any = None pacpmw: Any = None pnetelmw: Any = None - pinjwp: Any = None + p_hcd_electric_total_mw: Any = None pfwdiv: Any = None nphx: Any = None tdspmw: Any = None @@ -2866,7 +2876,7 @@ class Ifepw2Param(NamedTuple): precircmw=0, pacpmw=141.11271036807165, pnetelmw=0, - pinjwp=81.914893617021278, + p_hcd_electric_total_mw=81.914893617021278, pfwdiv=607.73327999999992, nphx=3, tdspmw=0.01, @@ -2918,7 +2928,11 @@ def test_ifepw2(ifepw2param, monkeypatch, ife): monkeypatch.setattr(heat_transport_variables, "precircmw", ifepw2param.precircmw) monkeypatch.setattr(heat_transport_variables, "pacpmw", ifepw2param.pacpmw) monkeypatch.setattr(heat_transport_variables, "pnetelmw", ifepw2param.pnetelmw) - monkeypatch.setattr(heat_transport_variables, "pinjwp", ifepw2param.pinjwp) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_electric_total_mw", + ifepw2param.p_hcd_electric_total_mw, + ) monkeypatch.setattr(heat_transport_variables, "pfwdiv", ifepw2param.pfwdiv) monkeypatch.setattr(heat_transport_variables, "nphx", ifepw2param.nphx) monkeypatch.setattr(ife_variables, "tdspmw", ifepw2param.tdspmw) diff --git a/tests/unit/test_power.py b/tests/unit/test_power.py index e36f87bb13..cf9af7af2f 100644 --- a/tests/unit/test_power.py +++ b/tests/unit/test_power.py @@ -1908,7 +1908,7 @@ class AcpowParam(NamedTuple): trithtmw: Any = None - pinjwp: Any = None + p_hcd_electric_total_mw: Any = None tlvpmw: Any = None @@ -1945,7 +1945,7 @@ class AcpowParam(NamedTuple): vachtmw=0.5, tfacpd=9.1507079104675704, trithtmw=15, - pinjwp=129.94611930107126, + p_hcd_electric_total_mw=129.94611930107126, tlvpmw=0, peakmva=736.39062584245937, fcsht=0, @@ -1966,7 +1966,7 @@ class AcpowParam(NamedTuple): vachtmw=0.5, tfacpd=9.1507079104675704, trithtmw=15, - pinjwp=129.94611930107126, + p_hcd_electric_total_mw=129.94611930107126, tlvpmw=699.34943812129745, peakmva=90.673341440806112, fcsht=61.882833632875375, @@ -2007,7 +2007,11 @@ def test_acpow(acpowparam, monkeypatch, power): monkeypatch.setattr(heat_transport_variables, "trithtmw", acpowparam.trithtmw) - monkeypatch.setattr(heat_transport_variables, "pinjwp", acpowparam.pinjwp) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_electric_total_mw", + acpowparam.p_hcd_electric_total_mw, + ) monkeypatch.setattr(heat_transport_variables, "tlvpmw", acpowparam.tlvpmw) @@ -2115,7 +2119,7 @@ class Power2Param(NamedTuple): iprimshld: Any = None - pinjwp: Any = None + p_hcd_electric_total_mw: Any = None fachtmw: Any = None @@ -2279,7 +2283,7 @@ class Power2Param(NamedTuple): fpumpfw=0.0050000000000000001, fcsht=61.882833632875375, iprimshld=1, - pinjwp=129.94611930107126, + p_hcd_electric_total_mw=129.94611930107126, fachtmw=0, pgrossmw=0, psechtmw=0, @@ -2381,7 +2385,7 @@ class Power2Param(NamedTuple): fpumpfw=0.0050000000000000001, fcsht=62.237143915360818, iprimshld=1, - pinjwp=129.94611930107126, + p_hcd_electric_total_mw=129.94611930107126, fachtmw=61.882833632875375, pgrossmw=982.58317918134742, psechtmw=233.80288075411508, @@ -2570,7 +2574,11 @@ def test_power2(power2param, monkeypatch, power): monkeypatch.setattr(heat_transport_variables, "iprimshld", power2param.iprimshld) - monkeypatch.setattr(heat_transport_variables, "pinjwp", power2param.pinjwp) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_electric_total_mw", + power2param.p_hcd_electric_total_mw, + ) monkeypatch.setattr(heat_transport_variables, "fachtmw", power2param.fachtmw) @@ -2728,7 +2736,7 @@ class Power3Param(NamedTuple): trithtmw: Any = None - pinjwp: Any = None + p_hcd_electric_total_mw: Any = None fachtmw: Any = None @@ -2764,7 +2772,7 @@ class Power3Param(NamedTuple): vachtmw=0.5, tfacpd=9.1507079104675704, trithtmw=15, - pinjwp=129.94611930107126, + p_hcd_electric_total_mw=129.94611930107126, fachtmw=61.882833632875375, pgrossmw=982.58317918134742, poloidalpower=np.array( @@ -2791,7 +2799,7 @@ class Power3Param(NamedTuple): vachtmw=0.5, tfacpd=9.1507079104675704, trithtmw=15, - pinjwp=129.94611930107126, + p_hcd_electric_total_mw=129.94611930107126, fachtmw=62.237143915360818, pgrossmw=982.28339460484608, poloidalpower=np.array( @@ -2849,7 +2857,11 @@ def test_power3(power3param, monkeypatch, power): monkeypatch.setattr(heat_transport_variables, "trithtmw", power3param.trithtmw) - monkeypatch.setattr(heat_transport_variables, "pinjwp", power3param.pinjwp) + monkeypatch.setattr( + heat_transport_variables, + "p_hcd_electric_total_mw", + power3param.p_hcd_electric_total_mw, + ) monkeypatch.setattr(heat_transport_variables, "fachtmw", power3param.fachtmw) From 6b1eba7999c1ac5a10437d20c88107ea6176afda Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 14:50:13 +0100 Subject: [PATCH 21/41] =?UTF-8?q?=E2=9C=A8=20Introduce=20p=5Fhcd=5Fprimary?= =?UTF-8?q?=5Felectric=5Fmw=20variable=20and=20update=20calculations=20for?= =?UTF-8?q?=20primary=20heating=20power=20in=20heat=20transport=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 19 ++++++++++++++----- source/fortran/heat_transport_variables.f90 | 3 +++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index e6110cbfcf..cc5cbef276 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1409,7 +1409,9 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_lowhyb_injected_total_mw / current_drive_variables.eta_lowhyb_injector_wall_plug ) - pinjwp1 = current_drive_variables.pwplh + heat_transport_variables.p_hcd_primary_electric_mw = ( + current_drive_variables.pwplh + ) # Wall plug to injector efficiency current_drive_variables.eta_hcd_primary_injector_wall_plug = ( @@ -1442,7 +1444,9 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_icrh_injected_total_mw / current_drive_variables.eta_icrh_injector_wall_plug ) - pinjwp1 = current_drive_variables.pwplh + heat_transport_variables.p_hcd_primary_electric_mw = ( + current_drive_variables.pwplh + ) # Wall plug to injector efficiency current_drive_variables.eta_hcd_primary_injector_wall_plug = ( @@ -1478,7 +1482,9 @@ def cudriv(self, output: bool): ) # Wall plug to injector efficiency - pinjwp1 = current_drive_variables.echwpow + heat_transport_variables.p_hcd_primary_electric_mw = ( + current_drive_variables.echwpow + ) current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ecrh_injector_wall_plug ) @@ -1544,7 +1550,9 @@ def cudriv(self, output: bool): current_drive_variables.p_beam_injected_mw / current_drive_variables.eta_beam_injector_wall_plug ) # neutral beam wall plug power - pinjwp1 = current_drive_variables.pwpnb + heat_transport_variables.p_hcd_primary_electric_mw = ( + current_drive_variables.pwpnb + ) current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug ) @@ -1572,7 +1580,8 @@ def cudriv(self, output: bool): pinjimw1 + p_hcd_secondary_ions_mw ) heat_transport_variables.p_hcd_electric_total_mw = ( - pinjwp1 + heat_transport_variables.p_hcd_secondary_electric_mw + heat_transport_variables.p_hcd_primary_electric_mw + + heat_transport_variables.p_hcd_secondary_electric_mw ) # Reset injected power to zero for ignited plasma (fudge) diff --git a/source/fortran/heat_transport_variables.f90 b/source/fortran/heat_transport_variables.f90 index beed15f6f3..9666ad385b 100644 --- a/source/fortran/heat_transport_variables.f90 +++ b/source/fortran/heat_transport_variables.f90 @@ -139,6 +139,9 @@ module heat_transport_variables real(dp) :: p_hcd_secondary_electric_mw !! Secondary HCD system injector wall plug power (MW) + real(dp) :: p_hcd_primary_electric_mw + !! Primary HCD system injector wall plug power (MW) + real(dp) :: pnetelmw !! net electric power (MW) From 22aca7eee1923ff7a8448516049707c54ed494ac Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 14:57:08 +0100 Subject: [PATCH 22/41] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Update=20current=20d?= =?UTF-8?q?rive=20calculations=20to=20handle=20electron=20Bernstein=20wave?= =?UTF-8?q?=20cases=20and=20improve=20wall=20plug=20power=20efficiency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 59 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index cc5cbef276..f7383a6136 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1308,7 +1308,7 @@ def cudriv(self, output: bool): # ========================================================== # Electron cyclotron cases - elif current_drive_variables.i_hcd_secondary in [3, 7, 10, 12, 13]: + if current_drive_variables.i_hcd_secondary in [3, 7, 10, 13]: # Injected power p_hcd_secondary_electrons_mw = ( current_drive_variables.p_hcd_secondary_injected_mw @@ -1327,6 +1327,26 @@ def cudriv(self, output: bool): # ========================================================== + # Electron berstein cases + if current_drive_variables.i_hcd_secondary in [12]: + # Injected power + p_hcd_secondary_electrons_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + ) + + # Wall plug power + heat_transport_variables.p_hcd_secondary_electric_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + / current_drive_variables.eta_ebw_injector_wall_plug + ) + + # Wall plug to injector efficiency + current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( + current_drive_variables.eta_ebw_injector_wall_plug + ) + + # ========================================================== + # Neutral beam cases elif current_drive_variables.i_hcd_secondary in [5, 8]: # Account for first orbit losses @@ -1457,7 +1477,7 @@ def cudriv(self, output: bool): # Electron cyclotron cases - elif current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: + if current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: # Injected power (set to close to close the Steady-state current equilibrium) current_drive_variables.p_hcd_primary_injected_mw = ( 1.0e-6 @@ -1491,6 +1511,41 @@ def cudriv(self, output: bool): # =========================================================== + # Electron bernstein cases + + if current_drive_variables.i_hcd_primary in [12]: + current_drive_variables.p_hcd_primary_injected_mw = ( + 1.0e-6 + * ( + physics_variables.aux_current_fraction + - current_drive_variables.f_c_plasma_hcd_secondary + ) + * physics_variables.plasma_current + / current_drive_variables.eta_cd_hcd_primary + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + + current_drive_variables.p_ecrh_injected_mw += ( + current_drive_variables.p_hcd_primary_injected_mw + ) + pinjemw1 = current_drive_variables.p_ebw_injected_mw + + # Wall plug power + current_drive_variables.echwpow = ( + current_drive_variables.p_ecrh_injected_mw + / current_drive_variables.eta_ebw_injector_wall_plug + ) + + # Wall plug to injector efficiency + heat_transport_variables.p_hcd_primary_electric_mw = ( + current_drive_variables.echwpow + ) + current_drive_variables.eta_hcd_primary_injector_wall_plug = ( + current_drive_variables.eta_ebw_injector_wall_plug + ) + + # =========================================================== + elif current_drive_variables.i_hcd_primary in [5, 8]: current_drive_variables.p_hcd_primary_injected_mw = ( 1.0e-6 From 85f4d21842df17ed871487b53b14a97f62ecceca Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 14:59:30 +0100 Subject: [PATCH 23/41] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20primary?= =?UTF-8?q?=20heating=20power=20calculations=20in=20current=20drive=20modu?= =?UTF-8?q?le=20for=20improved=20clarity=20and=20maintainability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 70 +++++++--------------------------------- 1 file changed, 12 insertions(+), 58 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index f7383a6136..f0dfb672a1 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1254,6 +1254,18 @@ def cudriv(self, output: bool): / physics_variables.plasma_current ) + # Calculate the driven current for the primary heating method + current_drive_variables.p_hcd_primary_injected_mw = ( + 1.0e-6 + * ( + physics_variables.aux_current_fraction + - current_drive_variables.f_c_plasma_hcd_secondary + ) + * physics_variables.plasma_current + / current_drive_variables.eta_cd_norm_hcd_primary + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + # =========================================================== # Calculate the wall plug power for the secondary heating method @@ -1407,18 +1419,6 @@ def cudriv(self, output: bool): # Lower hybrid cases if current_drive_variables.i_hcd_primary in [1, 4, 6]: - # Injected power - current_drive_variables.p_hcd_primary_injected_mw = ( - 1.0e-6 - * ( - physics_variables.aux_current_fraction - - current_drive_variables.f_c_plasma_hcd_secondary - ) - * physics_variables.plasma_current - / current_drive_variables.eta_cd_hcd_primary - + current_drive_variables.p_hcd_primary_extra_heat_mw - ) - pinjemw1 = current_drive_variables.p_hcd_primary_injected_mw current_drive_variables.p_hcd_lowhyb_injected_total_mw += ( current_drive_variables.p_hcd_primary_injected_mw @@ -1442,18 +1442,6 @@ def cudriv(self, output: bool): # Ion cyclotron cases if current_drive_variables.i_hcd_primary in [2]: - # Injected power - current_drive_variables.p_hcd_primary_injected_mw = ( - 1.0e-6 - * ( - physics_variables.aux_current_fraction - - current_drive_variables.f_c_plasma_hcd_secondary - ) - * physics_variables.plasma_current - / current_drive_variables.eta_cd_hcd_primary - + current_drive_variables.p_hcd_primary_extra_heat_mw - ) - pinjemw1 = current_drive_variables.p_hcd_primary_injected_mw current_drive_variables.p_hcd_icrh_injected_total_mw += ( current_drive_variables.p_hcd_primary_injected_mw @@ -1478,18 +1466,6 @@ def cudriv(self, output: bool): # Electron cyclotron cases if current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: - # Injected power (set to close to close the Steady-state current equilibrium) - current_drive_variables.p_hcd_primary_injected_mw = ( - 1.0e-6 - * ( - physics_variables.aux_current_fraction - - current_drive_variables.f_c_plasma_hcd_secondary - ) - * physics_variables.plasma_current - / current_drive_variables.eta_cd_hcd_primary - + current_drive_variables.p_hcd_primary_extra_heat_mw - ) - current_drive_variables.p_ecrh_injected_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) @@ -1514,17 +1490,6 @@ def cudriv(self, output: bool): # Electron bernstein cases if current_drive_variables.i_hcd_primary in [12]: - current_drive_variables.p_hcd_primary_injected_mw = ( - 1.0e-6 - * ( - physics_variables.aux_current_fraction - - current_drive_variables.f_c_plasma_hcd_secondary - ) - * physics_variables.plasma_current - / current_drive_variables.eta_cd_hcd_primary - + current_drive_variables.p_hcd_primary_extra_heat_mw - ) - current_drive_variables.p_ecrh_injected_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) @@ -1547,17 +1512,6 @@ def cudriv(self, output: bool): # =========================================================== elif current_drive_variables.i_hcd_primary in [5, 8]: - current_drive_variables.p_hcd_primary_injected_mw = ( - 1.0e-6 - * ( - physics_variables.aux_current_fraction - - current_drive_variables.f_c_plasma_hcd_secondary - ) - * physics_variables.plasma_current - / current_drive_variables.eta_cd_norm_hcd_primary - + current_drive_variables.p_hcd_primary_extra_heat_mw - ) - # Account for first orbit losses # (power due to particles that are ionised but not thermalised) [MW]: # This includes a second order term in shinethrough*(first orbit loss) From 17184eda364a9c1e9ec3708e2d0cfe1755960c1f Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 15:51:29 +0100 Subject: [PATCH 24/41] =?UTF-8?q?=E2=9C=A8=20Add=20p=5Fbeam=5Fplasma=5Fcou?= =?UTF-8?q?pled=5Fmw=20variable=20to=20track=20neutral=20beam=20power=20co?= =?UTF-8?q?upled=20to=20plasma=20after=20losses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 158 ++++++++++----------- source/fortran/current_drive_variables.f90 | 3 + 2 files changed, 76 insertions(+), 85 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index f0dfb672a1..6134ca9373 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1120,8 +1120,8 @@ def cudriv(self, output: bool): pinjmw1 = 0.0 pinjmwfix = 0.0 - pinjimw1 = 0.0 - pinjemw1 = 0.0 + p_hcd_primary_ions_mw = 0.0 + p_hcd_primary_electrons_mw = 0.0 p_hcd_secondary_electrons_mw = 0.0 p_hcd_secondary_ions_mw = 0.0 @@ -1369,57 +1369,64 @@ def cudriv(self, output: bool): 0.999, current_drive_variables.f_p_beam_orbit_loss ) # Should never be needed - pnbitotfix = current_drive_variables.p_hcd_secondary_injected_mw / ( - 1.0e0 - - current_drive_variables.f_p_beam_orbit_loss - + current_drive_variables.f_p_beam_orbit_loss - * current_drive_variables.f_p_beam_shine_through - ) - # Shinethrough power (atoms that are not ionised) [MW]: - nbshinemwfix = ( - pnbitotfix * current_drive_variables.f_p_beam_shine_through + current_drive_variables.p_beam_shine_through_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + * (1.0 - current_drive_variables.f_p_beam_shine_through) ) # First orbit loss - porbitlossmwfix = current_drive_variables.f_p_beam_orbit_loss * ( - pnbitotfix - nbshinemwfix + current_drive_variables.p_beam_orbit_loss_mw = ( + current_drive_variables.f_p_beam_orbit_loss + * ( + current_drive_variables.p_hcd_secondary_injected_mw + - current_drive_variables.p_beam_shine_through_mw + ) ) # Power deposited - pinjmwfix = pnbitotfix - nbshinemwfix - porbitlossmwfix + current_drive_variables.p_beam_plasma_coupled_mw = ( + current_drive_variables.p_hcd_secondary_injected_mw + - current_drive_variables.p_beam_shine_through_mw + - current_drive_variables.p_beam_orbit_loss_mw + ) + p_hcd_secondary_ions_mw = ( - pinjmwfix * current_drive_variables.f_p_beam_injected_ions + current_drive_variables.p_beam_plasma_coupled_mw + * current_drive_variables.f_p_beam_injected_ions ) - p_hcd_secondary_electrons_mw = pinjmwfix * ( - 1.0e0 - current_drive_variables.f_p_beam_injected_ions + + p_hcd_secondary_electrons_mw = ( + current_drive_variables.p_beam_plasma_coupled_mw + * (1.0e0 - current_drive_variables.f_p_beam_injected_ions) ) current_drive_variables.pwpnb = ( - pnbitotfix / current_drive_variables.eta_beam_injector_wall_plug + current_drive_variables.p_hcd_secondary_injected_mw + / current_drive_variables.eta_beam_injector_wall_plug ) # neutral beam wall plug power + heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.pwpnb ) + current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( current_drive_variables.eta_beam_injector_wall_plug ) - beam_current_fix = ( - 1.0e-3 * (pnbitotfix * 1.0e6) / current_drive_variables.e_beam_kev + current_drive_variables.c_beam_total = ( + 1.0e-3 + * (current_drive_variables.p_hcd_secondary_injected_mw * 1.0e6) + / current_drive_variables.e_beam_kev ) # Neutral beam current (A) - # Compute current drive wall plug and injected powers (MW) and efficiencies - auxiliary_cd = ( - physics_variables.aux_current_fraction - * physics_variables.plasma_current - ) - # ========================================================== # Lower hybrid cases if current_drive_variables.i_hcd_primary in [1, 4, 6]: - pinjemw1 = current_drive_variables.p_hcd_primary_injected_mw + p_hcd_primary_electrons_mw = ( + current_drive_variables.p_hcd_primary_injected_mw + ) current_drive_variables.p_hcd_lowhyb_injected_total_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) @@ -1442,7 +1449,9 @@ def cudriv(self, output: bool): # Ion cyclotron cases if current_drive_variables.i_hcd_primary in [2]: - pinjemw1 = current_drive_variables.p_hcd_primary_injected_mw + p_hcd_primary_ions_mw = ( + current_drive_variables.p_hcd_primary_injected_mw + ) current_drive_variables.p_hcd_icrh_injected_total_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) @@ -1465,12 +1474,13 @@ def cudriv(self, output: bool): # Electron cyclotron cases - if current_drive_variables.i_hcd_primary in [3, 7, 10, 12, 13]: + if current_drive_variables.i_hcd_primary in [3, 7, 10, 13]: current_drive_variables.p_ecrh_injected_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) - pinjemw1 = current_drive_variables.p_ecrh_injected_mw + p_hcd_primary_electrons_mw = current_drive_variables.p_ecrh_injected_mw + # current_drive_variables.p_ecrh_injected_mw = 1000.0 # Wall plug power current_drive_variables.echwpow = ( current_drive_variables.p_ecrh_injected_mw @@ -1481,6 +1491,7 @@ def cudriv(self, output: bool): heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.echwpow ) + current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ecrh_injector_wall_plug ) @@ -1490,14 +1501,14 @@ def cudriv(self, output: bool): # Electron bernstein cases if current_drive_variables.i_hcd_primary in [12]: - current_drive_variables.p_ecrh_injected_mw += ( + current_drive_variables.p_ebw_injected_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) - pinjemw1 = current_drive_variables.p_ebw_injected_mw + p_hcd_primary_electrons_mw = current_drive_variables.p_ebw_injected_mw # Wall plug power current_drive_variables.echwpow = ( - current_drive_variables.p_ecrh_injected_mw + current_drive_variables.p_ebw_injected_mw / current_drive_variables.eta_ebw_injector_wall_plug ) @@ -1519,46 +1530,41 @@ def cudriv(self, output: bool): 0.999, current_drive_variables.f_p_beam_orbit_loss ) # Should never be needed - current_drive_variables.p_beam_injected_mw = ( - current_drive_variables.p_hcd_primary_injected_mw - / ( - 1.0e0 - - current_drive_variables.f_p_beam_orbit_loss - + current_drive_variables.f_p_beam_orbit_loss - * current_drive_variables.f_p_beam_shine_through - ) - ) - # Shinethrough power (atoms that are not ionised) [MW]: current_drive_variables.p_beam_shine_through_mw = ( - current_drive_variables.p_beam_injected_mw - * current_drive_variables.f_p_beam_shine_through + current_drive_variables.p_hcd_primary_injected_mw + * (1.0 - current_drive_variables.f_p_beam_shine_through) ) # First orbit loss current_drive_variables.p_beam_orbit_loss_mw = ( current_drive_variables.f_p_beam_orbit_loss * ( - current_drive_variables.p_beam_injected_mw + current_drive_variables.p_hcd_primary_injected_mw - current_drive_variables.p_beam_shine_through_mw ) ) # Power deposited - pinjmw1 = ( - current_drive_variables.p_beam_injected_mw + current_drive_variables.p_beam_plasma_coupled_mw = ( + current_drive_variables.p_hcd_primary_injected_mw - current_drive_variables.p_beam_shine_through_mw - current_drive_variables.p_beam_orbit_loss_mw ) - pinjimw1 = pinjmw1 * current_drive_variables.f_p_beam_injected_ions - pinjemw1 = pinjmw1 * ( + + p_hcd_primary_ions_mw = ( + pinjmw1 * current_drive_variables.f_p_beam_injected_ions + ) + p_hcd_primary_electrons_mw = pinjmw1 * ( 1.0e0 - current_drive_variables.f_p_beam_injected_ions ) current_drive_variables.pwpnb = ( - current_drive_variables.p_beam_injected_mw + current_drive_variables.p_hcd_primary_injected_mw / current_drive_variables.eta_beam_injector_wall_plug - ) # neutral beam wall plug power + ) + + # Neutral beam wall plug power heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.pwpnb ) @@ -1568,26 +1574,35 @@ def cudriv(self, output: bool): current_drive_variables.c_beam_total = ( 1.0e-3 - * (current_drive_variables.p_beam_injected_mw * 1.0e6) + * (current_drive_variables.p_hcd_primary_injected_mw * 1.0e6) / current_drive_variables.e_beam_kev ) # Neutral beam current (A) + # =========================================================== + # Total injected power # sum contributions from primary and secondary systems current_drive_variables.p_hcd_injected_total_mw = ( - pinjemw1 - + pinjimw1 + p_hcd_primary_electrons_mw + + p_hcd_primary_ions_mw + p_hcd_secondary_electrons_mw + p_hcd_secondary_ions_mw ) - pinjmw1 = pinjemw1 + pinjimw1 + + pinjmw1 = p_hcd_primary_electrons_mw + p_hcd_primary_ions_mw pinjmwfix = p_hcd_secondary_electrons_mw + p_hcd_secondary_ions_mw + + # Total injected power given to electrons current_drive_variables.p_hcd_injected_electrons_mw = ( - pinjemw1 + p_hcd_secondary_electrons_mw + p_hcd_primary_electrons_mw + p_hcd_secondary_electrons_mw ) + + # Total injected power given to ions current_drive_variables.p_hcd_injected_ions_mw = ( - pinjimw1 + p_hcd_secondary_ions_mw + p_hcd_primary_ions_mw + p_hcd_secondary_ions_mw ) + + # Total wall plug power for all heating systems heat_transport_variables.p_hcd_electric_total_mw = ( heat_transport_variables.p_hcd_primary_electric_mw + heat_transport_variables.p_hcd_secondary_electric_mw @@ -1738,13 +1753,6 @@ def cudriv(self, output: bool): current_drive_variables.bigq, "OP ", ) - po.ovarre( - self.outfile, - "Auxiliary current drive (A)", - "(auxiliary_cd)", - auxiliary_cd, - "OP ", - ) if current_drive_variables.i_hcd_secondary != 0: po.ovarre( self.outfile, @@ -2051,13 +2059,6 @@ def cudriv(self, output: bool): porbitlossmwfix, "OP ", ) - po.ovarrf( - self.outfile, - "Secondary fixed beam shine-through power [MW]", - "(nbshinemwfix)", - nbshinemwfix, - "OP ", - ) po.ovarrf( self.outfile, "Secondary fixed beam power deposited in plasma (MW)", @@ -2071,20 +2072,7 @@ def cudriv(self, output: bool): "(p_hcd_injected_max)", current_drive_variables.p_hcd_injected_max, ) - po.ovarrf( - self.outfile, - "Secondary fixed total (MW)", - "(porbitlossmwfixed+nbshinemwfix+pinjmwfix)", - porbitlossmwfix + nbshinemwfix + pinjmwfix, - ) po.oblnkl(self.outfile) - po.ovarrf( - self.outfile, - "Secondary beam power entering vacuum vessel (MW)", - "(pnbitotfix)", - pnbitotfix, - "OP ", - ) po.oblnkl(self.outfile) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index a26d6511ee..edb6cf211e 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -253,6 +253,9 @@ module current_drive_variables real(dp) :: p_hcd_ebw_injected_total_mw !! Total electron bernstein wave injection power (MW) + real(dp) :: p_beam_plasma_coupled_mw + !! Total neutral beam power that is coupled to plasma after losses (MW) + real(dp) :: p_hcd_beam_injected_total_mw !! neutral beam injection power (MW) From 636c91e4f74e5f6b5a0de9416348d92912f3f848 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 16:00:03 +0100 Subject: [PATCH 25/41] =?UTF-8?q?=F0=9F=94=84=20Rename=20echwpow=20to=20p?= =?UTF-8?q?=5Fhcd=5Fecrh=5Felectric=5Fmw=20for=20clarity=20and=20update=20?= =?UTF-8?q?related=20data=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/csv_output_large_tokamak_MFILE.DAT | 2 +- examples/data/large_tokamak_1_MFILE.DAT | 2 +- examples/data/large_tokamak_2_MFILE.DAT | 2 +- examples/data/large_tokamak_3_MFILE.DAT | 2 +- examples/data/large_tokamak_4_MFILE.DAT | 2 +- examples/data/scan_MFILE.DAT | 18 +++++------ process/current_drive.py | 22 +++++++++----- source/fortran/current_drive_variables.f90 | 2 +- .../data/large_tokamak_1_MFILE.DAT | 2 +- .../data/large_tokamak_2_MFILE.DAT | 2 +- .../data/large_tokamak_3_MFILE.DAT | 2 +- .../data/large_tokamak_4_MFILE.DAT | 2 +- .../integration/data/large_tokamak_MFILE.DAT | 2 +- tests/integration/data/scan_2D_MFILE.DAT | 30 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 18 +++++------ tests/unit/data/large_tokamak_MFILE.DAT | 2 +- tests/unit/test_current_drive.py | 22 ++++++++------ 17 files changed, 72 insertions(+), 62 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index aab4a0f9bc..71ff06d634 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -552,7 +552,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5213E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5043E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5043E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.8939E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8401E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.8571E+02 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 423b100017..baec33ba56 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -550,7 +550,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.6029E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7728E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8601E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.7014E+02 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index e32b11fe49..2e29fd2c69 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -550,7 +550,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.6029E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7728E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8601E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.7014E+02 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 1acaade280..6629db301b 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -550,7 +550,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.6029E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7728E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8601E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.7014E+02 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index 7724240462..d1e96e3eed 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -550,7 +550,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.6029E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7728E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8601E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.7014E+02 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index ae0cc0deb8..0dc8f76a65 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -405,7 +405,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -1400,7 +1400,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -2395,7 +2395,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -3390,7 +3390,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -4385,7 +4385,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -5380,7 +5380,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -6375,7 +6375,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -7370,7 +7370,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -8365,7 +8365,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 diff --git a/process/current_drive.py b/process/current_drive.py index 6134ca9373..ceeab59438 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1326,6 +1326,10 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_secondary_injected_mw ) + current_drive_variables.p_ecrh_injected_mw += ( + current_drive_variables.p_hcd_secondary_injected_mw + ) + # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw @@ -1479,17 +1483,19 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_primary_injected_mw ) - p_hcd_primary_electrons_mw = current_drive_variables.p_ecrh_injected_mw - # current_drive_variables.p_ecrh_injected_mw = 1000.0 + p_hcd_primary_electrons_mw = ( + current_drive_variables.p_hcd_primary_injected_mw + ) + # Wall plug power - current_drive_variables.echwpow = ( + current_drive_variables.p_hcd_ecrh_electric_mw = ( current_drive_variables.p_ecrh_injected_mw / current_drive_variables.eta_ecrh_injector_wall_plug ) # Wall plug to injector efficiency heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.echwpow + current_drive_variables.p_hcd_ecrh_electric_mw ) current_drive_variables.eta_hcd_primary_injector_wall_plug = ( @@ -1507,14 +1513,14 @@ def cudriv(self, output: bool): p_hcd_primary_electrons_mw = current_drive_variables.p_ebw_injected_mw # Wall plug power - current_drive_variables.echwpow = ( + current_drive_variables.p_hcd_ecrh_electric_mw = ( current_drive_variables.p_ebw_injected_mw / current_drive_variables.eta_ebw_injector_wall_plug ) # Wall plug to injector efficiency heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.echwpow + current_drive_variables.p_hcd_ecrh_electric_mw ) current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ebw_injector_wall_plug @@ -2133,8 +2139,8 @@ def cudriv(self, output: bool): po.ovarre( self.outfile, "ECH wall plug power (MW)", - "(echwpow)", - current_drive_variables.echwpow, + "(p_hcd_ecrh_electric_mw)", + current_drive_variables.p_hcd_ecrh_electric_mw, "OP ", ) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index edb6cf211e..1c415cd397 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -81,7 +81,7 @@ module current_drive_variables real(dp) :: p_ecrh_injected_mw !! ECH power (MW) - real(dp) :: echwpow + real(dp) :: p_hcd_ecrh_electric_mw !! ECH wall plug power (MW) real(dp) :: eta_cd_hcd_primary diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index a05d6be892..d285d0c1a6 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -549,7 +549,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.6029E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7728E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8601E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.7014E+02 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 9123ad85c6..5fb96a36b3 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -550,7 +550,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.6029E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7728E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8601E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.7014E+02 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 711c594bf8..c1442f0a57 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -550,7 +550,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.6029E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7728E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8601E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.7014E+02 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 3ac4152855..3f57804dd9 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -550,7 +550,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.6029E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7728E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8601E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.7014E+02 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 2f61d026ad..b640873334 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -547,7 +547,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5942E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5942E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7129E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8516E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.6494E+02 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index c7d8555210..23644d8fcf 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -551,7 +551,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.9996E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8403E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.9617E+02 @@ -1714,7 +1714,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.0647E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8362E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.0338E+02 @@ -2877,7 +2877,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5559E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5112E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5112E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.1163E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8300E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.0929E+02 @@ -4040,7 +4040,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.1107E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8204E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.0982E+02 @@ -5203,7 +5203,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.0691E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8323E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.0430E+02 @@ -6366,7 +6366,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.9993E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8374E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.9690E+02 @@ -7529,7 +7529,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.9926E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8284E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.9732E+02 @@ -8692,7 +8692,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.0503E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8182E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.0426E+02 @@ -9855,7 +9855,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.1023E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8018E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.1131E+02 @@ -11018,7 +11018,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.1014E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.7989E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.1157E+02 @@ -12181,7 +12181,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.0509E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8184E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.0431E+02 @@ -13344,7 +13344,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.9941E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8291E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.9741E+02 @@ -14507,7 +14507,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.9920E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8251E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.9768E+02 @@ -15670,7 +15670,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.0529E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8208E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.0430E+02 @@ -16833,7 +16833,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5000E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.1139E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8166E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 3.1092E+02 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 37dfd18798..b209498079 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -405,7 +405,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -1400,7 +1400,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -2395,7 +2395,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -3390,7 +3390,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -4385,7 +4385,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -5380,7 +5380,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -6375,7 +6375,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -7370,7 +7370,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 @@ -8365,7 +8365,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.2750E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 6.2115E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 3.6189E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.3054E+02 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 03ac88a726..30d3a1da36 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -547,7 +547,7 @@ Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 - ECH_wall_plug_power_(MW)________________________________________________ (echwpow)_____________________ 1.5942E+02 OP + ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5942E+02 OP Total_V-s_capability_of_Central_Solenoid/PF_coils_(Wb)__________________ (abs(vs_cs_pf_total_pulse))__________________ 5.7129E+02 Required_volt-seconds_during_start-up_(Wb)______________________________ (vssoft)______________________ 2.8516E+02 Available_volt-seconds_during_burn_(Wb)_________________________________ (vsmax)_______________________ 2.6494E+02 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index aeedecda7d..eeaaeee7cb 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -95,7 +95,7 @@ class CudrivParam(NamedTuple): pwplh: Any = None - echwpow: Any = None + p_hcd_ecrh_electric_mw: Any = None p_beam_injected_mw: Any = None @@ -207,7 +207,7 @@ class CudrivParam(NamedTuple): expected_effcd: Any = None - expected_echwpow: Any = None + expected_p_hcd_ecrh_electric_mw: Any = None expected_p_hcd_injected_electrons_mw: Any = None @@ -247,7 +247,7 @@ class CudrivParam(NamedTuple): e_beam_kev=1000, eta_cd_hcd_primary=0, pwplh=0, - echwpow=0, + p_hcd_ecrh_electric_mw=0, p_beam_injected_mw=0, p_beam_shine_through_mw=0, p_hcd_injected_electrons_mw=0, @@ -303,7 +303,7 @@ class CudrivParam(NamedTuple): expected_etacd=0.5, expected_p_hcd_injected_total_mw=120.49600019005746, expected_effcd=0.05000000000000001, - expected_echwpow=240.99200038011492, + expected_p_hcd_ecrh_electric_mw=240.99200038011492, expected_p_hcd_injected_electrons_mw=120.49600019005746, expected_bigq=0, ), @@ -337,7 +337,7 @@ class CudrivParam(NamedTuple): e_beam_kev=1000, eta_cd_hcd_primary=0.05000000000000001, pwplh=0, - echwpow=240.99200038011492, + p_hcd_ecrh_electric_mw=240.99200038011492, p_beam_injected_mw=0, p_beam_shine_through_mw=0, p_hcd_injected_electrons_mw=120.49600019005746, @@ -393,7 +393,7 @@ class CudrivParam(NamedTuple): expected_etacd=0.5, expected_p_hcd_injected_total_mw=120.49600019005746, expected_effcd=0.05000000000000001, - expected_echwpow=240.99200038011492, + expected_p_hcd_ecrh_electric_mw=240.99200038011492, expected_p_hcd_injected_electrons_mw=120.49600019005746, expected_bigq=8.6725187311435423, ), @@ -554,7 +554,11 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(current_drive_variables, "pwplh", cudrivparam.pwplh) - monkeypatch.setattr(current_drive_variables, "echwpow", cudrivparam.echwpow) + monkeypatch.setattr( + current_drive_variables, + "p_hcd_ecrh_electric_mw", + cudrivparam.p_hcd_ecrh_electric_mw, + ) monkeypatch.setattr( current_drive_variables, "p_beam_injected_mw", cudrivparam.p_beam_injected_mw @@ -728,8 +732,8 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): cudrivparam.expected_effcd ) - assert current_drive_variables.echwpow == pytest.approx( - cudrivparam.expected_echwpow + assert current_drive_variables.p_hcd_ecrh_electric_mw == pytest.approx( + cudrivparam.expected_p_hcd_ecrh_electric_mw ) assert current_drive_variables.p_hcd_injected_electrons_mw == pytest.approx( From 8eeb453eeb9f5c986a18d058606a409e800bbec1 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 16:06:07 +0100 Subject: [PATCH 26/41] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Update=20current=20d?= =?UTF-8?q?rive=20calculations=20to=20include=20electron=20Bernstein=20wav?= =?UTF-8?q?e=20power=20and=20improve=20wall=20plug=20efficiency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 9 ++++++--- source/fortran/current_drive_variables.f90 | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index ceeab59438..c2e54d90f2 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1495,7 +1495,8 @@ def cudriv(self, output: bool): # Wall plug to injector efficiency heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.p_hcd_ecrh_electric_mw + current_drive_variables.p_hcd_primary_injected_mw + / current_drive_variables.eta_ecrh_injector_wall_plug ) current_drive_variables.eta_hcd_primary_injector_wall_plug = ( @@ -1513,15 +1514,17 @@ def cudriv(self, output: bool): p_hcd_primary_electrons_mw = current_drive_variables.p_ebw_injected_mw # Wall plug power - current_drive_variables.p_hcd_ecrh_electric_mw = ( + current_drive_variables.p_hcd_ebw_electric_mw = ( current_drive_variables.p_ebw_injected_mw / current_drive_variables.eta_ebw_injector_wall_plug ) # Wall plug to injector efficiency heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.p_hcd_ecrh_electric_mw + current_drive_variables.p_hcd_primary_injected_mw + / current_drive_variables.eta_ebw_injector_wall_plug ) + current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ebw_injector_wall_plug ) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 1c415cd397..884fa7622f 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -84,6 +84,9 @@ module current_drive_variables real(dp) :: p_hcd_ecrh_electric_mw !! ECH wall plug power (MW) + real(dp) :: p_hcd_ebw_electric_mw + !! Electron bernstein wall plug power (MW) + real(dp) :: eta_cd_hcd_primary !! Current drive efficiency of primary HCD system (A/W) From 6683b776ff61b6335bdc4ee7f38929f2ef0aebf8 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 7 Apr 2025 16:13:06 +0100 Subject: [PATCH 27/41] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Rename=20pwplh=20to?= =?UTF-8?q?=20p=5Fhcd=5Flowhyb=5Felectric=5Fmw=20for=20clarity=20and=20upd?= =?UTF-8?q?ate=20related=20calculations=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 22 ++++++++++++++++------ source/fortran/current_drive_variables.f90 | 2 +- tests/unit/test_current_drive.py | 8 ++++---- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index c2e54d90f2..8ec3ca826a 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1278,6 +1278,7 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_secondary_injected_mw ) + # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw @@ -1428,20 +1429,29 @@ def cudriv(self, output: bool): # Lower hybrid cases if current_drive_variables.i_hcd_primary in [1, 4, 6]: + p_hcd_primary_electrons_mw = ( current_drive_variables.p_hcd_primary_injected_mw ) + current_drive_variables.p_hcd_lowhyb_injected_total_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) # Wall plug power - current_drive_variables.pwplh = ( + heat_transport_variables.p_hcd_primary_electric_mw = ( + current_drive_variables.p_hcd_primary_injected_mw + / current_drive_variables.eta_lowhyb_injector_wall_plug + ) + + # Wall plug power + current_drive_variables.p_hcd_lowhyb_electric_mw = ( current_drive_variables.p_hcd_lowhyb_injected_total_mw / current_drive_variables.eta_lowhyb_injector_wall_plug ) + heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.pwplh + current_drive_variables.p_hcd_lowhyb_electric_mw ) # Wall plug to injector efficiency @@ -1461,12 +1471,12 @@ def cudriv(self, output: bool): ) # Wall plug power - current_drive_variables.pwplh = ( + current_drive_variables.p_hcd_lowhyb_electric_mw = ( current_drive_variables.p_hcd_icrh_injected_total_mw / current_drive_variables.eta_icrh_injector_wall_plug ) heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.pwplh + current_drive_variables.p_hcd_lowhyb_electric_mw ) # Wall plug to injector efficiency @@ -1936,8 +1946,8 @@ def cudriv(self, output: bool): po.ovarre( self.outfile, "Lower hybrid wall plug power (MW)", - "(pwplh)", - current_drive_variables.pwplh, + "(p_hcd_lowhyb_electric_mw)", + current_drive_variables.p_hcd_lowhyb_electric_mw, "OP ", ) diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 884fa7622f..d7d919b67c 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -268,7 +268,7 @@ module current_drive_variables real(dp) :: f_c_plasma_pfirsch_schluter !! Pfirsch-Schlüter current fraction - real(dp) :: pwplh + real(dp) :: p_hcd_lowhyb_electric_mw !! lower hybrid wall plug power (MW) real(dp) :: pwpnb diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index eeaaeee7cb..7aad62b6db 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -93,7 +93,7 @@ class CudrivParam(NamedTuple): eta_cd_hcd_primary: Any = None - pwplh: Any = None + p_hcd_lowhyb_electric_mw: Any = None p_hcd_ecrh_electric_mw: Any = None @@ -246,7 +246,7 @@ class CudrivParam(NamedTuple): eta_beam_injector_wall_plug=0.29999999999999999, e_beam_kev=1000, eta_cd_hcd_primary=0, - pwplh=0, + p_hcd_lowhyb_electric_mw=0, p_hcd_ecrh_electric_mw=0, p_beam_injected_mw=0, p_beam_shine_through_mw=0, @@ -336,7 +336,7 @@ class CudrivParam(NamedTuple): eta_beam_injector_wall_plug=0.29999999999999999, e_beam_kev=1000, eta_cd_hcd_primary=0.05000000000000001, - pwplh=0, + p_hcd_lowhyb_electric_mw=0, p_hcd_ecrh_electric_mw=240.99200038011492, p_beam_injected_mw=0, p_beam_shine_through_mw=0, @@ -552,7 +552,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): current_drive_variables, "eta_cd_hcd_primary", cudrivparam.eta_cd_hcd_primary ) - monkeypatch.setattr(current_drive_variables, "pwplh", cudrivparam.pwplh) + monkeypatch.setattr(current_drive_variables, "p_hcd_lowhyb_electric_mw", cudrivparam.p_hcd_lowhyb_electric_mw) monkeypatch.setattr( current_drive_variables, From 072742d38efdc3afa2b2c35bbddf50d9d49eb62c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 8 Apr 2025 10:07:12 +0100 Subject: [PATCH 28/41] =?UTF-8?q?=E2=9C=A8=20Add=20p=5Febw=5Finjected=5Fmw?= =?UTF-8?q?=20variable=20to=20track=20electron=20Bernstein=20wave=20power?= =?UTF-8?q?=20and=20update=20related=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 293 ++++++++++++--------- process/physics.py | 2 +- source/fortran/current_drive_variables.f90 | 3 + tests/unit/test_current_drive.py | 6 +- 4 files changed, 183 insertions(+), 121 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 8ec3ca826a..9910e8001c 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -810,7 +810,7 @@ def __init__(self, plasma_profile: PlasmaProfile): self.outfile = constants.nout self.plasma_profile = plasma_profile - def electron_berstein_freethy( + def electron_bernstein_freethy( self, te: float, rmajor: float, @@ -868,6 +868,7 @@ def electron_berstein_freethy( * bt / constants.electron_mass ) + fp = ( 1.0e0 / (2.0e0 * np.pi) @@ -1009,6 +1010,70 @@ def lhrad(self): return rat0 + def lheval(self, drfind, rratio): + """Routine to evaluate the difference between electron energy + expressions required to find the Lower Hybrid absorption radius + author: P J Knight, CCFE, Culham Science Centre + drfind : input real : correction to parallel refractive index + rratio : input real : guess for radius of penetration / rminor + ediff : output real : difference between the E values (keV) + This routine evaluates the difference between the values calculated + from the two equations for the electron energy E, given in + AEA FUS 172, p.58. This difference is used to locate the Lower Hybrid + wave absorption radius via a Newton-Raphson method, in calling + routine lhrad. + AEA FUS 172: Physics Assessment for the European Reactor Study + """ + dlocal = 1.0e-19 * self.plasma_profile.neprofile.calculate_profile_y( + rratio, + physics_variables.rhopedn, + physics_variables.ne0, + physics_variables.neped, + physics_variables.nesep, + physics_variables.alphan, + ) + + # Local electron temperature + + tlocal = self.plasma_profile.teprofile.calculate_profile_y( + rratio, + physics_variables.rhopedt, + physics_variables.te0, + physics_variables.teped, + physics_variables.tesep, + physics_variables.alphat, + physics_variables.tbeta, + ) + + # Local toroidal field (evaluated at the inboard region of the flux surface) + + blocal = ( + physics_variables.bt + * physics_variables.rmajor + / (physics_variables.rmajor - rratio * physics_variables.rminor) + ) + + # Parallel refractive index needed for plasma access + + frac = np.sqrt(dlocal) / blocal + nplacc = frac + np.sqrt(1.0e0 + frac * frac) + + # Total parallel refractive index + + refind = nplacc + drfind + + # First equation for electron energy E + + e1 = 511.0e0 * (np.sqrt(1.0e0 + 1.0e0 / (refind * refind)) - 1.0e0) + + # Second equation for E + + e2 = 7.0e0 * tlocal + + # Difference + + return e1 - e2 + def lower_hybrid_fenstermacher( self, te: float, rmajor: float, dene20: float ) -> float: @@ -1164,6 +1229,7 @@ def cudriv(self, output: bool): ) * current_drive_variables.feffcd, 3: lambda: self.electron_cyclotron.electron_cyclotron_fenstermacher( + ten=physics_variables.ten, rmajor=physics_variables.rmajor, dene20=dene20, dlamee=physics_variables.dlamee, @@ -1188,7 +1254,7 @@ def cudriv(self, output: bool): ), 10: lambda: current_drive_variables.eta_cd_norm_ecrh / (dene20 * physics_variables.rmajor), - 12: lambda: self.electron_bernstein.electron_berstein_freethy( + 12: lambda: self.electron_bernstein.electron_bernstein_freethy( te=physics_variables.te, rmajor=physics_variables.rmajor, dene20=dene20, @@ -1199,8 +1265,9 @@ def cudriv(self, output: bool): * current_drive_variables.feffcd, 13: lambda: self.electron_cyclotron.electron_cyclotron_freethy( te=physics_variables.te, + zeff=physics_variables.zeff, rmajor=physics_variables.rmajor, - dene20=dene20, + dene=physics_variables.dene, bt=physics_variables.bt, n_ecrh_harmonic=current_drive_variables.n_ecrh_harmonic, i_ecrh_wave_mode=current_drive_variables.i_ecrh_wave_mode, @@ -1210,7 +1277,7 @@ def cudriv(self, output: bool): # Assign outputs for models that return multiple values if current_drive_variables.i_hcd_secondary in [5, 8]: - eta_cd_hcd_secondary, f_p_beam_injected_ions, f_p_beam_shine_through = ( + _, f_p_beam_injected_ions, f_p_beam_shine_through = ( self.neutral_beam.iternb() if current_drive_variables.i_hcd_secondary == 5 else self.neutral_beam.culnbi() @@ -1220,10 +1287,9 @@ def cudriv(self, output: bool): # Calculate eta_cd_hcd_secondary based on the selected model if current_drive_variables.i_hcd_secondary.item() in hcd_models: - eta_cd_hcd_secondary = hcd_models[ + current_drive_variables.eta_cd_hcd_secondary = hcd_models[ current_drive_variables.i_hcd_secondary.item() ]() - current_drive_variables.eta_cd_hcd_secondary = eta_cd_hcd_secondary # Calculate eta_cd_hcd_primary based on the selected model if current_drive_variables.i_hcd_primary.item() in hcd_models: @@ -1254,7 +1320,7 @@ def cudriv(self, output: bool): / physics_variables.plasma_current ) - # Calculate the driven current for the primary heating method + # Calculate the injected power for the primary heating method current_drive_variables.p_hcd_primary_injected_mw = ( 1.0e-6 * ( @@ -1266,6 +1332,13 @@ def cudriv(self, output: bool): + current_drive_variables.p_hcd_primary_extra_heat_mw ) + # Calculate the driven current for the primary heating method + current_drive_variables.c_hcd_primary_driven = ( + current_drive_variables.eta_cd_hcd_primary + * current_drive_variables.p_hcd_primary_injected_mw + * 1.0e6 + ) + # =========================================================== # Calculate the wall plug power for the secondary heating method @@ -1278,7 +1351,6 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_secondary_injected_mw ) - # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw @@ -1429,11 +1501,10 @@ def cudriv(self, output: bool): # Lower hybrid cases if current_drive_variables.i_hcd_primary in [1, 4, 6]: - p_hcd_primary_electrons_mw = ( current_drive_variables.p_hcd_primary_injected_mw ) - + current_drive_variables.p_hcd_lowhyb_injected_total_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) @@ -1449,7 +1520,7 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_lowhyb_injected_total_mw / current_drive_variables.eta_lowhyb_injector_wall_plug ) - + heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.p_hcd_lowhyb_electric_mw ) @@ -1651,13 +1722,33 @@ def cudriv(self, output: bool): if not output: return - po.oheadr(self.outfile, "Current Drive System") + po.oheadr(self.outfile, "Heating & Current Drive System") + + if physics_variables.ignite == 1: + po.ocmmnt( + self.outfile, + "Ignited plasma; injected power only used for start-up phase", + ) + + if abs(physics_variables.inductive_current_fraction) > 1.0e-8: + po.ocmmnt( + self.outfile, + "Current is driven by both inductive and non-inductive means.", + ) + po.oblnkl(self.outfile) if current_drive_variables.i_hcd_calculations == 0: po.ocmmnt(self.outfile, "No current drive used") po.oblnkl(self.outfile) return + po.ovarin( + self.outfile, + "Primary current drive efficiency model", + "(i_hcd_primary)", + current_drive_variables.i_hcd_primary, + ) + if current_drive_variables.i_hcd_primary in [1, 4, 6]: po.ocmmnt(self.outfile, "Lower Hybrid Current Drive") elif current_drive_variables.i_hcd_primary == 2: @@ -1668,21 +1759,55 @@ def cudriv(self, output: bool): po.ocmmnt(self.outfile, "Neutral Beam Current Drive") elif current_drive_variables.i_hcd_primary == 10: po.ocmmnt( - self.outfile, "Electron Cyclotron Current Drive (user input gamma_CD)" + self.outfile, + "Electron Cyclotron Current Drive (input normalised efficiency)", ) elif current_drive_variables.i_hcd_primary == 12: - po.ocmmnt(self.outfile, "EBW current drive") + po.ocmmnt(self.outfile, "Electron Bernstein Wave Current Drive") elif current_drive_variables.i_hcd_primary == 13: po.ocmmnt( self.outfile, - "Electron Cyclotron Current Drive (O-mode cutoff with Zeff & Te)", + "Electron Cyclotron Current Drive (with Zeff & Te dependance)", ) + po.oblnkl(self.outfile) + + po.ovarre( + self.outfile, + "Absolute current drive efficiency of primary system [A/W]", + "(eta_cd_hcd_primary)", + current_drive_variables.eta_cd_hcd_primary, + "OP ", + ) + po.ovarre( + self.outfile, + "Normalised current drive efficiency of primary system [10^20 A / Wm^2]", + "(eta_cd_norm_hcd_primary)", + current_drive_variables.eta_cd_norm_hcd_primary, + "OP ", + ) + po.ovarre( + self.outfile, + "Power injected into plasma by primary system (MW)", + "(p_hcd_primary_injected_mw)", + current_drive_variables.p_hcd_primary_injected_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Current driven in plasma by primary system (A)", + "(c_hcd_primary_driven)", + current_drive_variables.c_hcd_primary_driven, + "OP ", + ) + + po.oblnkl(self.outfile) + po.ovarin( self.outfile, - "Current drive efficiency model", - "(i_hcd_primary)", - current_drive_variables.i_hcd_primary, + "Secondary current drive efficiency model", + "(i_hcd_secondary)", + current_drive_variables.i_hcd_secondary, ) if current_drive_variables.i_hcd_secondary in [1, 4, 6]: @@ -1695,35 +1820,50 @@ def cudriv(self, output: bool): po.ocmmnt(self.outfile, "Neutral Beam Current Drive") elif current_drive_variables.i_hcd_secondary == 10: po.ocmmnt( - self.outfile, "Electron Cyclotron Current Drive (user input gamma_CD)" + self.outfile, + "Electron Cyclotron Current Drive (input normalised efficiency)", ) elif current_drive_variables.i_hcd_secondary == 12: - po.ocmmnt(self.outfile, "EBW current drive") + po.ocmmnt(self.outfile, "Electron Bernstein Wave Current Drive") elif current_drive_variables.i_hcd_secondary == 13: po.ocmmnt( self.outfile, - "Electron Cyclotron Current Drive (O-mode cutoff with Zeff & Te)", + "Electron Cyclotron Current Drive (with Zeff & Te dependance)", ) + po.oblnkl(self.outfile) - po.ovarin( + po.ovarre( self.outfile, - "Secondary current drive efficiency model", - "(i_hcd_secondary)", - current_drive_variables.i_hcd_secondary, + "Absolute current drive efficiency of secondary system [A/W]", + "(eta_cd_hcd_secondary)", + current_drive_variables.eta_cd_hcd_secondary, + "OP ", + ) + po.ovarre( + self.outfile, + "Normalised current drive efficiency of secondary system [10^20 A / Wm^2]", + "(eta_cd_norm_hcd_secondary)", + current_drive_variables.eta_cd_norm_hcd_secondary, + "OP ", ) - if physics_variables.ignite == 1: - po.ocmmnt( - self.outfile, - "Ignited plasma; injected power only used for start-up phase", - ) + po.ovarre( + self.outfile, + "Power injected into plasma by secondary system (MW)", + "(p_hcd_secondary_injected_mw)", + current_drive_variables.p_hcd_secondary_injected_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Current driven in plasma by secondary system (A)", + "(c_hcd_secondary_driven)", + current_drive_variables.c_hcd_secondary_driven, + "OP ", + ) po.oblnkl(self.outfile) - if abs(physics_variables.inductive_current_fraction) > 1.0e-8: - po.ocmmnt(self.outfile, "Current is driven by both inductive") - po.ocmmnt(self.outfile, "and non-inductive means.") - po.ovarre( self.outfile, "Ratio of power for flat-top to start-up (MW)", @@ -2157,91 +2297,6 @@ def cudriv(self, output: bool): "OP ", ) - if abs(current_drive_variables.p_hcd_secondary_injected_mw) > 1.0e-8: - po.ovarrf( - self.outfile, - "Fixed ECRH power (MW)", - "(pinjmwfix)", - current_drive_variables.pinjmwfix, - ) - po.ovarre( - self.outfile, - "ECH wall plug efficiency", - "(eta_ecrh_injector_wall_plug)", - current_drive_variables.eta_ecrh_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "Secondary fixed ECH wall plug power (MW)", - "(p_hcd_secondary_electric_mw)", - current_drive_variables.p_hcd_secondary_electric_mw, - "OP ", - ) - - def lheval(self, drfind, rratio): - """Routine to evaluate the difference between electron energy - expressions required to find the Lower Hybrid absorption radius - author: P J Knight, CCFE, Culham Science Centre - drfind : input real : correction to parallel refractive index - rratio : input real : guess for radius of penetration / rminor - ediff : output real : difference between the E values (keV) - This routine evaluates the difference between the values calculated - from the two equations for the electron energy E, given in - AEA FUS 172, p.58. This difference is used to locate the Lower Hybrid - wave absorption radius via a Newton-Raphson method, in calling - routine lhrad. - AEA FUS 172: Physics Assessment for the European Reactor Study - """ - dlocal = 1.0e-19 * self.plasma_profile.neprofile.calculate_profile_y( - rratio, - physics_variables.rhopedn, - physics_variables.ne0, - physics_variables.neped, - physics_variables.nesep, - physics_variables.alphan, - ) - - # Local electron temperature - - tlocal = self.plasma_profile.teprofile.calculate_profile_y( - rratio, - physics_variables.rhopedt, - physics_variables.te0, - physics_variables.teped, - physics_variables.tesep, - physics_variables.alphat, - physics_variables.tbeta, - ) - - # Local toroidal field (evaluated at the inboard region of the flux surface) - - blocal = ( - physics_variables.bt - * physics_variables.rmajor - / (physics_variables.rmajor - rratio * physics_variables.rminor) - ) - - # Parallel refractive index needed for plasma access - - frac = np.sqrt(dlocal) / blocal - nplacc = frac + np.sqrt(1.0e0 + frac * frac) - - # Total parallel refractive index - - refind = nplacc + drfind - - # First equation for electron energy E - - e1 = 511.0e0 * (np.sqrt(1.0e0 + 1.0e0 / (refind * refind)) - 1.0e0) - - # Second equation for E - - e2 = 7.0e0 * tlocal - - # Difference - - return e1 - e2 - def legend(self, zlocal, arg): """Routine to calculate Legendre function and its derivative author: M R O'Brien, CCFE, Culham Science Centre diff --git a/process/physics.py b/process/physics.py index 3b42a64da8..683a6520f2 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2074,7 +2074,7 @@ def physics(self): physics_variables.beta_beam, physics_variables.beam_density_out, physics_variables.alpha_power_beams, - ) = physics_funcs.beam_fusion( + ) = reactions.beam_fusion( physics_variables.beamfus0, physics_variables.betbm0, physics_variables.bp, diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index d7d919b67c..2daf9a4187 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -81,6 +81,9 @@ module current_drive_variables real(dp) :: p_ecrh_injected_mw !! ECH power (MW) + real(dp) :: p_ebw_injected_mw + !! Electron bernstein power (MW) + real(dp) :: p_hcd_ecrh_electric_mw !! ECH wall plug power (MW) diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 7aad62b6db..e585c269d8 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -552,7 +552,11 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): current_drive_variables, "eta_cd_hcd_primary", cudrivparam.eta_cd_hcd_primary ) - monkeypatch.setattr(current_drive_variables, "p_hcd_lowhyb_electric_mw", cudrivparam.p_hcd_lowhyb_electric_mw) + monkeypatch.setattr( + current_drive_variables, + "p_hcd_lowhyb_electric_mw", + cudrivparam.p_hcd_lowhyb_electric_mw, + ) monkeypatch.setattr( current_drive_variables, From 426f7fd67ed1c8d31846a1d19b4d839eb4422630 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 8 Apr 2025 11:27:43 +0100 Subject: [PATCH 29/41] :memo: Enhance current drive reporting by adding extra power metrics and improving efficiency calculations --- process/current_drive.py | 178 ++++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 86 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 9910e8001c..5efec90483 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1786,13 +1786,27 @@ def cudriv(self, output: bool): current_drive_variables.eta_cd_norm_hcd_primary, "OP ", ) + if current_drive_variables.i_hcd_primary == 10: + po.ovarre( + self.outfile, + "ECRH plasma heating efficiency", + "(eta_cd_norm_ecrh)", + current_drive_variables.eta_cd_norm_ecrh, + ) po.ovarre( self.outfile, - "Power injected into plasma by primary system (MW)", + "Power injected into plasma by primary system for current drive (MW)", "(p_hcd_primary_injected_mw)", current_drive_variables.p_hcd_primary_injected_mw, "OP ", ) + po.ovarre( + self.outfile, + "Extra power injected into plasma by primary system (MW)", + "(p_hcd_primary_extra_heat_mw)", + current_drive_variables.p_hcd_primary_extra_heat_mw, + "OP ", + ) po.ovarre( self.outfile, "Current driven in plasma by primary system (A)", @@ -1800,6 +1814,36 @@ def cudriv(self, output: bool): current_drive_variables.c_hcd_primary_driven, "OP ", ) + po.ovarre( + self.outfile, + "Wall plug to injector efficiency of primary system", + "(eta_hcd_primary_injector_wall_plug)", + current_drive_variables.eta_hcd_primary_injector_wall_plug, + "IP ", + ) + po.ovarre( + self.outfile, + "Wall plug electric power of primary system", + "(p_hcd_primary_electric_mw)", + heat_transport_variables.p_hcd_primary_electric_mw, + "OP ", + ) + + if current_drive_variables.i_hcd_primary in [12, 13]: + po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "ECRH / EBW harmonic number", + "(n_ecrh_harmonic)", + current_drive_variables.n_ecrh_harmonic, + ) + if current_drive_variables.i_hcd_primary == 13: + po.ovarin( + self.outfile, + "Electron cyclotron cutoff wave mode switch", + "(i_ecrh_wave_mode)", + current_drive_variables.i_ecrh_wave_mode, + ) po.oblnkl(self.outfile) @@ -1846,6 +1890,13 @@ def cudriv(self, output: bool): current_drive_variables.eta_cd_norm_hcd_secondary, "OP ", ) + if current_drive_variables.i_hcd_secondary == 10: + po.ovarre( + self.outfile, + "ECRH plasma heating efficiency", + "(eta_cd_norm_ecrh)", + current_drive_variables.eta_cd_norm_ecrh, + ) po.ovarre( self.outfile, @@ -1854,6 +1905,13 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_secondary_injected_mw, "OP ", ) + po.ovarre( + self.outfile, + "Extra power injected into plasma by secondary system (MW)", + "(p_hcd_secondary_extra_heat_mw)", + current_drive_variables.p_hcd_secondary_extra_heat_mw, + "OP ", + ) po.ovarre( self.outfile, "Current driven in plasma by secondary system (A)", @@ -1861,6 +1919,39 @@ def cudriv(self, output: bool): current_drive_variables.c_hcd_secondary_driven, "OP ", ) + po.ovarre( + self.outfile, + "Wall plug to injector efficiency of secondary system", + "(eta_hcd_secondary_injector_wall_plug)", + current_drive_variables.eta_hcd_secondary_injector_wall_plug, + "IP ", + ) + po.ovarre( + self.outfile, + "Wall plug electric power of secondary system", + "(p_hcd_secondary_electric_mw)", + heat_transport_variables.p_hcd_secondary_electric_mw, + "OP ", + ) + + po.oblnkl(self.outfile) + + po.osubhd(self.outfile, "Totals :") + + po.ovarre( + self.outfile, + "Total injected heating power across all systems (MW)", + "(p_hcd_injected_total_mw)", + current_drive_variables.p_hcd_injected_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Upper limit on total plasma injected power (MW)", + "(p_hcd_injected_max)", + current_drive_variables.p_hcd_injected_max, + "OP ", + ) po.oblnkl(self.outfile) @@ -1891,19 +1982,6 @@ def cudriv(self, output: bool): "(f_c_plasma_bootstrap_max)", current_drive_variables.f_c_plasma_bootstrap_max, ) - if current_drive_variables.i_hcd_secondary != 0: - po.ovarre( - self.outfile, - "Power injected for main current drive (MW)", - "(pcurrentdrivemw1)", - pinjmw1 - current_drive_variables.p_hcd_primary_extra_heat_mw, - ) - po.ovarre( - self.outfile, - "Power injected for secondary current drive (MW)", - "(pcurrentdrivemw2)", - pinjmwfix - current_drive_variables.p_hcd_secondary_extra_heat_mw, - ) po.ovarre( self.outfile, @@ -1912,43 +1990,7 @@ def cudriv(self, output: bool): current_drive_variables.bigq, "OP ", ) - if current_drive_variables.i_hcd_secondary != 0: - po.ovarre( - self.outfile, - "Secondary auxiliary current drive (A)", - "(c_hcd_secondary_driven)", - current_drive_variables.c_hcd_secondary_driven, - "OP ", - ) - po.ovarre( - self.outfile, - "Current drive efficiency (A/W)", - "(eta_cd_hcd_primary)", - current_drive_variables.eta_cd_hcd_primary, - "OP ", - ) - po.ovarre( - self.outfile, - "Normalised current drive efficiency of primary HCD system (10^20 A / W m^2)", - "(eta_cd_norm_hcd_primary)", - current_drive_variables.eta_cd_norm_hcd_primary, - "OP ", - ) - po.ovarre( - self.outfile, - "Wall plug to injector efficiency", - "(eta_hcd_primary_injector_wall_plug)", - current_drive_variables.eta_hcd_primary_injector_wall_plug, - ) - - if current_drive_variables.i_hcd_primary == 10: - po.ovarre( - self.outfile, - "ECRH plasma heating efficiency", - "(eta_cd_norm_ecrh)", - current_drive_variables.eta_cd_norm_ecrh, - ) if current_drive_variables.i_hcd_primary == 12: po.ovarre( self.outfile, @@ -1956,42 +1998,6 @@ def cudriv(self, output: bool): "(xi_ebw)", current_drive_variables.xi_ebw, ) - if current_drive_variables.i_hcd_primary in [12, 13]: - po.ovarre( - self.outfile, - "EC harmonic number", - "(n_ecrh_harmonic)", - current_drive_variables.n_ecrh_harmonic, - ) - if current_drive_variables.i_hcd_primary == 13: - po.ovarin( - self.outfile, - "EC cutoff wave mode switch", - "(i_ecrh_wave_mode)", - current_drive_variables.i_ecrh_wave_mode, - ) - - if current_drive_variables.i_hcd_secondary != 0: - po.ovarre( - self.outfile, - "Secondary current drive efficiency (A/W)", - "(eta_cd_hcd_secondary)", - current_drive_variables.eta_cd_hcd_secondary, - "OP ", - ) - po.ovarre( - self.outfile, - "Seconday wall plug to injector efficiency", - "(eta_hcd_secondary_injector_wall_plug)", - current_drive_variables.eta_hcd_secondary_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "Normalised secondary current drive efficiency, gamma (10^20 A/W-m2)", - "(eta_cd_norm_hcd_secondary)", - current_drive_variables.eta_cd_norm_hcd_secondary, - "OP ", - ) po.osubhd(self.outfile, "Fractions of current drive :") po.ovarrf( From aa6d1664ff4fb99044c1de74267d8e0aaf8f5860 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 8 Apr 2025 11:29:34 +0100 Subject: [PATCH 30/41] =?UTF-8?q?=F0=9F=94=84=20Rename=20fvsbrnni=20to=20f?= =?UTF-8?q?=5Fc=5Fplasma=5Fnon=5Finductive=20for=20clarity=20and=20update?= =?UTF-8?q?=20related=20data=20files=20and=20calculations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heating-and-current-drive.md | 2 +- .../inductive_plasma_current.md | 2 +- .../data/csv_output_large_tokamak_MFILE.DAT | 6 ++-- examples/data/large_tokamak_1_MFILE.DAT | 6 ++-- examples/data/large_tokamak_2_MFILE.DAT | 6 ++-- examples/data/large_tokamak_3_MFILE.DAT | 6 ++-- examples/data/large_tokamak_4_MFILE.DAT | 6 ++-- examples/data/large_tokamak_IN.DAT | 4 +-- examples/data/scan_MFILE.DAT | 24 ++++++------- examples/data/scan_example_file_IN.DAT | 4 +-- process/current_drive.py | 6 ++-- process/input.py | 4 ++- process/physics.py | 12 ++++--- scripts/create_dicts_config.py | 7 +++- source/fortran/numerics.f90 | 2 +- source/fortran/physics_variables.f90 | 2 +- .../data/large_tokamak_1_MFILE.DAT | 6 ++-- .../data/large_tokamak_2_MFILE.DAT | 6 ++-- .../data/large_tokamak_3_MFILE.DAT | 6 ++-- .../data/large_tokamak_4_MFILE.DAT | 6 ++-- tests/integration/data/large_tokamak_IN.DAT | 4 +-- .../integration/data/large_tokamak_MFILE.DAT | 6 ++-- .../data/large_tokamak_once_through.IN.DAT | 4 +-- tests/integration/data/ref_IN.DAT | 6 ++-- tests/integration/data/scan_2D_MFILE.DAT | 34 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 24 ++++++------- .../data/uncertainties_nonopt_ref_IN.DAT | 6 ++-- .../integration/data/uncertainties_ref_IN.DAT | 6 ++-- .../input_files/large_tokamak.IN.DAT | 4 +-- .../input_files/large_tokamak_nof.IN.DAT | 4 +-- .../large_tokamak_once_through.IN.DAT | 4 +-- .../input_files/st_regression.IN.DAT | 2 +- tests/unit/data/large_tokamak_IN.DAT | 4 +-- tests/unit/data/large_tokamak_MFILE.DAT | 6 ++-- tests/unit/test_current_drive.py | 12 ++++--- 35 files changed, 132 insertions(+), 117 deletions(-) diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/heating-and-current-drive.md b/documentation/proc-pages/eng-models/heating_and_current_drive/heating-and-current-drive.md index a3025ec314..09203b2bb3 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/heating-and-current-drive.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/heating-and-current-drive.md @@ -4,7 +4,7 @@ The use of inductive current drive leads to pulsed plant operation because of the limited flux swing that can be achieved using the central solenoid. This poses problems due to the fact that fatigue failures may result, and there would be a need for thermal storage to maintain output of electricity between pulses, and supply power for starting a new pulse.However, the plasma current can also be produced and maintained (partially or wholly) using non-inductive means which, in principle, removes this restriction. `PROCESS` contains a number of auxiliary current drive schemes, including various RF methods (Lower Hybrid, Electron Cyclotron, Electron Bernstein Wave, and Ion Cyclotron (Fast Wave) current drives) and also Neutral Beam current drive systems. The code calculates the efficiency and the resulting power requirements of the chosen system. -The fraction of the required plasma current to be produced by non-inductive means, `fvsbrnni`, should be set, and flag `i_hcd_calculations` should be set to 0 for purely inductive scenarios, or 1 otherwise. The current drive efficiency model to be used in this latter case is defined by the value of switch `i_hcd_primary`: +The fraction of the required plasma current to be produced by non-inductive means, `f_c_plasma_non_inductive`, should be set, and flag `i_hcd_calculations` should be set to 0 for purely inductive scenarios, or 1 otherwise. The current drive efficiency model to be used in this latter case is defined by the value of switch `i_hcd_primary`: - `i_hcd_primary` = 1: [Fenstermacher Lower Hybrid model](RF/fenstermacher_lower_hybrid.md) - `i_hcd_primary` = 2: [Ion cyclotron model](RF/ic_model.md)[^1], diff --git a/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md index 90f00358ee..cc3daf30b5 100644 --- a/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md @@ -1,4 +1,4 @@ -Currently in `PROCESS` the inductive current fraction from the CS is not calculated directly but is just equal to ($1 - \mathtt{fvsbrnni}$). Where $\mathtt{fvsbrnni}$ is the sum of the fractions of current driven by non inductive means. +Currently in `PROCESS` the inductive current fraction from the CS is not calculated directly but is just equal to ($1 - \mathtt{f_c_plasma_non_inductive}$). Where $\mathtt{f_c_plasma_non_inductive}$ is the sum of the fractions of current driven by non inductive means. This calculated fraction (`inductive_current_fraction`) is then used in the `calculate_volt_second_requirements()` and `burn()` functions to calculate the volt-second requirements and the burn time for a pulsed machine. diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 71ff06d634..250f445e36 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -548,7 +548,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 5.9038E-04 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8505E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1495E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5213E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1432,9 +1432,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index baec33ba56..0a4a14439d 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -546,7 +546,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1426,9 +1426,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 2e29fd2c69..d1e11d7eec 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -546,7 +546,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1426,9 +1426,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 6629db301b..c317d01f25 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -546,7 +546,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1426,9 +1426,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index d1e96e3eed..a32acbfee0 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -546,7 +546,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1426,9 +1426,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/examples/data/large_tokamak_IN.DAT b/examples/data/large_tokamak_IN.DAT index b374171e95..dbe7a0b1b1 100644 --- a/examples/data/large_tokamak_IN.DAT +++ b/examples/data/large_tokamak_IN.DAT @@ -236,9 +236,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 0dc8f76a65..6ec775fe22 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -401,7 +401,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -1396,7 +1396,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -2391,7 +2391,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -3386,7 +3386,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -4381,7 +4381,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -5376,7 +5376,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -6371,7 +6371,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -7366,7 +7366,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -8361,7 +8361,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -9033,7 +9033,7 @@ ixc = 41 * f_j_cs_start_pulse_end_flat_top ixc = 42 * dr_cs_tf_gap boundl(42) = 0.05 boundu(42) = 0.1 -ixc = 44 * fvsbrnni +ixc = 44 * f_c_plasma_non_inductive ixc = 48 * fstrcase ixc = 49 * fstrcond ixc = 50 * fiooic @@ -9235,7 +9235,7 @@ aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) -fvsbrnni = 0.4434 * Fraction of the plasma current produced by +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; @@ -9331,7 +9331,7 @@ t_burn = 1.0d4 * Burn time (s) (calculated if i_pulsed_plant=1) fjohc0 = 5.3923E-01 f_j_cs_start_pulse_end_flat_top = 9.3176E-01 dr_cs_tf_gap = 5.0000E-02 - fvsbrnni = 3.9566E-01 + f_c_plasma_non_inductive = 3.9566E-01 fstrcase = 1.0000E+00 fstrcond = 9.2007E-01 fiooic = 6.3437E-01 diff --git a/examples/data/scan_example_file_IN.DAT b/examples/data/scan_example_file_IN.DAT index 051a50be64..0154ccc43b 100644 --- a/examples/data/scan_example_file_IN.DAT +++ b/examples/data/scan_example_file_IN.DAT @@ -236,9 +236,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/process/current_drive.py b/process/current_drive.py index 5efec90483..060cc23451 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -2055,12 +2055,12 @@ def cudriv(self, output: bool): ): po.ocmmnt(self.outfile, "ERROR: current drive fractions do not add to 1") - # MDK Add physics_variables.fvsbrnni as it can be an iteration variable + # MDK Add physics_variables.f_c_plasma_non_inductive as it can be an iteration variable po.ovarrf( self.outfile, "Fraction of the plasma current produced by non-inductive means", - "(fvsbrnni)", - physics_variables.fvsbrnni, + "(f_c_plasma_non_inductive)", + physics_variables.f_c_plasma_non_inductive, ) if ( diff --git a/process/input.py b/process/input.py index be45298a1a..e52ffcce33 100644 --- a/process/input.py +++ b/process/input.py @@ -711,7 +711,9 @@ def __post_init__(self): "fvolsi": InputVariable(fortran.fwbs_variables, float, range=(0.0, 10.0)), "fvolso": InputVariable(fortran.fwbs_variables, float, range=(0.0, 10.0)), "fvs": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), - "fvsbrnni": InputVariable(fortran.physics_variables, float, range=(0.0, 1.0)), + "f_c_plasma_non_inductive": InputVariable( + fortran.physics_variables, float, range=(0.0, 1.0) + ), "fvs_cs_pf_total_ramp": InputVariable( fortran.pfcoil_variables, float, range=(0.001, 10.0) ), diff --git a/process/physics.py b/process/physics.py index 683a6520f2..c9628871cc 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2021,20 +2021,24 @@ def physics(self): # produced by non-inductive means (which also includes # the current drive proportion) physics_module.err243 = 0 - if current_drive_variables.f_c_plasma_internal > physics_variables.fvsbrnni: + if ( + current_drive_variables.f_c_plasma_internal + > physics_variables.f_c_plasma_non_inductive + ): current_drive_variables.f_c_plasma_internal = min( current_drive_variables.f_c_plasma_internal, - physics_variables.fvsbrnni, + physics_variables.f_c_plasma_non_inductive, ) physics_module.err243 = 1 # Fraction of plasma current produced by inductive means physics_variables.inductive_current_fraction = max( - 1.0e-10, (1.0e0 - physics_variables.fvsbrnni) + 1.0e-10, (1.0e0 - physics_variables.f_c_plasma_non_inductive) ) # Fraction of plasma current produced by auxiliary current drive physics_variables.aux_current_fraction = ( - physics_variables.fvsbrnni - current_drive_variables.f_c_plasma_internal + physics_variables.f_c_plasma_non_inductive + - current_drive_variables.f_c_plasma_internal ) # Auxiliary current drive power calculations diff --git a/scripts/create_dicts_config.py b/scripts/create_dicts_config.py index 7bf42251ba..f602e942cd 100644 --- a/scripts/create_dicts_config.py +++ b/scripts/create_dicts_config.py @@ -1,2 +1,7 @@ # parameters that start with f, but are not f-values -NON_F_VALUES = ["f_j_cs_start_pulse_end_flat_top", "fvsbrnni", "feffcd", "fcutfsu"] +NON_F_VALUES = [ + "f_j_cs_start_pulse_end_flat_top", + "f_c_plasma_non_inductive", + "feffcd", + "fcutfsu", +] diff --git a/source/fortran/numerics.f90 b/source/fortran/numerics.f90 index b99323775e..d940e5fe39 100755 --- a/source/fortran/numerics.f90 +++ b/source/fortran/numerics.f90 @@ -249,7 +249,7 @@ module numerics !!

  • (41) f_j_cs_start_pulse_end_flat_top !!
  • (42) dr_cs_tf_gap !!
  • (43) NOT USED - !!
  • (44) fvsbrnni + !!
  • (44) f_c_plasma_non_inductive !!
  • (45) fqval (f-value for equation 28) !!
  • (46) fpinj (f-value for equation 30) !!
  • (47) feffcd diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index bda11aea51..e3d2ea566f 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -272,7 +272,7 @@ module physics_variables real(dp) :: fusion_rate_density_plasma !! fusion reaction rate, just from plasma (reactions/m3/sec) - real(dp) :: fvsbrnni + real(dp) :: f_c_plasma_non_inductive !! fraction of the plasma current produced by non-inductive means (`iteration variable 44`) real(dp) :: ejima_coeff diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index d285d0c1a6..2527af9817 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -545,7 +545,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1425,9 +1425,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 5fb96a36b3..12bfc5acb3 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -546,7 +546,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1426,9 +1426,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index c1442f0a57..7bef2a0d52 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -546,7 +546,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1426,9 +1426,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 3f57804dd9..d03890eb5f 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -546,7 +546,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3358E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1426,9 +1426,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/integration/data/large_tokamak_IN.DAT b/tests/integration/data/large_tokamak_IN.DAT index 93d224e53e..c64c78c439 100644 --- a/tests/integration/data/large_tokamak_IN.DAT +++ b/tests/integration/data/large_tokamak_IN.DAT @@ -236,9 +236,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index b640873334..dffc283969 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -543,7 +543,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.3342E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6376E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3624E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1427,9 +1427,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/integration/data/large_tokamak_once_through.IN.DAT b/tests/integration/data/large_tokamak_once_through.IN.DAT index d7bddf9a5b..4eed25b0c1 100644 --- a/tests/integration/data/large_tokamak_once_through.IN.DAT +++ b/tests/integration/data/large_tokamak_once_through.IN.DAT @@ -58,7 +58,7 @@ ixc = 29 * dr_bore boundl(29) = 0.1 ixc = 37 * j_cs_flat_top_end ixc = 41 * f_j_cs_start_pulse_end_flat_top -ixc = 44 * fvsbrnni +ixc = 44 * f_c_plasma_non_inductive ixc = 56 * tdmptf ixc = 57 * dr_tf_nose_case ixc = 58 * thwcndut @@ -321,7 +321,7 @@ dene = 7.796223900029837e+19 * electron density (/m3) (`iteration variable 6 beta_norm_max = 3.0 * Troyon-like coefficient for beta scaling calculated fgwsep = 0.5 * fraction of Greenwald density to set as separatrix density; If `<0`; separatrix fkzohm = 1.02 * Zohm elongation scaling adjustment factor (`i_plasma_geometry=2; 3`) -fvsbrnni = 0.4242184436680697 * fraction of the plasma current produced by non-inductive means (`iteration variable 44`) +f_c_plasma_non_inductive = 0.4242184436680697 * fraction of the plasma current produced by non-inductive means (`iteration variable 44`) ejima_coeff = 0.3 * Ejima coefficient for resistive startup V-s formula hfact = 1.185971818905028 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); i_bootstrap_current = 4 * switch for bootstrap current scaling diff --git a/tests/integration/data/ref_IN.DAT b/tests/integration/data/ref_IN.DAT index b9aba6be4e..6149bcf375 100644 --- a/tests/integration/data/ref_IN.DAT +++ b/tests/integration/data/ref_IN.DAT @@ -56,7 +56,7 @@ ixc = 41 * f_j_cs_start_pulse_end_flat_top ixc = 42 * dr_cs_tf_gap boundl(42) = 0.05 boundu(42) = 0.1 -ixc = 44 * fvsbrnni +ixc = 44 * f_c_plasma_non_inductive ixc = 48 * fstrcase ixc = 49 * fstrcond ixc = 50 * fiooic @@ -256,7 +256,7 @@ aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) -fvsbrnni = 0.4434 * Fraction of the plasma current produced by +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; @@ -351,7 +351,7 @@ t_burn = 1.0d4 * Burn time (s) (calculated if i_pulsed_plant=1) fjohc0 = 5.3923E-01 f_j_cs_start_pulse_end_flat_top = 9.3176E-01 dr_cs_tf_gap = 5.0000E-02 - fvsbrnni = 3.9566E-01 + f_c_plasma_non_inductive = 3.9566E-01 fstrcase = 1.0000E+00 fstrcond = 9.2007E-01 fiooic = 6.3437E-01 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 23644d8fcf..a70bfbf6b8 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -547,7 +547,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.0930E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.9070E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.9070E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1710,7 +1710,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9548E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0452E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0452E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -2873,7 +2873,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.5526E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8606E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1394E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1394E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5559E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -4036,7 +4036,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8847E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.1153E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1153E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -5199,7 +5199,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9218E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0782E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0782E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -6362,7 +6362,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9136E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0864E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0864E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -7525,7 +7525,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9320E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0680E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0680E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -8688,7 +8688,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9395E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0605E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0605E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -9851,7 +9851,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9780E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0220E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0220E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -11014,7 +11014,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9910E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0090E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0090E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -12177,7 +12177,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9399E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0601E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0601E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -13340,7 +13340,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9353E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0647E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0647E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -14503,7 +14503,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9505E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0495E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -15666,7 +15666,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9754E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0246E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0246E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -16829,7 +16829,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9990E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.0010E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0010E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -17712,9 +17712,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index b209498079..f092c81147 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -401,7 +401,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -1396,7 +1396,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -2391,7 +2391,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -3386,7 +3386,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -4381,7 +4381,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -5376,7 +5376,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -6371,7 +6371,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -7366,7 +7366,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -8361,7 +8361,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 3.8724E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 @@ -9033,7 +9033,7 @@ ixc = 41 * f_j_cs_start_pulse_end_flat_top ixc = 42 * dr_cs_tf_gap boundl(42) = 0.05 boundu(42) = 0.1 -ixc = 44 * fvsbrnni +ixc = 44 * f_c_plasma_non_inductive ixc = 48 * fstrcase ixc = 49 * fstrcond ixc = 50 * fiooic @@ -9235,7 +9235,7 @@ aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) -fvsbrnni = 0.4434 * Fraction of the plasma current produced by +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; @@ -9331,7 +9331,7 @@ t_burn = 1.0d4 * Burn time (s) (calculated if i_pulsed_plant=1) fjohc0 = 5.3923E-01 f_j_cs_start_pulse_end_flat_top = 9.3176E-01 dr_cs_tf_gap = 5.0000E-02 - fvsbrnni = 3.9566E-01 + f_c_plasma_non_inductive = 3.9566E-01 fstrcase = 1.0000E+00 fstrcond = 9.2007E-01 fiooic = 6.3437E-01 diff --git a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT index 6d2be90abb..2926c44488 100644 --- a/tests/integration/data/uncertainties_nonopt_ref_IN.DAT +++ b/tests/integration/data/uncertainties_nonopt_ref_IN.DAT @@ -56,7 +56,7 @@ ixc = 41 * f_j_cs_start_pulse_end_flat_top ixc = 42 * dr_cs_tf_gap boundl(42) = 0.05 boundu(42) = 0.1 -ixc = 44 * fvsbrnni +ixc = 44 * f_c_plasma_non_inductive ixc = 48 * fstrcase ixc = 49 * fstrcond ixc = 50 * fiooic @@ -256,7 +256,7 @@ aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) -fvsbrnni = 0.4434 * Fraction of the plasma current produced by +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; @@ -351,7 +351,7 @@ t_burn = 1.0d4 * Burn time (s) (calculated if i_pulsed_plant=1) fjohc0 = 5.3923E-01 f_j_cs_start_pulse_end_flat_top = 9.3176E-01 dr_cs_tf_gap = 5.0000E-02 - fvsbrnni = 3.9566E-01 + f_c_plasma_non_inductive = 3.9566E-01 fstrcase = 1.0000E+00 fstrcond = 9.2007E-01 fiooic = 6.3437E-01 diff --git a/tests/integration/data/uncertainties_ref_IN.DAT b/tests/integration/data/uncertainties_ref_IN.DAT index 35d44acf0a..5901c5acbb 100644 --- a/tests/integration/data/uncertainties_ref_IN.DAT +++ b/tests/integration/data/uncertainties_ref_IN.DAT @@ -56,7 +56,7 @@ ixc = 41 * f_j_cs_start_pulse_end_flat_top ixc = 42 * dr_cs_tf_gap boundl(42) = 0.05 boundu(42) = 0.1 -ixc = 44 * fvsbrnni +ixc = 44 * f_c_plasma_non_inductive ixc = 48 * fstrcase ixc = 49 * fstrcond ixc = 50 * fiooic @@ -256,7 +256,7 @@ aspect = 3.1 * Aspect ratio (iteration variable 1) dene = 7.983e+19 * Electron density (/m3) (iteration variable 6) beta_norm_max = 3.0 * (troyon-like) coefficient for beta scaling; fkzohm = 1.0245 * Zohm elongation scaling adjustment factor (i_plasma_geometry=2; 3) -fvsbrnni = 0.4434 * Fraction of the plasma current produced by +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; @@ -351,7 +351,7 @@ t_burn = 1.0d4 * Burn time (s) (calculated if i_pulsed_plant=1) fjohc0 = 5.3923E-01 f_j_cs_start_pulse_end_flat_top = 9.3176E-01 dr_cs_tf_gap = 5.0000E-02 - fvsbrnni = 3.9566E-01 + f_c_plasma_non_inductive = 3.9566E-01 fstrcase = 1.0000E+00 fstrcond = 9.2007E-01 fiooic = 6.3437E-01 diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT index 30dc9177f1..da68f04e24 100644 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ b/tests/regression/input_files/large_tokamak.IN.DAT @@ -236,9 +236,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index 13b7925033..1acea21b2d 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -218,9 +218,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/regression/input_files/large_tokamak_once_through.IN.DAT b/tests/regression/input_files/large_tokamak_once_through.IN.DAT index f78944cdf8..9ac7261ecf 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -58,7 +58,7 @@ ixc = 29 * dr_bore boundl(29) = 0.1 ixc = 37 * j_cs_flat_top_end ixc = 41 * f_j_cs_start_pulse_end_flat_top -ixc = 44 * fvsbrnni +ixc = 44 * f_c_plasma_non_inductive ixc = 56 * tdmptf ixc = 57 * dr_tf_nose_case ixc = 58 * thwcndut @@ -324,7 +324,7 @@ dene = 7.796223900029837e+19 * electron density (/m3) (`iteration variable 6 beta_norm_max = 3.0 * Troyon-like coefficient for beta scaling calculated fgwsep = 0.5 * fraction of Greenwald density to set as separatrix density; If `<0`; separatrix fkzohm = 1.02 * Zohm elongation scaling adjustment factor (`i_plasma_geometry=2; 3`) -fvsbrnni = 0.4242184436680697 * fraction of the plasma current produced by non-inductive means (`iteration variable 44`) +f_c_plasma_non_inductive = 0.4242184436680697 * fraction of the plasma current produced by non-inductive means (`iteration variable 44`) ejima_coeff = 0.3 * Ejima coefficient for resistive startup V-s formula hfact = 1.185971818905028 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); i_bootstrap_current = 4 * switch for bootstrap current scaling diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 0c8e05cbb9..348c1d00ae 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -2889,7 +2889,7 @@ i_bootstrap_current = 4 * JUSTIFICATION: Not used. *ixc = 44 -*fvsbrnni = +*f_c_plasma_non_inductive = *boundl(44) = *boundu(44) = * DESCRIPTION: Non-inductive volt-sec burn fraction, fraction of the plasma current produced by non-inductive means diff --git a/tests/unit/data/large_tokamak_IN.DAT b/tests/unit/data/large_tokamak_IN.DAT index 87b43aa753..f8bc0d1c4f 100644 --- a/tests/unit/data/large_tokamak_IN.DAT +++ b/tests/unit/data/large_tokamak_IN.DAT @@ -236,9 +236,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 30d3a1da36..d764e3553d 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -543,7 +543,7 @@ Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.3342E-02 Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6376E-01 Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 - Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (fvsbrnni)____________________ 4.3624E-01 ITV + Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 @@ -1427,9 +1427,9 @@ ixc = 29 boundl(29) = 0.1 dr_bore = 2.0 -* fvsbrnni +* f_c_plasma_non_inductive ixc = 44 -fvsbrnni = 0.4 +f_c_plasma_non_inductive = 0.4 * tdmptf [s] ixc = 56 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index e585c269d8..94b6e08e79 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -187,7 +187,7 @@ class CudrivParam(NamedTuple): inductive_current_fraction: Any = None - fvsbrnni: Any = None + f_c_plasma_non_inductive: Any = None startupratio: Any = None @@ -293,7 +293,7 @@ class CudrivParam(NamedTuple): p_plasma_ohmic_mw=0, fusion_power=0, inductive_current_fraction=0.59999999999999998, - fvsbrnni=0.40000000000000002, + f_c_plasma_non_inductive=0.40000000000000002, startupratio=1, iprint=0, outfile=11, @@ -383,7 +383,7 @@ class CudrivParam(NamedTuple): p_plasma_ohmic_mw=0.76707314489379119, fusion_power=1051.6562748933977, inductive_current_fraction=0.59999999999999998, - fvsbrnni=0.40000000000000002, + f_c_plasma_non_inductive=0.40000000000000002, startupratio=1, iprint=0, outfile=11, @@ -706,7 +706,11 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): cudrivparam.inductive_current_fraction, ) - monkeypatch.setattr(physics_variables, "fvsbrnni", cudrivparam.fvsbrnni) + monkeypatch.setattr( + physics_variables, + "f_c_plasma_non_inductive", + cudrivparam.f_c_plasma_non_inductive, + ) monkeypatch.setattr(cost_variables, "startupratio", cudrivparam.startupratio) From bef486e87632f35e0920f2b67c73496d00fc7b25 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 8 Apr 2025 13:19:53 +0100 Subject: [PATCH 31/41] =?UTF-8?q?=F0=9F=94=84=20Rename=20inductive=5Fcurre?= =?UTF-8?q?nt=5Ffraction=20to=20f=5Fc=5Fplasma=5Finductive=20for=20clarity?= =?UTF-8?q?=20and=20update=20related=20calculations=20and=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inductive_plasma_current.md | 2 +- .../data/csv_output_large_tokamak_MFILE.DAT | 4 +- examples/data/large_tokamak_1_MFILE.DAT | 4 +- examples/data/large_tokamak_2_MFILE.DAT | 4 +- examples/data/large_tokamak_3_MFILE.DAT | 4 +- examples/data/large_tokamak_4_MFILE.DAT | 4 +- examples/data/scan_MFILE.DAT | 36 +++++------ process/current_drive.py | 12 ++-- process/io/mfile_comparison.py | 4 +- process/io/plot_proc.py | 10 ++-- process/io/variable_metadata.py | 2 +- process/pfcoil.py | 4 +- process/physics.py | 26 ++++---- process/pulse.py | 2 +- source/fortran/physics_variables.f90 | 2 +- .../data/large_tokamak_1_MFILE.DAT | 4 +- .../data/large_tokamak_2_MFILE.DAT | 4 +- .../data/large_tokamak_3_MFILE.DAT | 4 +- .../data/large_tokamak_4_MFILE.DAT | 4 +- .../integration/data/large_tokamak_MFILE.DAT | 4 +- tests/integration/data/scan_2D_MFILE.DAT | 60 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 36 +++++------ tests/unit/data/large_tokamak_MFILE.DAT | 4 +- tests/unit/test_current_drive.py | 10 ++-- tests/unit/test_physics.py | 14 ++--- tests/unit/test_pulse.py | 10 ++-- tracking/tracking_data.py | 2 +- 27 files changed, 136 insertions(+), 140 deletions(-) diff --git a/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md b/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md index cc3daf30b5..415cab6fa0 100644 --- a/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md +++ b/documentation/proc-pages/physics-models/plasma_current/inductive_plasma_current.md @@ -1,6 +1,6 @@ Currently in `PROCESS` the inductive current fraction from the CS is not calculated directly but is just equal to ($1 - \mathtt{f_c_plasma_non_inductive}$). Where $\mathtt{f_c_plasma_non_inductive}$ is the sum of the fractions of current driven by non inductive means. -This calculated fraction (`inductive_current_fraction`) is then used in the `calculate_volt_second_requirements()` and `burn()` functions to calculate the volt-second requirements and the burn time for a pulsed machine. +This calculated fraction (`f_c_plasma_inductive`) is then used in the `calculate_volt_second_requirements()` and `burn()` functions to calculate the volt-second requirements and the burn time for a pulsed machine. !!! info "Inductive plasma current fraction refactor" diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 250f445e36..cf036d7772 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -546,8 +546,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 5.9038E-04 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8505E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8505E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5213E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 0a4a14439d..1a92f7d498 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index d1e11d7eec..12a938166b 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index c317d01f25..cbbc67f16d 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index a32acbfee0..7e62553076 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 6ec775fe22..16bb4a205a 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -399,8 +399,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -1394,8 +1394,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -2389,8 +2389,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -3384,8 +3384,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -4379,8 +4379,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -5374,8 +5374,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -6369,8 +6369,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -7364,8 +7364,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -8359,8 +8359,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 diff --git a/process/current_drive.py b/process/current_drive.py index 060cc23451..a1d1ad969f 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1730,7 +1730,7 @@ def cudriv(self, output: bool): "Ignited plasma; injected power only used for start-up phase", ) - if abs(physics_variables.inductive_current_fraction) > 1.0e-8: + if abs(physics_variables.f_c_plasma_inductive) > 1.0e-8: po.ocmmnt( self.outfile, "Current is driven by both inductive and non-inductive means.", @@ -2031,24 +2031,24 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Inductive fraction", - "(inductive_current_fraction)", - physics_variables.inductive_current_fraction, + "(f_c_plasma_inductive)", + physics_variables.f_c_plasma_inductive, "OP ", ) # Add total error check. po.ovarrf( self.outfile, "Total", - "(f_c_plasma_internal+aux_current_fraction+inductive_current_fraction)", + "(f_c_plasma_internal+aux_current_fraction+f_c_plasma_inductive)", current_drive_variables.f_c_plasma_internal + physics_variables.aux_current_fraction - + physics_variables.inductive_current_fraction, + + physics_variables.f_c_plasma_inductive, ) if ( abs( current_drive_variables.f_c_plasma_internal + physics_variables.aux_current_fraction - + physics_variables.inductive_current_fraction + + physics_variables.f_c_plasma_inductive - 1.0e0 ) > 1.0e-8 diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index 2a6c4658cc..1beb5a3e0a 100644 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -87,7 +87,7 @@ "p_hcd_primary_extra_heat_mw", "f_c_plasma_bootstrap", "aux_current_fraction", - "inductive_current_fraction", + "f_c_plasma_inductive", "gamnb", "e_beam_kev", "p_plasma_loss_mw", @@ -176,7 +176,7 @@ "p_hcd_primary_extra_heat_mw", "f_c_plasma_bootstrap", "aux_current_fraction", - "inductive_current_fraction", + "f_c_plasma_inductive", "gamnb", "e_beam_kev", "p_plasma_loss_mw", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 4e8788ec8f..462425c414 100644 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -3126,7 +3126,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), ("aux_current_fraction", "Auxiliary fraction", ""), - ("inductive_current_fraction", "Inductive fraction", ""), + ("f_c_plasma_inductive", "Inductive fraction", ""), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), ( "eta_cd_hcd_primary", @@ -3156,7 +3156,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), ("aux_current_fraction", "Auxiliary fraction", ""), - ("inductive_current_fraction", "Inductive fraction", ""), + ("f_c_plasma_inductive", "Inductive fraction", ""), ("gamnb", "NB gamma", "$10^{20}$ A W$^{-1}$ m$^{-2}$"), ("e_beam_kev", "NB energy", "keV"), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), @@ -3182,7 +3182,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), ("aux_current_fraction", "Auxiliary fraction", ""), - ("inductive_current_fraction", "Inductive fraction", ""), + ("f_c_plasma_inductive", "Inductive fraction", ""), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), ( "eta_cd_norm_hcd_primary", @@ -3211,7 +3211,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), ("aux_current_fraction", "Auxiliary fraction", ""), - ("inductive_current_fraction", "Inductive fraction", ""), + ("f_c_plasma_inductive", "Inductive fraction", ""), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), ( "eta_cd_norm_hcd_primary", @@ -3240,7 +3240,7 @@ def plot_current_drive_info(axis, mfile_data, scan): ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), ("aux_current_fraction", "Auxiliary fraction", ""), - ("inductive_current_fraction", "Inductive fraction", ""), + ("f_c_plasma_inductive", "Inductive fraction", ""), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), ( "eta_cd_norm_hcd_primary", diff --git a/process/io/variable_metadata.py b/process/io/variable_metadata.py index 1220eccadc..83c56b448c 100644 --- a/process/io/variable_metadata.py +++ b/process/io/variable_metadata.py @@ -235,7 +235,7 @@ class VariableMetadata: "aux_current_fraction": VariableMetadata( latex=r"$f_{\mathrm{CD}}$", description="CD factor", units="" ), - "inductive_current_fraction": VariableMetadata( + "f_c_plasma_inductive": VariableMetadata( latex=r"$f_{\mathrm{CD,ind}}$", description="Inductive CD factor", units="" ), "f_c_plasma_bootstrap": VariableMetadata( diff --git a/process/pfcoil.py b/process/pfcoil.py index 2b62b0de63..7b13760b45 100644 --- a/process/pfcoil.py +++ b/process/pfcoil.py @@ -1216,7 +1216,7 @@ def ohcalc(self): # Calculation of CS fatigue # this is only valid for pulsed reactor design - if pv.inductive_current_fraction > 0.0e-4: + if pv.f_c_plasma_inductive > 0.0e-4: csfv.n_cycle, csfv.t_crack_radial = self.cs_fatigue.ncycle( pf.sig_hoop, csfv.residual_sig_hoop, @@ -2330,7 +2330,7 @@ def outpf(self): tfv.tmargmin_cs, ) # only output CS fatigue model for pulsed reactor design - if pv.inductive_current_fraction > 0.0e-4: + if pv.f_c_plasma_inductive > 0.0e-4: op.ovarre( self.outfile, "Residual hoop stress in CS Steel (Pa)", diff --git a/process/physics.py b/process/physics.py index c9628871cc..eb62fda5fd 100644 --- a/process/physics.py +++ b/process/physics.py @@ -63,7 +63,7 @@ def rether(alphan, alphat, dene, dlamie, te, ti, zeffai): def calculate_volt_second_requirements( csawth: float, eps: float, - inductive_current_fraction: float, + f_c_plasma_inductive: float, ejima_coeff: float, kappa: float, rmajor: float, @@ -79,8 +79,8 @@ def calculate_volt_second_requirements( :type csawth: float :param eps: Inverse aspect ratio :type eps: float - :param inductive_current_fraction: Fraction of plasma current produced inductively - :type inductive_current_fraction: float + :param f_c_plasma_inductive: Fraction of plasma current produced inductively + :type f_c_plasma_inductive: float :param ejima_coeff: Ejima coefficient for resistive start-up V-s component :type ejima_coeff: float :param kappa: Plasma elongation @@ -163,7 +163,7 @@ def calculate_volt_second_requirements( # Include enhancement factor in flattop V-s requirement # to account for MHD sawtooth effects. - v_plasma_loop_burn = plasma_current * res_plasma * inductive_current_fraction + v_plasma_loop_burn = plasma_current * res_plasma * f_c_plasma_inductive v_burn_resistive = v_plasma_loop_burn * csawth @@ -2032,7 +2032,7 @@ def physics(self): physics_module.err243 = 1 # Fraction of plasma current produced by inductive means - physics_variables.inductive_current_fraction = max( + physics_variables.f_c_plasma_inductive = max( 1.0e-10, (1.0e0 - physics_variables.f_c_plasma_non_inductive) ) # Fraction of plasma current produced by auxiliary current drive @@ -2247,7 +2247,7 @@ def physics(self): physics_variables.f_res_plasma_neo, physics_variables.res_plasma, ) = self.plasma_ohmic_heating( - physics_variables.inductive_current_fraction, + physics_variables.f_c_plasma_inductive, physics_variables.kappa95, physics_variables.plasma_current, physics_variables.rmajor, @@ -2404,7 +2404,7 @@ def physics(self): ) = calculate_volt_second_requirements( physics_variables.csawth, physics_variables.eps, - physics_variables.inductive_current_fraction, + physics_variables.f_c_plasma_inductive, physics_variables.ejima_coeff, physics_variables.kappa, physics_variables.rmajor, @@ -3177,7 +3177,7 @@ def phyaux( @staticmethod def plasma_ohmic_heating( - inductive_current_fraction: float, + f_c_plasma_inductive: float, kappa95: float, plasma_current: float, rmajor: float, @@ -3190,7 +3190,7 @@ def plasma_ohmic_heating( Calculate the ohmic heating power and related parameters. Args: - inductive_current_fraction (float): Fraction of plasma current driven inductively. + f_c_plasma_inductive (float): Fraction of plasma current driven inductively. kappa95 (float): Plasma elongation at 95% surface. plasma_current (float): Plasma current (A). rmajor (float): Major radius (m). @@ -3242,14 +3242,10 @@ def plasma_ohmic_heating( error_handling.report_error(83) # Ohmic heating power per unit volume - # Corrected from: pden_plasma_ohmic_mw = (inductive_current_fraction*plasma_current)**2 * ... + # Corrected from: pden_plasma_ohmic_mw = (f_c_plasma_inductive*plasma_current)**2 * ... pden_plasma_ohmic_mw = ( - inductive_current_fraction - * plasma_current**2 - * res_plasma - * 1.0e-6 - / vol_plasma + f_c_plasma_inductive * plasma_current**2 * res_plasma * 1.0e-6 / vol_plasma ) # Total ohmic heating power diff --git a/process/pulse.py b/process/pulse.py index a5dee23026..669dac2069 100644 --- a/process/pulse.py +++ b/process/pulse.py @@ -177,7 +177,7 @@ def burn(self, output: bool): v_plasma_loop_burn = ( physics_variables.plasma_current * physics_variables.res_plasma - * physics_variables.inductive_current_fraction + * physics_variables.f_c_plasma_inductive * physics_variables.csawth ) diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index e3d2ea566f..5de087fb04 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -211,7 +211,7 @@ module physics_variables real(dp) :: aux_current_fraction !! fraction of plasma current produced by auxiliary current drive - real(dp) :: inductive_current_fraction + real(dp) :: f_c_plasma_inductive !! fraction of plasma current produced inductively real(dp) :: f_alpha_electron diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 2527af9817..0118b639a4 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -543,8 +543,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 12bfc5acb3..46e119122d 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 7bef2a0d52..864f29347c 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index d03890eb5f..641f341e0a 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -544,8 +544,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index dffc283969..7778a76c7e 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -541,8 +541,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.3342E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6376E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6376E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index a70bfbf6b8..6a3a00be31 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -545,8 +545,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.0930E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.0930E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.9070E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -1708,8 +1708,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9548E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9548E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0452E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -2871,8 +2871,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.5526E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8606E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8606E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1394E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5559E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -4034,8 +4034,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.8847E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8847E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1153E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -5197,8 +5197,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9218E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9218E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0782E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -6360,8 +6360,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9136E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9136E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0864E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -7523,8 +7523,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9320E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9320E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0680E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -8686,8 +8686,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9395E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9395E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0605E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -9849,8 +9849,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9780E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9780E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0220E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -11012,8 +11012,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9910E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9910E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0090E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -12175,8 +12175,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9399E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9399E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0601E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -13338,8 +13338,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9353E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9353E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0647E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -14501,8 +14501,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9505E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9505E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -15664,8 +15664,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9754E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9754E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0246E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -16827,8 +16827,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.9990E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9990E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0010E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index f092c81147..b1265c0da2 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -399,8 +399,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -1394,8 +1394,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -2389,8 +2389,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -3384,8 +3384,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -4379,8 +4379,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -5374,8 +5374,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -6369,8 +6369,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -7364,8 +7364,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -8359,8 +8359,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index d764e3553d..86ae2dda17 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -541,8 +541,8 @@ Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.3342E-02 - Inductive_fraction______________________________________________________ (inductive_current_fraction)_______________________ 5.6376E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+inductive_current_fraction)_________ 1.0000E+00 + Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6376E-01 + Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 94b6e08e79..511f13ec74 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -185,7 +185,7 @@ class CudrivParam(NamedTuple): fusion_power: Any = None - inductive_current_fraction: Any = None + f_c_plasma_inductive: Any = None f_c_plasma_non_inductive: Any = None @@ -292,7 +292,7 @@ class CudrivParam(NamedTuple): ignite=0, p_plasma_ohmic_mw=0, fusion_power=0, - inductive_current_fraction=0.59999999999999998, + f_c_plasma_inductive=0.59999999999999998, f_c_plasma_non_inductive=0.40000000000000002, startupratio=1, iprint=0, @@ -382,7 +382,7 @@ class CudrivParam(NamedTuple): ignite=0, p_plasma_ohmic_mw=0.76707314489379119, fusion_power=1051.6562748933977, - inductive_current_fraction=0.59999999999999998, + f_c_plasma_inductive=0.59999999999999998, f_c_plasma_non_inductive=0.40000000000000002, startupratio=1, iprint=0, @@ -702,8 +702,8 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr( physics_variables, - "inductive_current_fraction", - cudrivparam.inductive_current_fraction, + "f_c_plasma_inductive", + cudrivparam.f_c_plasma_inductive, ) monkeypatch.setattr( diff --git a/tests/unit/test_physics.py b/tests/unit/test_physics.py index 4dfebb4b27..63338b3a73 100644 --- a/tests/unit/test_physics.py +++ b/tests/unit/test_physics.py @@ -1738,7 +1738,7 @@ class VoltSecondReqParam(NamedTuple): eps: Any = None - inductive_current_fraction: Any = None + f_c_plasma_inductive: Any = None ejima_coeff: Any = None @@ -1777,7 +1777,7 @@ class VoltSecondReqParam(NamedTuple): VoltSecondReqParam( csawth=1, eps=0.33333333333333331, - inductive_current_fraction=0.59999999999999998, + f_c_plasma_inductive=0.59999999999999998, ejima_coeff=0.30000000000000004, kappa=1.8500000000000001, plasma_current=18398455.678867526, @@ -1797,7 +1797,7 @@ class VoltSecondReqParam(NamedTuple): VoltSecondReqParam( csawth=1, eps=0.33333333333333331, - inductive_current_fraction=0.59999999999999998, + f_c_plasma_inductive=0.59999999999999998, ejima_coeff=0.30000000000000004, kappa=1.8500000000000001, plasma_current=18398455.678867526, @@ -1837,7 +1837,7 @@ def test_vscalc(voltsecondreqparam): ) = calculate_volt_second_requirements( csawth=voltsecondreqparam.csawth, eps=voltsecondreqparam.eps, - inductive_current_fraction=voltsecondreqparam.inductive_current_fraction, + f_c_plasma_inductive=voltsecondreqparam.f_c_plasma_inductive, ejima_coeff=voltsecondreqparam.ejima_coeff, kappa=voltsecondreqparam.kappa, plasma_current=voltsecondreqparam.plasma_current, @@ -2031,7 +2031,7 @@ class PohmParam(NamedTuple): plasma_res_factor: Any = None - inductive_current_fraction: Any = None + f_c_plasma_inductive: Any = None kappa95: Any = None @@ -2062,7 +2062,7 @@ class PohmParam(NamedTuple): PohmParam( aspect=3, plasma_res_factor=0.70000000000000007, - inductive_current_fraction=0.59999999999999998, + f_c_plasma_inductive=0.59999999999999998, kappa95=1.6517857142857142, plasma_current=18398455.678867526, rmajor=8, @@ -2102,7 +2102,7 @@ def test_pohm(pohmparam, monkeypatch, physics): f_res_plasma_neo, res_plasma, ) = physics.plasma_ohmic_heating( - inductive_current_fraction=pohmparam.inductive_current_fraction, + f_c_plasma_inductive=pohmparam.f_c_plasma_inductive, kappa95=pohmparam.kappa95, plasma_current=pohmparam.plasma_current, rmajor=pohmparam.rmajor, diff --git a/tests/unit/test_pulse.py b/tests/unit/test_pulse.py index c0a445ef2d..d8711681c6 100644 --- a/tests/unit/test_pulse.py +++ b/tests/unit/test_pulse.py @@ -76,7 +76,7 @@ class BurnParam(NamedTuple): plasma_current: Any = None - inductive_current_fraction: Any = None + f_c_plasma_inductive: Any = None csawth: Any = None @@ -1290,7 +1290,7 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): vs_cs_pf_total_burn=0, vs_cs_pf_total_pulse=-718.91787876294552, plasma_current=17721306.969367817, - inductive_current_fraction=0.60433999999999999, + f_c_plasma_inductive=0.60433999999999999, csawth=1, i_pulsed_plant=1, t_burn=0, @@ -1306,7 +1306,7 @@ def test_tohswg(tohswgparam, monkeypatch, pulse): vs_cs_pf_total_pulse=-718.9849676846776, vs_cs_pf_total_burn=-354.76231817639609, plasma_current=17721306.969367817, - inductive_current_fraction=0.60433999999999999, + f_c_plasma_inductive=0.60433999999999999, csawth=1, i_pulsed_plant=1, t_burn=10234.092022756307, @@ -1352,8 +1352,8 @@ def test_burn(burnparam, monkeypatch, initialise_error_module, pulse): monkeypatch.setattr( physics_variables, - "inductive_current_fraction", - burnparam.inductive_current_fraction, + "f_c_plasma_inductive", + burnparam.f_c_plasma_inductive, ) monkeypatch.setattr(physics_variables, "csawth", burnparam.csawth) diff --git a/tracking/tracking_data.py b/tracking/tracking_data.py index 6b6c28d08f..f953a223c6 100644 --- a/tracking/tracking_data.py +++ b/tracking/tracking_data.py @@ -126,7 +126,7 @@ class ProcessTracker: "q95", "te", "beta", - "inductive_current_fraction", + "f_c_plasma_inductive", "zeff", "bt", "hfact", From 01d9240596ca015ad961134e667bf2e2e6f4bfa5 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 8 Apr 2025 13:20:59 +0100 Subject: [PATCH 32/41] =?UTF-8?q?=F0=9F=94=84=20Rename=20aux=5Fcurrent=5Ff?= =?UTF-8?q?raction=20to=20f=5Fc=5Fplasma=5Fauxiliary=20for=20clarity=20and?= =?UTF-8?q?=20update=20related=20calculations=20and=20data=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/csv_output_large_tokamak_MFILE.DAT | 4 +- examples/data/large_tokamak_1_MFILE.DAT | 4 +- examples/data/large_tokamak_2_MFILE.DAT | 4 +- examples/data/large_tokamak_3_MFILE.DAT | 4 +- examples/data/large_tokamak_4_MFILE.DAT | 4 +- examples/data/scan_MFILE.DAT | 36 +++++------ process/current_drive.py | 12 ++-- process/io/mfile_comparison.py | 4 +- process/io/plot_proc.py | 10 ++-- process/io/variable_metadata.py | 2 +- process/physics.py | 2 +- source/fortran/physics_variables.f90 | 2 +- .../data/large_tokamak_1_MFILE.DAT | 4 +- .../data/large_tokamak_2_MFILE.DAT | 4 +- .../data/large_tokamak_3_MFILE.DAT | 4 +- .../data/large_tokamak_4_MFILE.DAT | 4 +- .../integration/data/large_tokamak_MFILE.DAT | 4 +- tests/integration/data/scan_2D_MFILE.DAT | 60 +++++++++---------- tests/integration/data/scan_MFILE.DAT | 36 +++++------ tests/unit/data/large_tokamak_MFILE.DAT | 4 +- tests/unit/test_current_drive.py | 8 +-- tracking/tracking_data.py | 2 +- 22 files changed, 109 insertions(+), 109 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index cf036d7772..e13b50249f 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -545,9 +545,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1436E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 5.9038E-04 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 5.9038E-04 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8505E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5213E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 1a92f7d498..3206778612 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 12a938166b..4e3bea4432 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index cbbc67f16d..5ddf85c33e 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index 7e62553076..c5b61cec1b 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index 16bb4a205a..a5e0d15db4 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -398,9 +398,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -1393,9 +1393,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -2388,9 +2388,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -3383,9 +3383,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -4378,9 +4378,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -5373,9 +5373,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -6368,9 +6368,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -7363,9 +7363,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -8358,9 +8358,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 diff --git a/process/current_drive.py b/process/current_drive.py index a1d1ad969f..ef61ccd602 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1324,7 +1324,7 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_primary_injected_mw = ( 1.0e-6 * ( - physics_variables.aux_current_fraction + physics_variables.f_c_plasma_auxiliary - current_drive_variables.f_c_plasma_hcd_secondary ) * physics_variables.plasma_current @@ -2024,8 +2024,8 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Auxiliary current drive fraction", - "(aux_current_fraction)", - physics_variables.aux_current_fraction, + "(f_c_plasma_auxiliary)", + physics_variables.f_c_plasma_auxiliary, "OP ", ) po.ovarrf( @@ -2039,15 +2039,15 @@ def cudriv(self, output: bool): po.ovarrf( self.outfile, "Total", - "(f_c_plasma_internal+aux_current_fraction+f_c_plasma_inductive)", + "(f_c_plasma_internal+f_c_plasma_auxiliary+f_c_plasma_inductive)", current_drive_variables.f_c_plasma_internal - + physics_variables.aux_current_fraction + + physics_variables.f_c_plasma_auxiliary + physics_variables.f_c_plasma_inductive, ) if ( abs( current_drive_variables.f_c_plasma_internal - + physics_variables.aux_current_fraction + + physics_variables.f_c_plasma_auxiliary + physics_variables.f_c_plasma_inductive - 1.0e0 ) diff --git a/process/io/mfile_comparison.py b/process/io/mfile_comparison.py index 1beb5a3e0a..d3cd5536b3 100644 --- a/process/io/mfile_comparison.py +++ b/process/io/mfile_comparison.py @@ -86,7 +86,7 @@ "p_plasma_separatrix_mw", "p_hcd_primary_extra_heat_mw", "f_c_plasma_bootstrap", - "aux_current_fraction", + "f_c_plasma_auxiliary", "f_c_plasma_inductive", "gamnb", "e_beam_kev", @@ -175,7 +175,7 @@ "p_hcd_injected_total_mw", "p_hcd_primary_extra_heat_mw", "f_c_plasma_bootstrap", - "aux_current_fraction", + "f_c_plasma_auxiliary", "f_c_plasma_inductive", "gamnb", "e_beam_kev", diff --git a/process/io/plot_proc.py b/process/io/plot_proc.py index 462425c414..019623dcc2 100644 --- a/process/io/plot_proc.py +++ b/process/io/plot_proc.py @@ -3125,7 +3125,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), - ("aux_current_fraction", "Auxiliary fraction", ""), + ("f_c_plasma_auxiliary", "Auxiliary fraction", ""), ("f_c_plasma_inductive", "Inductive fraction", ""), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), ( @@ -3155,7 +3155,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), - ("aux_current_fraction", "Auxiliary fraction", ""), + ("f_c_plasma_auxiliary", "Auxiliary fraction", ""), ("f_c_plasma_inductive", "Inductive fraction", ""), ("gamnb", "NB gamma", "$10^{20}$ A W$^{-1}$ m$^{-2}$"), ("e_beam_kev", "NB energy", "keV"), @@ -3181,7 +3181,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), - ("aux_current_fraction", "Auxiliary fraction", ""), + ("f_c_plasma_auxiliary", "Auxiliary fraction", ""), ("f_c_plasma_inductive", "Inductive fraction", ""), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), ( @@ -3210,7 +3210,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), - ("aux_current_fraction", "Auxiliary fraction", ""), + ("f_c_plasma_auxiliary", "Auxiliary fraction", ""), ("f_c_plasma_inductive", "Inductive fraction", ""), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), ( @@ -3239,7 +3239,7 @@ def plot_current_drive_info(axis, mfile_data, scan): (pinjie, "Steady state auxiliary power", "MW"), ("p_hcd_primary_extra_heat_mw", "Power for heating only", "MW"), ("f_c_plasma_bootstrap", "Bootstrap fraction", ""), - ("aux_current_fraction", "Auxiliary fraction", ""), + ("f_c_plasma_auxiliary", "Auxiliary fraction", ""), ("f_c_plasma_inductive", "Inductive fraction", ""), ("p_plasma_loss_mw", "Plasma heating used for H factor", "MW"), ( diff --git a/process/io/variable_metadata.py b/process/io/variable_metadata.py index 83c56b448c..9aa213f9c1 100644 --- a/process/io/variable_metadata.py +++ b/process/io/variable_metadata.py @@ -232,7 +232,7 @@ class VariableMetadata: latex=r"$\eta_{\mathrm{CD}}$[$A/W$]", description="CD efficiency", units="A/W" ), "bigq": VariableMetadata(latex=r"$Q$", description="Plasma Q value", units=""), - "aux_current_fraction": VariableMetadata( + "f_c_plasma_auxiliary": VariableMetadata( latex=r"$f_{\mathrm{CD}}$", description="CD factor", units="" ), "f_c_plasma_inductive": VariableMetadata( diff --git a/process/physics.py b/process/physics.py index eb62fda5fd..768c2307c6 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2036,7 +2036,7 @@ def physics(self): 1.0e-10, (1.0e0 - physics_variables.f_c_plasma_non_inductive) ) # Fraction of plasma current produced by auxiliary current drive - physics_variables.aux_current_fraction = ( + physics_variables.f_c_plasma_auxiliary = ( physics_variables.f_c_plasma_non_inductive - current_drive_variables.f_c_plasma_internal ) diff --git a/source/fortran/physics_variables.f90 b/source/fortran/physics_variables.f90 index 5de087fb04..496c687f7c 100644 --- a/source/fortran/physics_variables.f90 +++ b/source/fortran/physics_variables.f90 @@ -208,7 +208,7 @@ module physics_variables real(dp) :: eps !! inverse aspect ratio - real(dp) :: aux_current_fraction + real(dp) :: f_c_plasma_auxiliary !! fraction of plasma current produced by auxiliary current drive real(dp) :: f_c_plasma_inductive diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 0118b639a4..9b57a203c3 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -542,9 +542,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 46e119122d..06fd5d7553 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 864f29347c..86fa63b6a7 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index 641f341e0a..fd1fcae091 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -543,9 +543,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1920E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.4376E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.4376E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 7778a76c7e..4a8d524f48 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -540,9 +540,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2290E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.3342E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.3342E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6376E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 6a3a00be31..23c056af5f 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -544,9 +544,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1061E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.0930E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.9070E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -1707,9 +1707,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1146E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9548E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0452E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -2870,9 +2870,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1238E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.5526E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.5526E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8606E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1394E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5559E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -4033,9 +4033,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1715E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8847E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1153E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -5196,9 +5196,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1531E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9218E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0782E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -6359,9 +6359,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1452E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9136E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0864E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -7522,9 +7522,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.1915E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9320E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0680E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -8685,9 +8685,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2074E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9395E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0605E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -9848,9 +9848,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2337E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9780E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0220E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -11011,9 +11011,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2713E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9910E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0090E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -12174,9 +12174,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2391E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9399E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0601E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -13337,9 +13337,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2221E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9353E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0647E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -14500,9 +14500,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2611E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9505E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0495E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -15663,9 +15663,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2685E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9754E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0246E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 @@ -16826,9 +16826,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2763E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 0.0000E+00 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 0.0000E+00 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9990E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0010E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index b1265c0da2..54597237d1 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -398,9 +398,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -1393,9 +1393,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -2388,9 +2388,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -3383,9 +3383,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -4378,9 +4378,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -5373,9 +5373,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -6368,9 +6368,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -7363,9 +7363,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 @@ -8358,9 +8358,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 3.8470E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 2.5418E-03 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 2.5418E-03 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 86ae2dda17..811f965f8f 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -540,9 +540,9 @@ Bootstrap_fraction______________________________________________________ (bootipf)_____________________ 4.2290E-01 Diamagnetic_fraction____________________________________________________ (diaipf)______________________ 0.0000E+00 Pfirsch-Schlueter_fraction______________________________________________ (f_c_plasma_pfirsch_schluter)_______________________ 0.0000E+00 - Auxiliary_current_drive_fraction________________________________________ (aux_current_fraction)_______________________ 1.3342E-02 + Auxiliary_current_drive_fraction________________________________________ (f_c_plasma_auxiliary)_______________________ 1.3342E-02 Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6376E-01 - Total___________________________________________________________________ (plasipf+aux_current_fraction+f_c_plasma_inductive)_________ 1.0000E+00 + Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3624E-01 ITV Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 511f13ec74..6463dbb5aa 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -177,7 +177,7 @@ class CudrivParam(NamedTuple): ipedestal: Any = None - aux_current_fraction: Any = None + f_c_plasma_auxiliary: Any = None ignite: Any = None @@ -288,7 +288,7 @@ class CudrivParam(NamedTuple): tbeta=2, plasma_current=18398455.678867526, ipedestal=1, - aux_current_fraction=0.12364081253383186, + f_c_plasma_auxiliary=0.12364081253383186, ignite=0, p_plasma_ohmic_mw=0, fusion_power=0, @@ -378,7 +378,7 @@ class CudrivParam(NamedTuple): tbeta=2, plasma_current=18398455.678867526, ipedestal=1, - aux_current_fraction=0.12364081253383186, + f_c_plasma_auxiliary=0.12364081253383186, ignite=0, p_plasma_ohmic_mw=0.76707314489379119, fusion_power=1051.6562748933977, @@ -689,7 +689,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(physics_variables, "ipedestal", cudrivparam.ipedestal) monkeypatch.setattr( - physics_variables, "aux_current_fraction", cudrivparam.aux_current_fraction + physics_variables, "f_c_plasma_auxiliary", cudrivparam.f_c_plasma_auxiliary ) monkeypatch.setattr(physics_variables, "ignite", cudrivparam.ignite) diff --git a/tracking/tracking_data.py b/tracking/tracking_data.py index f953a223c6..cbe7c646cc 100644 --- a/tracking/tracking_data.py +++ b/tracking/tracking_data.py @@ -139,7 +139,7 @@ class ProcessTracker: "dene", "p_plasma_rad_mw", "ne0", - "aux_current_fraction", + "f_c_plasma_auxiliary", "nd_impurities", "t_energy_confinement", "te0", From 7b35f0eae3f8a9aa0dfb91c423faf524d254423a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 8 Apr 2025 15:44:49 +0100 Subject: [PATCH 33/41] :memo: Fix nbi in output --- process/current_drive.py | 512 +++++++++++++++++++++++---------------- 1 file changed, 301 insertions(+), 211 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index ef61ccd602..e00deff16f 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1847,6 +1847,135 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) + if current_drive_variables.i_hcd_primary in [5, 8]: + po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "Neutral beam power balance :") + po.ocmmnt(self.outfile, "----------------------------") + + po.ovarre( + self.outfile, + "Neutral beam energy (keV)", + "(e_beam_kev)", + current_drive_variables.e_beam_kev, + ) + if (current_drive_variables.i_hcd_primary == 5) or ( + current_drive_variables.i_hcd_primary == 8 + ): + po.ovarre( + self.outfile, + "Neutral beam current (A)", + "(c_beam_total)", + current_drive_variables.c_beam_total, + "OP ", + ) + + if (current_drive_variables.i_hcd_secondary == 5) or ( + current_drive_variables.i_hcd_secondary == 8 + ): + po.ovarre( + self.outfile, + "Secondary fixed neutral beam current (A)", + "(beam_current_fix)", + beam_current_fix, + "OP ", + ) + + po.ovarre( + self.outfile, + "Neutral beam wall plug efficiency", + "(eta_beam_injector_wall_plug)", + current_drive_variables.eta_beam_injector_wall_plug, + ) + po.ovarre( + self.outfile, + "Beam decay lengths to centre", + "(n_beam_decay_lengths_core)", + current_drive_variables.n_beam_decay_lengths_core, + "OP ", + ) + po.ovarre( + self.outfile, + "Beam shine-through fraction", + "(f_p_beam_shine_through)", + current_drive_variables.f_p_beam_shine_through, + "OP ", + ) + + if (current_drive_variables.i_hcd_primary == 5) or ( + current_drive_variables.i_hcd_primary == 8 + ): + po.ovarrf( + self.outfile, + "Beam first orbit loss power (MW)", + "(p_beam_orbit_loss_mw)", + current_drive_variables.p_beam_orbit_loss_mw, + "OP ", + ) + po.ovarrf( + self.outfile, + "Beam shine-through power [MW]", + "(p_beam_shine_through_mw)", + current_drive_variables.p_beam_shine_through_mw, + "OP ", + ) + po.ovarrf( + self.outfile, + "Beam power deposited in plasma (MW)", + "(p_hcd_injected_total_mw)", + pinjmw1, + "OP ", + ) + po.ovarrf( + self.outfile, + "Maximum allowable beam power (MW)", + "(p_hcd_injected_max)", + current_drive_variables.p_hcd_injected_max, + ) + po.oblnkl(self.outfile) + po.ovarrf( + self.outfile, + "Beam power entering vacuum vessel (MW)", + "(p_beam_injected_mw)", + current_drive_variables.p_beam_injected_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Fraction of beam energy to ions", + "(f_p_beam_injected_ions)", + current_drive_variables.f_p_beam_injected_ions, + "OP ", + ) + po.ovarre( + self.outfile, + "Beam duct shielding thickness (m)", + "(dx_beam_shield)", + current_drive_variables.dx_beam_shield, + ) + po.ovarre( + self.outfile, + "Beam tangency radius / Plasma major radius", + "(frbeam)", + current_drive_variables.frbeam, + ) + po.ovarre( + self.outfile, + "Beam centreline tangency radius (m)", + "(rtanbeam)", + current_drive_variables.rtanbeam, + "OP ", + ) + po.ovarre( + self.outfile, + "Maximum possible tangency radius (m)", + "(rtanmax)", + current_drive_variables.rtanmax, + "OP ", + ) + + po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "----------------------------") + po.oblnkl(self.outfile) po.ovarin( self.outfile, "Secondary current drive efficiency model", @@ -1936,6 +2065,134 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) + if current_drive_variables.i_hcd_secondary in [5, 8]: + po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "Neutral beam power balance :") + po.ocmmnt(self.outfile, "----------------------------") + + po.ovarre( + self.outfile, + "Neutral beam energy (keV)", + "(e_beam_kev)", + current_drive_variables.e_beam_kev, + ) + if (current_drive_variables.i_hcd_primary == 5) or ( + current_drive_variables.i_hcd_primary == 8 + ): + po.ovarre( + self.outfile, + "Neutral beam current (A)", + "(c_beam_total)", + current_drive_variables.c_beam_total, + "OP ", + ) + + if (current_drive_variables.i_hcd_secondary == 5) or ( + current_drive_variables.i_hcd_secondary == 8 + ): + po.ovarre( + self.outfile, + "Secondary fixed neutral beam current (A)", + "(beam_current_fix)", + beam_current_fix, + "OP ", + ) + + po.ovarre( + self.outfile, + "Neutral beam wall plug efficiency", + "(eta_beam_injector_wall_plug)", + current_drive_variables.eta_beam_injector_wall_plug, + ) + po.ovarre( + self.outfile, + "Beam decay lengths to centre", + "(n_beam_decay_lengths_core)", + current_drive_variables.n_beam_decay_lengths_core, + "OP ", + ) + po.ovarre( + self.outfile, + "Beam shine-through fraction", + "(f_p_beam_shine_through)", + current_drive_variables.f_p_beam_shine_through, + "OP ", + ) + + if (current_drive_variables.i_hcd_primary == 5) or ( + current_drive_variables.i_hcd_primary == 8 + ): + po.ovarrf( + self.outfile, + "Beam first orbit loss power (MW)", + "(p_beam_orbit_loss_mw)", + current_drive_variables.p_beam_orbit_loss_mw, + "OP ", + ) + po.ovarrf( + self.outfile, + "Beam shine-through power [MW]", + "(p_beam_shine_through_mw)", + current_drive_variables.p_beam_shine_through_mw, + "OP ", + ) + po.ovarrf( + self.outfile, + "Beam power deposited in plasma (MW)", + "(p_hcd_injected_total_mw)", + pinjmw1, + "OP ", + ) + po.ovarrf( + self.outfile, + "Maximum allowable beam power (MW)", + "(p_hcd_injected_max)", + current_drive_variables.p_hcd_injected_max, + ) + po.oblnkl(self.outfile) + po.ovarrf( + self.outfile, + "Beam power entering vacuum vessel (MW)", + "(p_beam_injected_mw)", + current_drive_variables.p_beam_injected_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Fraction of beam energy to ions", + "(f_p_beam_injected_ions)", + current_drive_variables.f_p_beam_injected_ions, + "OP ", + ) + po.ovarre( + self.outfile, + "Beam duct shielding thickness (m)", + "(dx_beam_shield)", + current_drive_variables.dx_beam_shield, + ) + po.ovarre( + self.outfile, + "Beam tangency radius / Plasma major radius", + "(frbeam)", + current_drive_variables.frbeam, + ) + po.ovarre( + self.outfile, + "Beam centreline tangency radius (m)", + "(rtanbeam)", + current_drive_variables.rtanbeam, + "OP ", + ) + po.ovarre( + self.outfile, + "Maximum possible tangency radius (m)", + "(rtanmax)", + current_drive_variables.rtanmax, + "OP ", + ) + + po.ocmmnt(self.outfile, "----------------------------") + po.osubhd(self.outfile, "Totals :") po.ovarre( @@ -1955,6 +2212,34 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) + po.oblnkl(self.outfile) + + po.osubhd(self.outfile, "Contributions:") + + po.ovarre( + self.outfile, + "Injected power into plasma from lower hybrid systems (MW)", + "(p_hcd_lowhyb_injected_total_mw)", + current_drive_variables.p_hcd_lowhyb_injected_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Injected power into plasma from ion cyclotron systems (MW)", + "(p_hcd_icrh_injected_total_mw)", + current_drive_variables.p_hcd_icrh_injected_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Injected power into plasma from lower hybrid systems (MW)", + "(p_hcd_ebw_injected_total_mw)", + current_drive_variables.p_hcd_ebw_injected_total_mw, + "OP ", + ) + + po.oblnkl(self.outfile) + po.ovarre( self.outfile, "Ratio of power for flat-top to start-up (MW)", @@ -2075,233 +2360,38 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) - if abs(current_drive_variables.p_hcd_lowhyb_injected_total_mw) > 1.0e-8: - po.ovarre( - self.outfile, - "Lower hybrid injected power (MW)", - "(p_hcd_lowhyb_injected_total_mw)", - current_drive_variables.p_hcd_lowhyb_injected_total_mw, - "OP ", - ) - po.ovarre( - self.outfile, - "Lower hybrid wall plug efficiency", - "(eta_lowhyb_injector_wall_plug)", - current_drive_variables.eta_lowhyb_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "Lower hybrid wall plug power (MW)", - "(p_hcd_lowhyb_electric_mw)", - current_drive_variables.p_hcd_lowhyb_electric_mw, - "OP ", - ) - # MDK rearranged and added current_drive_variables.p_beam_shine_through_mw # if (abs(current_drive_variables.p_hcd_beam_injected_total_mw) > 1.0e-8) : - if ( - (current_drive_variables.i_hcd_primary == 5) - or (current_drive_variables.i_hcd_primary == 8) - or (current_drive_variables.i_hcd_secondary == 5) - or (current_drive_variables.i_hcd_secondary == 8) - ): - po.ovarre( - self.outfile, - "Neutral beam energy (keV)", - "(e_beam_kev)", - current_drive_variables.e_beam_kev, - ) - if (current_drive_variables.i_hcd_primary == 5) or ( - current_drive_variables.i_hcd_primary == 8 - ): - po.ovarre( - self.outfile, - "Neutral beam current (A)", - "(c_beam_total)", - current_drive_variables.c_beam_total, - "OP ", - ) - - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.ovarre( - self.outfile, - "Secondary fixed neutral beam current (A)", - "(beam_current_fix)", - beam_current_fix, - "OP ", - ) - - po.ovarre( - self.outfile, - "Neutral beam wall plug efficiency", - "(eta_beam_injector_wall_plug)", - current_drive_variables.eta_beam_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "Beam decay lengths to centre", - "(n_beam_decay_lengths_core)", - current_drive_variables.n_beam_decay_lengths_core, - "OP ", - ) - po.ovarre( - self.outfile, - "Beam shine-through fraction", - "(f_p_beam_shine_through)", - current_drive_variables.f_p_beam_shine_through, - "OP ", - ) - po.ovarre( - self.outfile, - "Neutral beam wall plug power (MW)", - "(pwpnb)", - current_drive_variables.pwpnb, - "OP ", - ) + if (current_drive_variables.i_hcd_secondary == 5) or ( + current_drive_variables.i_hcd_secondary == 8 + ): po.oblnkl(self.outfile) - po.ocmmnt(self.outfile, "Neutral beam power balance :") + po.ocmmnt(self.outfile, "Secondary fixed neutral beam power balance :") po.ocmmnt(self.outfile, "----------------------------") - if (current_drive_variables.i_hcd_primary == 5) or ( - current_drive_variables.i_hcd_primary == 8 - ): - po.ovarrf( - self.outfile, - "Beam first orbit loss power (MW)", - "(p_beam_orbit_loss_mw)", - current_drive_variables.p_beam_orbit_loss_mw, - "OP ", - ) - po.ovarrf( - self.outfile, - "Beam shine-through power [MW]", - "(p_beam_shine_through_mw)", - current_drive_variables.p_beam_shine_through_mw, - "OP ", - ) - po.ovarrf( - self.outfile, - "Beam power deposited in plasma (MW)", - "(p_hcd_injected_total_mw)", - pinjmw1, - "OP ", - ) - po.ovarrf( - self.outfile, - "Maximum allowable beam power (MW)", - "(p_hcd_injected_max)", - current_drive_variables.p_hcd_injected_max, - ) - po.ovarrf( - self.outfile, - "Total (MW)", - "(current_drive_variables.p_beam_orbit_loss_mw+current_drive_variables.p_beam_shine_through_mw+current_drive_variables.p_hcd_injected_total_mw)", - current_drive_variables.p_beam_orbit_loss_mw - + current_drive_variables.p_beam_shine_through_mw - + pinjmw1, - ) - po.oblnkl(self.outfile) - po.ovarrf( - self.outfile, - "Beam power entering vacuum vessel (MW)", - "(p_beam_injected_mw)", - current_drive_variables.p_beam_injected_mw, - "OP ", - ) - - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.oblnkl(self.outfile) - po.ocmmnt(self.outfile, "Secondary fixed neutral beam power balance :") - po.ocmmnt(self.outfile, "----------------------------") - po.ovarrf( - self.outfile, - "Secondary fixed beam first orbit loss power (MW)", - "(porbitlossmwfix)", - porbitlossmwfix, - "OP ", - ) - po.ovarrf( - self.outfile, - "Secondary fixed beam power deposited in plasma (MW)", - "(pinjmwfix)", - pinjmwfix, - "OP ", - ) - po.ovarrf( - self.outfile, - "Maximum allowable beam power (MW)", - "(p_hcd_injected_max)", - current_drive_variables.p_hcd_injected_max, - ) - po.oblnkl(self.outfile) - - po.oblnkl(self.outfile) - - po.ovarre( - self.outfile, - "Fraction of beam energy to ions", - "(f_p_beam_injected_ions)", - current_drive_variables.f_p_beam_injected_ions, - "OP ", - ) - po.ovarre( - self.outfile, - "Beam duct shielding thickness (m)", - "(dx_beam_shield)", - current_drive_variables.dx_beam_shield, - ) - po.ovarre( - self.outfile, - "Beam tangency radius / Plasma major radius", - "(frbeam)", - current_drive_variables.frbeam, - ) - po.ovarre( - self.outfile, - "Beam centreline tangency radius (m)", - "(rtanbeam)", - current_drive_variables.rtanbeam, - "OP ", - ) - po.ovarre( + po.ovarrf( self.outfile, - "Maximum possible tangency radius (m)", - "(rtanmax)", - current_drive_variables.rtanmax, + "Secondary fixed beam first orbit loss power (MW)", + "(porbitlossmwfix)", + porbitlossmwfix, "OP ", ) - - if abs(current_drive_variables.p_ecrh_injected_mw) > 1.0e-8: - po.ovarre( + po.ovarrf( self.outfile, - "Electron cyclotron injected power (MW)", - "(p_ecrh_injected_mw)", - current_drive_variables.p_ecrh_injected_mw, + "Secondary fixed beam power deposited in plasma (MW)", + "(pinjmwfix)", + pinjmwfix, "OP ", ) po.ovarrf( self.outfile, - "Maximum allowable ECRH power (MW)", + "Maximum allowable beam power (MW)", "(p_hcd_injected_max)", current_drive_variables.p_hcd_injected_max, ) - po.ovarre( - self.outfile, - "ECH wall plug efficiency", - "(eta_ecrh_injector_wall_plug)", - current_drive_variables.eta_ecrh_injector_wall_plug, - ) - po.ovarre( - self.outfile, - "ECH wall plug power (MW)", - "(p_hcd_ecrh_electric_mw)", - current_drive_variables.p_hcd_ecrh_electric_mw, - "OP ", - ) + po.oblnkl(self.outfile) + + po.oblnkl(self.outfile) def legend(self, zlocal, arg): """Routine to calculate Legendre function and its derivative From 287d0f359d5ab8e3cbf4af27de02752e470a9b5a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Apr 2025 11:34:25 +0100 Subject: [PATCH 34/41] Post rebase updates --- .../data/csv_output_large_tokamak_MFILE.DAT | 6 +- examples/data/large_tokamak_1_MFILE.DAT | 6 +- examples/data/large_tokamak_2_MFILE.DAT | 6 +- examples/data/large_tokamak_3_MFILE.DAT | 6 +- examples/data/large_tokamak_4_MFILE.DAT | 6 +- .../data/large_tokamak_once_through_IN.DAT | 4 +- process/current_drive.py | 116 +++++++++++++++--- process/iteration_variables.py | 4 +- process/physics.py | 6 +- process/power.py | 4 +- 10 files changed, 126 insertions(+), 38 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index e13b50249f..023c25e24c 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -127,9 +127,9 @@ bore____________________________________________________________________ (itvar035)____________________ 2.0588E+00 bore_(final_value/initial_value)________________________________________ (xcm035)______________________ 1.0294E+00 bore_(range_normalised)_________________________________________________ (nitvar035)___________________ 1.9786E-01 - fvsbrnni________________________________________________________________ (itvar036)____________________ 4.1495E-01 - fvsbrnni_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0374E+00 - fvsbrnni_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.1437E-01 + f_c_plasma_non_inductive________________________________________________________________ (itvar036)____________________ 4.1495E-01 + f_c_plasma_non_inductive_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0374E+00 + f_c_plasma_non_inductive_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.1437E-01 tdmptf__________________________________________________________________ (itvar037)____________________ 1.9607E+01 tdmptf_(final_value/initial_value)______________________________________ (xcm037)______________________ 7.8427E-01 tdmptf_(range_normalised)_______________________________________________ (nitvar037)___________________ 1.9526E-01 diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 3206778612..4220d0042f 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -128,9 +128,9 @@ bore____________________________________________________________________ (itvar035)____________________ 1.9854E+00 bore_(final_value/initial_value)________________________________________ (xcm035)______________________ 9.9271E-01 bore_(range_normalised)_________________________________________________ (nitvar035)___________________ 1.9045E-01 - fvsbrnni________________________________________________________________ (itvar036)____________________ 4.3358E-01 - fvsbrnni_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0839E+00 - fvsbrnni_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.3301E-01 + f_c_plasma_non_inductive________________________________________________________________ (itvar036)____________________ 4.3358E-01 + f_c_plasma_non_inductive_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0839E+00 + f_c_plasma_non_inductive_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.3301E-01 tdmptf__________________________________________________________________ (itvar037)____________________ 1.8429E+01 tdmptf_(final_value/initial_value)______________________________________ (xcm037)______________________ 7.3716E-01 tdmptf_(range_normalised)_______________________________________________ (nitvar037)___________________ 1.8347E-01 diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index 4e3bea4432..ffa1f55a8e 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -128,9 +128,9 @@ bore____________________________________________________________________ (itvar035)____________________ 1.9854E+00 bore_(final_value/initial_value)________________________________________ (xcm035)______________________ 9.9271E-01 bore_(range_normalised)_________________________________________________ (nitvar035)___________________ 1.9045E-01 - fvsbrnni________________________________________________________________ (itvar036)____________________ 4.3358E-01 - fvsbrnni_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0839E+00 - fvsbrnni_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.3301E-01 + f_c_plasma_non_inductive________________________________________________________________ (itvar036)____________________ 4.3358E-01 + f_c_plasma_non_inductive_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0839E+00 + f_c_plasma_non_inductive_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.3301E-01 tdmptf__________________________________________________________________ (itvar037)____________________ 1.8429E+01 tdmptf_(final_value/initial_value)______________________________________ (xcm037)______________________ 7.3716E-01 tdmptf_(range_normalised)_______________________________________________ (nitvar037)___________________ 1.8347E-01 diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 5ddf85c33e..19a82de289 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -128,9 +128,9 @@ bore____________________________________________________________________ (itvar035)____________________ 1.1854E+00 bore_(final_value/initial_value)________________________________________ (xcm035)______________________ 9.9271E-01 bore_(range_normalised)_________________________________________________ (nitvar035)___________________ 1.9045E-01 - fvsbrnni________________________________________________________________ (itvar036)____________________ 4.5358E-01 - fvsbrnni_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0839E+00 - fvsbrnni_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.3301E-01 + f_c_plasma_non_inductive________________________________________________________________ (itvar036)____________________ 4.5358E-01 + f_c_plasma_non_inductive_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0839E+00 + f_c_plasma_non_inductive_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.3301E-01 tdmptf__________________________________________________________________ (itvar037)____________________ 1.2429E+01 tdmptf_(final_value/initial_value)______________________________________ (xcm037)______________________ 7.3716E-01 tdmptf_(range_normalised)_______________________________________________ (nitvar037)___________________ 1.8347E-01 diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index c5b61cec1b..aef86a402e 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -128,9 +128,9 @@ bore____________________________________________________________________ (itvar035)____________________ 1.9854E+00 bore_(final_value/initial_value)________________________________________ (xcm035)______________________ 9.9271E-01 bore_(range_normalised)_________________________________________________ (nitvar035)___________________ 1.9045E-01 - fvsbrnni________________________________________________________________ (itvar036)____________________ 4.3358E-01 - fvsbrnni_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0839E+00 - fvsbrnni_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.3301E-01 + f_c_plasma_non_inductive________________________________________________________________ (itvar036)____________________ 4.3358E-01 + f_c_plasma_non_inductive_(final_value/initial_value)____________________________________ (xcm036)______________________ 1.0839E+00 + f_c_plasma_non_inductive_(range_normalised)_____________________________________________ (nitvar036)___________________ 4.3301E-01 tdmptf__________________________________________________________________ (itvar037)____________________ 1.8429E+01 tdmptf_(final_value/initial_value)______________________________________ (xcm037)______________________ 7.3716E-01 tdmptf_(range_normalised)_______________________________________________ (nitvar037)___________________ 1.8347E-01 diff --git a/examples/data/large_tokamak_once_through_IN.DAT b/examples/data/large_tokamak_once_through_IN.DAT index 48235fad95..2e5b0f5782 100644 --- a/examples/data/large_tokamak_once_through_IN.DAT +++ b/examples/data/large_tokamak_once_through_IN.DAT @@ -58,7 +58,7 @@ ixc = 29 * bore boundl(29) = 0.1 ixc = 37 * coheof ixc = 41 * fcohbop -ixc = 44 * fvsbrnni +ixc = 44 * f_c_plasma_non_inductive ixc = 56 * tdmptf ixc = 57 * dr_tf_nose_case ixc = 58 * thwcndut @@ -321,7 +321,7 @@ dene = 7.796223900029837e+19 * electron density (/m3) (`iteration variable 6 beta_norm_max = 3.0 * Troyon-like coefficient for beta scaling calculated fgwsep = 0.5 * fraction of Greenwald density to set as separatrix density; If `<0`; separatrix fkzohm = 1.02 * Zohm elongation scaling adjustment factor (`ishape=2; 3`) -fvsbrnni = 0.4242184436680697 * fraction of the plasma current produced by non-inductive means (`iteration variable 44`) +f_c_plasma_non_inductive = 0.4242184436680697 * fraction of the plasma current produced by non-inductive means (`iteration variable 44`) ejima_coeff = 0.3 * Ejima coefficient for resistive startup V-s formula hfact = 1.185971818905028 * H factor on energy confinement times; radiation corrected (`iteration variable 10`); i_bootstrap_current = 4 * switch for bootstrap current scaling diff --git a/process/current_drive.py b/process/current_drive.py index e00deff16f..302c071b3c 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -35,9 +35,11 @@ def iternb(self): """ # Check argument sanity if (1 + physics_variables.eps) < current_drive_variables.frbeam: - eh.fdiags[0] = physics_variables.eps - eh.fdiags[1] = current_drive_variables.frbeam - eh.report_error(15) + raise ProcessValueError( + "Imminent negative square root argument; NBI will miss plasma completely", + eps=physics_variables.eps, + frbeam=current_drive_variables.frbeam, + ) # Calculate beam path length to centre dpath = physics_variables.rmajor * np.sqrt( @@ -110,9 +112,11 @@ def culnbi(self): AEA FUS 172: Physics Assessment for the European Reactor Study """ if (1.0e0 + physics_variables.eps) < current_drive_variables.frbeam: - eh.fdiags[0] = physics_variables.eps - eh.fdiags[1] = current_drive_variables.frbeam - eh.report_error(20) + raise ProcessValueError( + "Imminent negative square root argument; NBI will miss plasma completely", + eps=physics_variables.eps, + frbeam=current_drive_variables.frbeam, + ) # Calculate beam path length to centre @@ -274,9 +278,11 @@ def etanb2( eps1 = rminor / r if (1.0 + eps1) < frbeam: - eh.fdiags[0] = eps1 - eh.fdiags[1] = frbeam - eh.report_error(21) + raise ProcessValueError( + "Imminent negative square root argument; NBI will miss plasma completely", + eps=eps1, + frbeam=frbeam, + ) d = rmajor * np.sqrt((1.0 + eps1) ** 2 - frbeam**2) @@ -646,7 +652,7 @@ def eccdef(self, tlocal, epsloc, zlocal, cosang, coulog): ) if ecgam < 0.0e0: - eh.report_error(17) + raise ProcessValueError("Negative normalised current drive efficiency") return ecgam def electron_cyclotron_fenstermacher( @@ -944,9 +950,11 @@ def cullhy(self): term04 = 3.5e0 * epslh**0.77e0 + x if term03 > term04: - eh.fdiags[0] = term03 - eh.fdiags[1] = term04 - eh.report_error(129) + raise ProcessValueError( + "Normalised LH efficiency < 0; use a different value of i_hcd_primary", + term03=term03, + term04=term04, + ) gamlh = term01 * term02 * (1.0e0 - term03 / term04) @@ -1290,12 +1298,20 @@ def cudriv(self, output: bool): current_drive_variables.eta_cd_hcd_secondary = hcd_models[ current_drive_variables.i_hcd_secondary.item() ]() + elif current_drive_variables.i_hcd_secondary != 0: + raise ProcessValueError( + f"Current drive switch is invalid: {current_drive_variables.i_hcd_secondary = }" + ) # Calculate eta_cd_hcd_primary based on the selected model if current_drive_variables.i_hcd_primary.item() in hcd_models: current_drive_variables.eta_cd_hcd_primary = hcd_models[ current_drive_variables.i_hcd_primary.item() ]() + else: + raise ProcessValueError( + f"Current drive switch is invalid: {current_drive_variables.i_hcd_primary = }" + ) # # Calculate the normalised current drive efficieny for the primary heating method current_drive_variables.eta_cd_norm_hcd_primary = ( @@ -2452,5 +2468,75 @@ def legend(self, zlocal, arg): palpha = palpha + pterm palphap = palphap - n * pterm / (1.0e0 - arg2) else: - eh.report_error(19) - return None + raise ProcessError("legend: Solution has not converged") + + +def init_current_drive_variables(): + """Initialise current drive variables""" + current_drive_variables.beamwd = 0.58 + current_drive_variables.bigq = 0.0 + current_drive_variables.f_c_plasma_bootstrap = 0.0 + current_drive_variables.f_c_plasma_bootstrap_max = 0.9 + current_drive_variables.f_c_plasma_bootstrap_iter89 = 0.0 + current_drive_variables.f_c_plasma_bootstrap_nevins = 0.0 + current_drive_variables.f_c_plasma_bootstrap_sauter = 0.0 + current_drive_variables.f_c_plasma_bootstrap_wilson = 0.0 + current_drive_variables.f_c_plasma_bootstrap_sakai = 0.0 + current_drive_variables.f_c_plasma_bootstrap_aries = 0.0 + current_drive_variables.f_c_plasma_bootstrap_andrade = 0.0 + current_drive_variables.f_c_plasma_bootstrap_hoang = 0.0 + current_drive_variables.f_c_plasma_bootstrap_wong = 0.0 + current_drive_variables.bscf_gi_i = 0.0 + current_drive_variables.bscf_gi_ii = 0.0 + current_drive_variables.cboot = 1.0 + current_drive_variables.c_beam_total = 0.0 + current_drive_variables.f_c_plasma_diamagnetic_hender = 0.0 + current_drive_variables.f_c_plasma_diamagnetic_scene = 0.0 + current_drive_variables.f_c_plasma_diamagnetic = 0.0 + current_drive_variables.p_ecrh_injected_mw = 0.0 + current_drive_variables.echwpow = 0.0 + current_drive_variables.eta_cd_hcd_primary = 0.0 + current_drive_variables.n_ecrh_harmonic = 2.0 + current_drive_variables.i_ecrh_wave_mode = 0 + current_drive_variables.e_beam_kev = 1.0e3 + current_drive_variables.eta_hcd_primary_injector_wall_plug = 0.0 + current_drive_variables.eta_hcd_secondary_injector_wall_plug = 0.0 + current_drive_variables.eta_ecrh_injector_wall_plug = 0.3 + current_drive_variables.eta_lowhyb_injector_wall_plug = 0.3 + current_drive_variables.eta_beam_injector_wall_plug = 0.3 + current_drive_variables.f_p_beam_injected_ions = 0.5 + current_drive_variables.p_beam_injected_mw = 0.0 + current_drive_variables.f_c_plasma_pfirsch_schluter_scene = 0.0 + current_drive_variables.p_beam_shine_through_mw = 0.0 + current_drive_variables.feffcd = 1.0 + current_drive_variables.f_p_beam_orbit_loss = 0.0 + current_drive_variables.frbeam = 1.05 + current_drive_variables.f_beam_tritium = 1e-6 + current_drive_variables.eta_cd_norm_hcd_primary = 0.0 + current_drive_variables.eta_cd_norm_ecrh = 0.35 + current_drive_variables.xi_ebw = 0.8 + current_drive_variables.i_hcd_primary = 5 + current_drive_variables.i_hcd_secondary = 0 + current_drive_variables.i_hcd_calculations = 1 + current_drive_variables.f_p_beam_shine_through = 0.0 + current_drive_variables.dx_beam_shield = 0.5 + current_drive_variables.p_hcd_primary_extra_heat_mw = 0.0 + current_drive_variables.p_hcd_secondary_extra_heat_mw = 0.0 + current_drive_variables.p_hcd_injected_max = 150.0 + current_drive_variables.p_hcd_injected_electrons_mw = 0.0 + current_drive_variables.p_hcd_injected_ions_mw = 0.0 + current_drive_variables.p_hcd_injected_total_mw = 0.0 + current_drive_variables.p_hcd_secondary_injected_mw = 0.0 + current_drive_variables.f_c_plasma_internal = 0.0 + current_drive_variables.p_hcs_lowhyb_injected_total_mw = 0.0 + current_drive_variables.p_hcd_beam_injected_mw = 0.0 + current_drive_variables.p_beam_orbit_loss_mw = 0.0 + current_drive_variables.f_c_plasma_pfirsch_schluter = 0.0 + current_drive_variables.pwplh = 0.0 + current_drive_variables.pwpnb = 0.0 + current_drive_variables.rtanbeam = 0.0 + current_drive_variables.rtanmax = 0.0 + current_drive_variables.n_beam_decay_lengths_core = 0.0 + current_drive_variables.tbeamin = 3.0 + current_drive_variables.eta_cd_norm_hcd_secondary = 0.0 + current_drive_variables.eta_cd_hcd_secondary = 0.0 diff --git a/process/iteration_variables.py b/process/iteration_variables.py index 1bec00495c..411dd6efda 100644 --- a/process/iteration_variables.py +++ b/process/iteration_variables.py @@ -83,7 +83,9 @@ class IterationVariable: "f_j_cs_start_pulse_end_flat_top", fortran.pfcoil_variables, 0.001, 1.0 ), 42: IterationVariable("dr_cs_tf_gap", fortran.build_variables, 0.001, 10.00), - 44: IterationVariable("fvsbrnni", fortran.physics_variables, 0.001, 1.0), + 44: IterationVariable( + "f_c_plasma_non_inductive", fortran.physics_variables, 0.001, 1.0 + ), 45: IterationVariable("fqval", fortran.constraint_variables, 0.001, 1.0), 46: IterationVariable("fpinj", fortran.constraint_variables, 0.001, 1.0), 47: IterationVariable("feffcd", fortran.current_drive_variables, 0.001, 1.0), diff --git a/process/physics.py b/process/physics.py index 768c2307c6..a3ecb0d3d1 100644 --- a/process/physics.py +++ b/process/physics.py @@ -8063,8 +8063,8 @@ def init_physics_variables(): physics_variables.nd_impurities = 0.0 physics_variables.beta_poloidal_eps_max = 1.38 physics_variables.eps = 0.34399724802 - physics_variables.aux_current_fraction = 0.0 - physics_variables.inductive_current_fraction = 0.0 + physics_variables.f_c_plasma_auxiliary = 0.0 + physics_variables.f_c_plasma_inductive = 0.0 physics_variables.f_alpha_electron = 0.0 physics_variables.f_alpha_plasma = 0.95 physics_variables.f_alpha_ion = 0.0 @@ -8082,7 +8082,7 @@ def init_physics_variables(): physics_variables.f_tritium = 0.5 physics_variables.fusion_rate_density_total = 0.0 physics_variables.fusion_rate_density_plasma = 0.0 - physics_variables.fvsbrnni = 1.0 + physics_variables.f_c_plasma_non_inductive = 1.0 physics_variables.ejima_coeff = 0.4 physics_variables.f_beta_alpha_beam_thermal = 0.0 physics_variables.hfac[:] = 0.0 diff --git a/process/power.py b/process/power.py index 0f77888a3b..8a9e6f2e87 100644 --- a/process/power.py +++ b/process/power.py @@ -3105,8 +3105,8 @@ def init_heat_transport_variables(): heat_transport_variables.pgrossmw = 0.0 heat_transport_variables.pinjht = 0.0 heat_transport_variables.pinjmax = 120.0 - heat_transport_variables.pinjwp = 0.0 - heat_transport_variables.pinjwpfix = 0.0 + heat_transport_variables.p_hcd_electric_total_mw = 0.0 + heat_transport_variables.p_hcd_secondary_electric_mw = 0.0 heat_transport_variables.pnetelmw = 0.0 heat_transport_variables.precircmw = 0.0 heat_transport_variables.priheat = 0.0 From b694092871a9f19759e28ee1a15405323ac463d6 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Apr 2025 14:56:41 +0100 Subject: [PATCH 35/41] =?UTF-8?q?=F0=9F=94=84=20Move=20legend=20function?= =?UTF-8?q?=20from=20CurrentDrive=20to=20ElectronCyclotron=20for=20better?= =?UTF-8?q?=20organization=20and=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/current_drive.py | 122 +++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index 302c071b3c..f5c36a52ce 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -769,6 +769,67 @@ def electron_cyclotron_freethy( # Final ECCD efficiency return eta_cd * cutoff_factor + def legend(self, zlocal, arg): + """Routine to calculate Legendre function and its derivative + author: M R O'Brien, CCFE, Culham Science Centre + author: P J Knight, CCFE, Culham Science Centre + zlocal : input real : local plasma effective charge + arg : input real : argument of Legendre function + palpha : output real : value of Legendre function + palphap : output real : derivative of Legendre function + This routine calculates the Legendre function palpha + of argument arg and order + alpha = -0.5 + i sqrt(xisq), + and its derivative palphap. +

    This Legendre function is a conical function and we use the series + in xisq given in Abramowitz and Stegun. The + derivative is calculated from the derivative of this series. +

    The derivatives were checked by calculating palpha for + neighbouring arguments. The calculation of palpha for zero + argument was checked by comparison with the expression + palpha(0) = 1/sqrt(pi) * cos(pi*alpha/2) * gam1 / gam2 + (Abramowitz and Stegun, eqn 8.6.1). Here gam1 and + gam2 are the Gamma functions of arguments + 0.5*(1+alpha) and 0.5*(2+alpha) respectively. + Abramowitz and Stegun, equation 8.12.1 + """ + if abs(arg) > (1.0e0 + 1.0e-10): + eh.fdiags[0] = arg + raise ProcessValueError("Invalid argument", arg=arg) + + arg2 = min(arg, (1.0e0 - 1.0e-10)) + sinsq = 0.5e0 * (1.0e0 - arg2) + xisq = 0.25e0 * (32.0e0 * zlocal / (zlocal + 1.0e0) - 1.0e0) + palpha = 1.0e0 + pold = 1.0e0 + pterm = 1.0e0 + palphap = 0.0e0 + poldp = 0.0e0 + + for n in range(10000): + # Check for convergence every 20 iterations + + if (n > 1) and ((n % 20) == 1): + term1 = 1.0e-10 * max(abs(pold), abs(palpha)) + term2 = 1.0e-10 * max(abs(poldp), abs(palphap)) + + if (abs(pold - palpha) < term1) and (abs(poldp - palphap) < term2): + return palpha, palphap + + pold = palpha + poldp = palphap + + pterm = ( + pterm + * (4.0e0 * xisq + (2.0e0 * n - 1.0e0) ** 2) + / (2.0e0 * n) ** 2 + * sinsq + ) + palpha = palpha + pterm + palphap = palphap - n * pterm / (1.0e0 - arg2) + else: + raise ProcessError("legend: Solution has not converged") + class IonCyclotron: def __init__(self, plasma_profile: PlasmaProfile): @@ -2409,67 +2470,6 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) - def legend(self, zlocal, arg): - """Routine to calculate Legendre function and its derivative - author: M R O'Brien, CCFE, Culham Science Centre - author: P J Knight, CCFE, Culham Science Centre - zlocal : input real : local plasma effective charge - arg : input real : argument of Legendre function - palpha : output real : value of Legendre function - palphap : output real : derivative of Legendre function - This routine calculates the Legendre function palpha - of argument arg and order - alpha = -0.5 + i sqrt(xisq), - and its derivative palphap. -

    This Legendre function is a conical function and we use the series - in xisq given in Abramowitz and Stegun. The - derivative is calculated from the derivative of this series. -

    The derivatives were checked by calculating palpha for - neighbouring arguments. The calculation of palpha for zero - argument was checked by comparison with the expression - palpha(0) = 1/sqrt(pi) * cos(pi*alpha/2) * gam1 / gam2 - (Abramowitz and Stegun, eqn 8.6.1). Here gam1 and - gam2 are the Gamma functions of arguments - 0.5*(1+alpha) and 0.5*(2+alpha) respectively. - Abramowitz and Stegun, equation 8.12.1 - """ - if abs(arg) > (1.0e0 + 1.0e-10): - eh.fdiags[0] = arg - raise ProcessValueError("Invalid argument", arg=arg) - - arg2 = min(arg, (1.0e0 - 1.0e-10)) - sinsq = 0.5e0 * (1.0e0 - arg2) - xisq = 0.25e0 * (32.0e0 * zlocal / (zlocal + 1.0e0) - 1.0e0) - palpha = 1.0e0 - pold = 1.0e0 - pterm = 1.0e0 - palphap = 0.0e0 - poldp = 0.0e0 - - for n in range(10000): - # Check for convergence every 20 iterations - - if (n > 1) and ((n % 20) == 1): - term1 = 1.0e-10 * max(abs(pold), abs(palpha)) - term2 = 1.0e-10 * max(abs(poldp), abs(palphap)) - - if (abs(pold - palpha) < term1) and (abs(poldp - palphap) < term2): - return palpha, palphap - - pold = palpha - poldp = palphap - - pterm = ( - pterm - * (4.0e0 * xisq + (2.0e0 * n - 1.0e0) ** 2) - / (2.0e0 * n) ** 2 - * sinsq - ) - palpha = palpha + pterm - palphap = palphap - n * pterm / (1.0e0 - arg2) - else: - raise ProcessError("legend: Solution has not converged") - def init_current_drive_variables(): """Initialise current drive variables""" From 5f0304e7ad172f0cba1ead9cc8263e3dd6c63d2c Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Apr 2025 15:37:40 +0100 Subject: [PATCH 36/41] =?UTF-8?q?=F0=9F=94=84=20Add=20initial=20data=20fil?= =?UTF-8?q?es=20and=20documentation=20for=20heating=20and=20current=20driv?= =?UTF-8?q?e=20systems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NBI/nbi_overview.md | 2 +- .../RF/ebw_overview.md | 2 +- .../RF/ec_overview.md | 2 +- .../RF/ic_overview.md | 2 +- .../RF/lhcd_overview.md | 3 +- .../heating-and-current-drive.md | 2 +- process/current_drive.py | 71 +++---------------- 7 files changed, 17 insertions(+), 67 deletions(-) diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/NBI/nbi_overview.md b/documentation/proc-pages/eng-models/heating_and_current_drive/NBI/nbi_overview.md index 992f32b917..d9524b9c2d 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/NBI/nbi_overview.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/NBI/nbi_overview.md @@ -1,4 +1,4 @@ -# Neutral Beam Injection Heating +# Neutral Beam Injection Heating | `NeutralBeam` !!! Warning "NBI Models" At present, the neutral beam models do not include the effect of an edge transport barrier (pedestal) in the plasma profile. diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ebw_overview.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ebw_overview.md index f6e9fb57ce..491f7cedc2 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ebw_overview.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ebw_overview.md @@ -1,4 +1,4 @@ -# Electron Bernstein Wave Heating +# Electron Bernstein Wave Heating | `ElectronBernstein` Crawford et al. initially demonstrated the experimental verification of Electron Bernstein Waves (EBWs) in 1964. Subsequent experiments focused on measuring the transmission and emission of EBWs in linear low-temperature plasma devices, with Crawford providing an overview of these foundational experiments. Among these, two notable examples stand out. diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ec_overview.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ec_overview.md index 0dee08f3f7..86a22bf4a2 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ec_overview.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ec_overview.md @@ -1,4 +1,4 @@ -# Electron Cyclotron Heating +# Electron Cyclotron Heating | `ElectronCyclotron` Electron cyclotron resonance heating is the simplest of the radio frequency heating methods. In contrast to ion cyclotron and lower hybrid heating, there is no evanescent region between the antenna and the plasma,although cut-offs can exist within the plasma. As a result, the antenna can be retracted into a less hostile environment than for the other schemes. Electron cyclotron heating has been made possible by the invention of the gyrotron millimetre wave source. This and related devices have only emerged since the mid-1970s. Gyrotron tubes capable of 0.5-1 MW out- put and with frequencies in the range 100-200 GHz are now under intense development. The frequency required for a reactor would be in the range 100-200 GHz which corresponds to vacuum wavelengths of 1-2 mm. diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_overview.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_overview.md index 2d31283e66..09f12bcf71 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_overview.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_overview.md @@ -1,4 +1,4 @@ -# Ion Cyclotron Heating +# Ion Cyclotron Heating | ``IonCyclotron` Ion cyclotron heating (ICH) is a technique used in fusion tokamaks to heat ions in a plasma by applying radio frequency (RF) waves. The RF waves used in ICH are typically in the range of tens to hundreds of megahertz. diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/lhcd_overview.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/lhcd_overview.md index 84d8cd1a57..098de4ba7b 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/lhcd_overview.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/lhcd_overview.md @@ -1,4 +1,5 @@ -# Lower Hybrid Current Drive +# Lower Hybrid Current Drive | `LowerHybrid` + Lower hybrid heating is generated through the propagation of a lower hybrid wave within a plasma, characterized by a frequency lying between the ion and electron cyclotron frequencies. This wave possesses an electric field component parallel to the magnetic field, enabling the acceleration of electrons traveling along the field lines. Lower hybrid resonance heating employs electromagnetic power within the 1-8 GHz frequency range. At 3 GHz, the vacuum wavelength measures 0.1 meters, facilitating the transmission and launching of energy via waveguides operating in their fundamental mode. This feature stands out as a primary advantage of this method. diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/heating-and-current-drive.md b/documentation/proc-pages/eng-models/heating_and_current_drive/heating-and-current-drive.md index 09203b2bb3..08f732084a 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/heating-and-current-drive.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/heating-and-current-drive.md @@ -1,4 +1,4 @@ -# Auxiliary Heating & Current Drive Systems +# Auxiliary Heating & Current Drive Systems | `CurrentDrive` ## Current Drive diff --git a/process/current_drive.py b/process/current_drive.py index f5c36a52ce..bbcc57f107 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -6,7 +6,6 @@ from process.exceptions import ProcessError, ProcessValueError from process.fortran import ( constants, - cost_variables, current_drive_variables, heat_transport_variables, physics_variables, @@ -1264,16 +1263,6 @@ def cudriv(self, output: bool): if current_drive_variables.i_hcd_secondary == 0: current_drive_variables.p_hcd_secondary_extra_heat_mw = 0.0 - # check for unphysically large heating in - # secondary injected power source - if ( - current_drive_variables.p_hcd_secondary_extra_heat_mw - > current_drive_variables.p_hcd_secondary_injected_mw - ): - current_drive_variables.p_hcd_secondary_extra_heat_mw = ( - current_drive_variables.p_hcd_secondary_injected_mw - ) - # current_drive_variables.i_hcd_calculations | switch for current drive calculation # = 0 | turned off # = 1 | turned on @@ -1406,7 +1395,6 @@ def cudriv(self, output: bool): ) * physics_variables.plasma_current / current_drive_variables.eta_cd_norm_hcd_primary - + current_drive_variables.p_hcd_primary_extra_heat_mw ) # Calculate the driven current for the primary heating method @@ -1589,6 +1577,7 @@ def cudriv(self, output: bool): # Wall plug power heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw / current_drive_variables.eta_lowhyb_injector_wall_plug ) @@ -1814,6 +1803,15 @@ def cudriv(self, output: bool): ) po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "Fusion gain factor Q", + "(bigq)", + current_drive_variables.bigq, + "OP ", + ) + po.oblnkl(self.outfile) + if current_drive_variables.i_hcd_calculations == 0: po.ocmmnt(self.outfile, "No current drive used") po.oblnkl(self.outfile) @@ -2050,7 +2048,6 @@ def cudriv(self, output: bool): "OP ", ) - po.oblnkl(self.outfile) po.ocmmnt(self.outfile, "----------------------------") po.oblnkl(self.outfile) po.ovarin( @@ -2289,8 +2286,6 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) - po.oblnkl(self.outfile) - po.osubhd(self.outfile, "Contributions:") po.ovarre( @@ -2317,19 +2312,6 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) - po.ovarre( - self.outfile, - "Ratio of power for flat-top to start-up (MW)", - "(startupratio)", - cost_variables.startupratio, - ) - po.ovarre( - self.outfile, - "Auxiliary power used for plasma heating only (MW)", - "(p_hcd_primary_extra_heat_mw)", - current_drive_variables.p_hcd_primary_extra_heat_mw - + current_drive_variables.p_hcd_secondary_extra_heat_mw, - ) po.ovarre( self.outfile, "Power injected for current drive (MW)", @@ -2338,20 +2320,6 @@ def cudriv(self, output: bool): - current_drive_variables.p_hcd_primary_extra_heat_mw - current_drive_variables.p_hcd_secondary_extra_heat_mw, ) - po.ovarre( - self.outfile, - "Maximum Allowed Bootstrap current fraction", - "(f_c_plasma_bootstrap_max)", - current_drive_variables.f_c_plasma_bootstrap_max, - ) - - po.ovarre( - self.outfile, - "Fusion gain factor Q", - "(bigq)", - current_drive_variables.bigq, - "OP ", - ) if current_drive_variables.i_hcd_primary == 12: po.ovarre( @@ -2397,25 +2365,6 @@ def cudriv(self, output: bool): physics_variables.f_c_plasma_inductive, "OP ", ) - # Add total error check. - po.ovarrf( - self.outfile, - "Total", - "(f_c_plasma_internal+f_c_plasma_auxiliary+f_c_plasma_inductive)", - current_drive_variables.f_c_plasma_internal - + physics_variables.f_c_plasma_auxiliary - + physics_variables.f_c_plasma_inductive, - ) - if ( - abs( - current_drive_variables.f_c_plasma_internal - + physics_variables.f_c_plasma_auxiliary - + physics_variables.f_c_plasma_inductive - - 1.0e0 - ) - > 1.0e-8 - ): - po.ocmmnt(self.outfile, "ERROR: current drive fractions do not add to 1") # MDK Add physics_variables.f_c_plasma_non_inductive as it can be an iteration variable po.ovarrf( From f80c0f61c617ab3b6dddb6cc011e75604ae548a4 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Apr 2025 15:42:24 +0100 Subject: [PATCH 37/41] =?UTF-8?q?=F0=9F=94=84=20Add=20p=5Fhcd=5Finjected?= =?UTF-8?q?=5Fcurrent=5Ftotal=5Fmw=20as=20a=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/csv_output_large_tokamak_MFILE.DAT | 2 +- examples/data/large_tokamak_1_MFILE.DAT | 2 +- examples/data/large_tokamak_2_MFILE.DAT | 2 +- examples/data/large_tokamak_3_MFILE.DAT | 2 +- examples/data/large_tokamak_4_MFILE.DAT | 2 +- examples/data/scan_MFILE.DAT | 18 +- process/costs.py | 2 +- process/current_drive.py | 180 +++++++++--------- process/stellarator.py | 4 +- source/fortran/current_drive_variables.f90 | 5 +- .../data/large_tokamak_1_MFILE.DAT | 2 +- .../data/large_tokamak_2_MFILE.DAT | 2 +- .../data/large_tokamak_3_MFILE.DAT | 2 +- .../data/large_tokamak_4_MFILE.DAT | 2 +- .../integration/data/large_tokamak_MFILE.DAT | 2 +- tests/integration/data/scan_2D_MFILE.DAT | 30 +-- tests/integration/data/scan_MFILE.DAT | 18 +- tests/unit/data/large_tokamak_MFILE.DAT | 2 +- tests/unit/test_costs_1990.py | 10 +- tests/unit/test_current_drive.py | 20 +- 20 files changed, 155 insertions(+), 154 deletions(-) diff --git a/examples/data/csv_output_large_tokamak_MFILE.DAT b/examples/data/csv_output_large_tokamak_MFILE.DAT index 023c25e24c..82ed4e7d65 100644 --- a/examples/data/csv_output_large_tokamak_MFILE.DAT +++ b/examples/data/csv_output_large_tokamak_MFILE.DAT @@ -549,7 +549,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8505E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1495E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5213E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5213E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5043E+02 OP diff --git a/examples/data/large_tokamak_1_MFILE.DAT b/examples/data/large_tokamak_1_MFILE.DAT index 4220d0042f..820cd132c3 100644 --- a/examples/data/large_tokamak_1_MFILE.DAT +++ b/examples/data/large_tokamak_1_MFILE.DAT @@ -547,7 +547,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP diff --git a/examples/data/large_tokamak_2_MFILE.DAT b/examples/data/large_tokamak_2_MFILE.DAT index ffa1f55a8e..17c6b98a33 100644 --- a/examples/data/large_tokamak_2_MFILE.DAT +++ b/examples/data/large_tokamak_2_MFILE.DAT @@ -547,7 +547,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP diff --git a/examples/data/large_tokamak_3_MFILE.DAT b/examples/data/large_tokamak_3_MFILE.DAT index 19a82de289..7f9443783c 100644 --- a/examples/data/large_tokamak_3_MFILE.DAT +++ b/examples/data/large_tokamak_3_MFILE.DAT @@ -547,7 +547,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP diff --git a/examples/data/large_tokamak_4_MFILE.DAT b/examples/data/large_tokamak_4_MFILE.DAT index aef86a402e..5f3c9f43df 100644 --- a/examples/data/large_tokamak_4_MFILE.DAT +++ b/examples/data/large_tokamak_4_MFILE.DAT @@ -547,7 +547,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP diff --git a/examples/data/scan_MFILE.DAT b/examples/data/scan_MFILE.DAT index a5e0d15db4..6e648b3317 100644 --- a/examples/data/scan_MFILE.DAT +++ b/examples/data/scan_MFILE.DAT @@ -402,7 +402,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -1397,7 +1397,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -2392,7 +2392,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -3387,7 +3387,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -4382,7 +4382,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -5377,7 +5377,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -6372,7 +6372,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -7367,7 +7367,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -8362,7 +8362,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP diff --git a/process/costs.py b/process/costs.py index 5b02965561..cd2edb00e8 100644 --- a/process/costs.py +++ b/process/costs.py @@ -1807,7 +1807,7 @@ def acc223(self): self.c2231 = ( 1.0e-6 * cost_variables.ucech - * (1.0e6 * current_drive_variables.p_ecrh_injected_mw) ** exprf + * (1.0e6 * current_drive_variables.p_hcd_ecrh_injected_total_mw) ** exprf ) if cost_variables.ifueltyp == 1: diff --git a/process/current_drive.py b/process/current_drive.py index bbcc57f107..05e069a98a 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1231,17 +1231,20 @@ def __init__( self.neutral_beam = neutral_beam self.electron_bernstein = electron_bernstein - def cudriv(self, output: bool): - """Routine to calculate the current drive power requirements - author: P J Knight, CCFE, Culham Science Centre - outfile : input integer : output file unit - iprint : input integer : switch for writing to output file (1=yes) - This routine calculates the power requirements of the current - drive system, using a choice of models for the current drive - efficiency. + def cudriv(self, output: bool) -> None: + """ + Calculate the current drive power requirements. + + This method computes the power requirements of the current drive system + using a choice of models for the current drive efficiency. + + :param output: Flag indicating whether to write results to the output file. + :type output: bool + + :raises ProcessValueError: If an invalid current drive switch is encountered. """ - current_drive_variables.p_ecrh_injected_mw = 0.0e0 + current_drive_variables.p_hcd_ecrh_injected_total_mw = 0.0e0 current_drive_variables.p_hcd_beam_injected_total_mw = 0.0e0 current_drive_variables.p_hcd_lowhyb_injected_total_mw = 0.0e0 current_drive_variables.p_hcd_icrh_injected_total_mw = 0.0e0 @@ -1249,10 +1252,8 @@ def cudriv(self, output: bool): current_drive_variables.c_beam_total = 0.0e0 beam_current_fix = 0.0e0 current_drive_variables.p_beam_orbit_loss_mw = 0.0e0 - porbitlossmwfix = 0.0e0 pinjmw1 = 0.0 - pinjmwfix = 0.0 p_hcd_primary_ions_mw = 0.0 p_hcd_primary_electrons_mw = 0.0 p_hcd_secondary_electrons_mw = 0.0 @@ -1263,11 +1264,12 @@ def cudriv(self, output: bool): if current_drive_variables.i_hcd_secondary == 0: current_drive_variables.p_hcd_secondary_extra_heat_mw = 0.0 - # current_drive_variables.i_hcd_calculations | switch for current drive calculation + # i_hcd_calculations | switch for current drive calculation # = 0 | turned off # = 1 | turned on + if current_drive_variables.i_hcd_calculations != 0: - # put electron density in desired units (10^-20 m-3) + # Put electron density in desired units (10^-20 m-3) dene20 = physics_variables.dene * 1.0e-20 # Calculate current drive efficiencies @@ -1363,7 +1365,7 @@ def cudriv(self, output: bool): f"Current drive switch is invalid: {current_drive_variables.i_hcd_primary = }" ) - # # Calculate the normalised current drive efficieny for the primary heating method + # Calculate the normalised current drive efficieny for the primary heating method current_drive_variables.eta_cd_norm_hcd_primary = ( current_drive_variables.eta_cd_hcd_primary * (dene20 * physics_variables.rmajor) @@ -1419,6 +1421,7 @@ def cudriv(self, output: bool): # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw / current_drive_variables.eta_lowhyb_injector_wall_plug ) @@ -1443,6 +1446,7 @@ def cudriv(self, output: bool): # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw / current_drive_variables.eta_icrh_injector_wall_plug ) @@ -1464,13 +1468,14 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_secondary_injected_mw ) - current_drive_variables.p_ecrh_injected_mw += ( + current_drive_variables.p_hcd_ecrh_injected_total_mw += ( current_drive_variables.p_hcd_secondary_injected_mw ) # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw / current_drive_variables.eta_ecrh_injector_wall_plug ) @@ -1491,6 +1496,7 @@ def cudriv(self, output: bool): # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw / current_drive_variables.eta_ebw_injector_wall_plug ) @@ -1626,7 +1632,7 @@ def cudriv(self, output: bool): # Electron cyclotron cases if current_drive_variables.i_hcd_primary in [3, 7, 10, 13]: - current_drive_variables.p_ecrh_injected_mw += ( + current_drive_variables.p_hcd_ecrh_injected_total_mw += ( current_drive_variables.p_hcd_primary_injected_mw ) @@ -1636,13 +1642,14 @@ def cudriv(self, output: bool): # Wall plug power current_drive_variables.p_hcd_ecrh_electric_mw = ( - current_drive_variables.p_ecrh_injected_mw + current_drive_variables.p_hcd_ecrh_injected_total_mw / current_drive_variables.eta_ecrh_injector_wall_plug ) # Wall plug to injector efficiency heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw / current_drive_variables.eta_ecrh_injector_wall_plug ) @@ -1669,6 +1676,7 @@ def cudriv(self, output: bool): # Wall plug to injector efficiency heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw / current_drive_variables.eta_ebw_injector_wall_plug ) @@ -1736,17 +1744,21 @@ def cudriv(self, output: bool): # =========================================================== - # Total injected power - # sum contributions from primary and secondary systems + # Total injected power that contributed to heating current_drive_variables.p_hcd_injected_total_mw = ( - p_hcd_primary_electrons_mw - + p_hcd_primary_ions_mw - + p_hcd_secondary_electrons_mw - + p_hcd_secondary_ions_mw + current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw + + current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw + ) + + # Total injected power that contributed to current drive + current_drive_variables.p_hcd_injected_current_total_mw = ( + current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_secondary_injected_mw ) pinjmw1 = p_hcd_primary_electrons_mw + p_hcd_primary_ions_mw - pinjmwfix = p_hcd_secondary_electrons_mw + p_hcd_secondary_ions_mw # Total injected power given to electrons current_drive_variables.p_hcd_injected_electrons_mw = ( @@ -1889,6 +1901,13 @@ def cudriv(self, output: bool): current_drive_variables.c_hcd_primary_driven, "OP ", ) + po.ovarre( + self.outfile, + "Fraction of plasma current driven by primary system", + "(f_c_plasma_hcd_primary)", + current_drive_variables.f_c_plasma_hcd_primary, + "OP ", + ) po.ovarre( self.outfile, "Wall plug to injector efficiency of primary system", @@ -1993,13 +2012,6 @@ def cudriv(self, output: bool): current_drive_variables.p_beam_shine_through_mw, "OP ", ) - po.ovarrf( - self.outfile, - "Beam power deposited in plasma (MW)", - "(p_hcd_injected_total_mw)", - pinjmw1, - "OP ", - ) po.ovarrf( self.outfile, "Maximum allowable beam power (MW)", @@ -2122,6 +2134,13 @@ def cudriv(self, output: bool): current_drive_variables.c_hcd_secondary_driven, "OP ", ) + po.ovarre( + self.outfile, + "Fraction of plasma current driven by secondary system", + "(f_c_plasma_hcd_secondary)", + current_drive_variables.f_c_plasma_hcd_secondary, + "OP ", + ) po.ovarre( self.outfile, "Wall plug to injector efficiency of secondary system", @@ -2210,13 +2229,6 @@ def cudriv(self, output: bool): current_drive_variables.p_beam_shine_through_mw, "OP ", ) - po.ovarrf( - self.outfile, - "Beam power deposited in plasma (MW)", - "(p_hcd_injected_total_mw)", - pinjmw1, - "OP ", - ) po.ovarrf( self.outfile, "Maximum allowable beam power (MW)", @@ -2269,6 +2281,12 @@ def cudriv(self, output: bool): po.osubhd(self.outfile, "Totals :") + po.ovarre( + self.outfile, + "Total injected heating power that drove plasma current (MW)", + "(p_hcd_injected_current_total_mw)", + current_drive_variables.p_hcd_injected_current_total_mw, + ) po.ovarre( self.outfile, "Total injected heating power across all systems (MW)", @@ -2276,6 +2294,21 @@ def cudriv(self, output: bool): current_drive_variables.p_hcd_injected_total_mw, "OP ", ) + po.ovarre( + self.outfile, + "Total injected heating power given to the electrons (MW)", + "(p_hcd_injected_electrons_mw)", + current_drive_variables.p_hcd_injected_electrons_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Total injected heating power given to the ions (MW)", + "(p_hcd_injected_ions_mw)", + current_drive_variables.p_hcd_injected_ions_mw, + "OP ", + ) + po.ovarre( self.outfile, "Upper limit on total plasma injected power (MW)", @@ -2284,8 +2317,6 @@ def cudriv(self, output: bool): "OP ", ) - po.oblnkl(self.outfile) - po.osubhd(self.outfile, "Contributions:") po.ovarre( @@ -2304,30 +2335,25 @@ def cudriv(self, output: bool): ) po.ovarre( self.outfile, - "Injected power into plasma from lower hybrid systems (MW)", - "(p_hcd_ebw_injected_total_mw)", - current_drive_variables.p_hcd_ebw_injected_total_mw, + "Injected power into plasma from electron cyclotron systems (MW)", + "(p_hcd_ecrh_injected_total_mw)", + current_drive_variables.p_hcd_ecrh_injected_total_mw, "OP ", ) - - po.oblnkl(self.outfile) - po.ovarre( self.outfile, - "Power injected for current drive (MW)", - "(pcurrentdrivemw)", - current_drive_variables.p_hcd_injected_total_mw - - current_drive_variables.p_hcd_primary_extra_heat_mw - - current_drive_variables.p_hcd_secondary_extra_heat_mw, + "Injected power into plasma from neutral beam systems (MW)", + "(p_hcd_beam_injected_total_mw)", + current_drive_variables.p_hcd_beam_injected_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Injected power into plasma from lower hybrid systems (MW)", + "(p_hcd_ebw_injected_total_mw)", + current_drive_variables.p_hcd_ebw_injected_total_mw, + "OP ", ) - - if current_drive_variables.i_hcd_primary == 12: - po.ovarre( - self.outfile, - "EBW plasma heating efficiency", - "(xi_ebw)", - current_drive_variables.xi_ebw, - ) po.osubhd(self.outfile, "Fractions of current drive :") po.ovarrf( @@ -2386,39 +2412,6 @@ def cudriv(self, output: bool): po.oblnkl(self.outfile) - # MDK rearranged and added current_drive_variables.p_beam_shine_through_mw - # if (abs(current_drive_variables.p_hcd_beam_injected_total_mw) > 1.0e-8) : - - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.oblnkl(self.outfile) - po.ocmmnt(self.outfile, "Secondary fixed neutral beam power balance :") - po.ocmmnt(self.outfile, "----------------------------") - po.ovarrf( - self.outfile, - "Secondary fixed beam first orbit loss power (MW)", - "(porbitlossmwfix)", - porbitlossmwfix, - "OP ", - ) - po.ovarrf( - self.outfile, - "Secondary fixed beam power deposited in plasma (MW)", - "(pinjmwfix)", - pinjmwfix, - "OP ", - ) - po.ovarrf( - self.outfile, - "Maximum allowable beam power (MW)", - "(p_hcd_injected_max)", - current_drive_variables.p_hcd_injected_max, - ) - po.oblnkl(self.outfile) - - po.oblnkl(self.outfile) - def init_current_drive_variables(): """Initialise current drive variables""" @@ -2442,7 +2435,7 @@ def init_current_drive_variables(): current_drive_variables.f_c_plasma_diamagnetic_hender = 0.0 current_drive_variables.f_c_plasma_diamagnetic_scene = 0.0 current_drive_variables.f_c_plasma_diamagnetic = 0.0 - current_drive_variables.p_ecrh_injected_mw = 0.0 + current_drive_variables.p_hcd_ecrh_injected_total_mw = 0.0 current_drive_variables.echwpow = 0.0 current_drive_variables.eta_cd_hcd_primary = 0.0 current_drive_variables.n_ecrh_harmonic = 2.0 @@ -2475,6 +2468,7 @@ def init_current_drive_variables(): current_drive_variables.p_hcd_injected_electrons_mw = 0.0 current_drive_variables.p_hcd_injected_ions_mw = 0.0 current_drive_variables.p_hcd_injected_total_mw = 0.0 + current_drive_variables.p_hcd_injected_current_total_mw = 0.0 current_drive_variables.p_hcd_secondary_injected_mw = 0.0 current_drive_variables.f_c_plasma_internal = 0.0 current_drive_variables.p_hcs_lowhyb_injected_total_mw = 0.0 diff --git a/process/stellarator.py b/process/stellarator.py index ff6d085c3a..d675e66655 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -4943,12 +4943,12 @@ def stheat(self, output: bool): AEA FUS 172: Physics Assessment for the European Reactor Study """ if stellarator_variables.isthtr == 1: - current_drive_variables.p_ecrh_injected_mw = ( + current_drive_variables.p_hcd_ecrh_injected_total_mw = ( current_drive_variables.p_hcd_primary_extra_heat_mw ) current_drive_variables.p_hcd_injected_ions_mw = 0 current_drive_variables.p_hcd_injected_electrons_mw = ( - current_drive_variables.p_ecrh_injected_mw + current_drive_variables.p_hcd_ecrh_injected_total_mw ) current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ecrh_injector_wall_plug diff --git a/source/fortran/current_drive_variables.f90 b/source/fortran/current_drive_variables.f90 index 2daf9a4187..8b1f3b5c1a 100644 --- a/source/fortran/current_drive_variables.f90 +++ b/source/fortran/current_drive_variables.f90 @@ -78,7 +78,7 @@ module current_drive_variables real(dp) :: f_c_plasma_diamagnetic !! diamagnetic current fraction - real(dp) :: p_ecrh_injected_mw + real(dp) :: p_hcd_ecrh_injected_total_mw !! ECH power (MW) real(dp) :: p_ebw_injected_mw @@ -241,6 +241,9 @@ module current_drive_variables real(dp) :: p_hcd_injected_total_mw !! total auxiliary injected power (MW) + real(dp) :: p_hcd_injected_current_total_mw + !! total auxiliary injected power (MW) + real(dp) :: p_hcd_secondary_injected_mw !! secondary total fixed auxiliary injected power (MW) diff --git a/tests/integration/data/large_tokamak_1_MFILE.DAT b/tests/integration/data/large_tokamak_1_MFILE.DAT index 9b57a203c3..c8dd336235 100644 --- a/tests/integration/data/large_tokamak_1_MFILE.DAT +++ b/tests/integration/data/large_tokamak_1_MFILE.DAT @@ -546,7 +546,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP diff --git a/tests/integration/data/large_tokamak_2_MFILE.DAT b/tests/integration/data/large_tokamak_2_MFILE.DAT index 06fd5d7553..c74be9144c 100644 --- a/tests/integration/data/large_tokamak_2_MFILE.DAT +++ b/tests/integration/data/large_tokamak_2_MFILE.DAT @@ -547,7 +547,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP diff --git a/tests/integration/data/large_tokamak_3_MFILE.DAT b/tests/integration/data/large_tokamak_3_MFILE.DAT index 86fa63b6a7..2d43936887 100644 --- a/tests/integration/data/large_tokamak_3_MFILE.DAT +++ b/tests/integration/data/large_tokamak_3_MFILE.DAT @@ -547,7 +547,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP diff --git a/tests/integration/data/large_tokamak_4_MFILE.DAT b/tests/integration/data/large_tokamak_4_MFILE.DAT index fd1fcae091..38ec9f98f6 100644 --- a/tests/integration/data/large_tokamak_4_MFILE.DAT +++ b/tests/integration/data/large_tokamak_4_MFILE.DAT @@ -547,7 +547,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6642E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3358E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 8.0143E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 8.0143E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.6029E+02 OP diff --git a/tests/integration/data/large_tokamak_MFILE.DAT b/tests/integration/data/large_tokamak_MFILE.DAT index 4a8d524f48..9207b259e0 100644 --- a/tests/integration/data/large_tokamak_MFILE.DAT +++ b/tests/integration/data/large_tokamak_MFILE.DAT @@ -544,7 +544,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6376E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3624E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5942E+02 OP diff --git a/tests/integration/data/scan_2D_MFILE.DAT b/tests/integration/data/scan_2D_MFILE.DAT index 23c056af5f..c6edd13606 100644 --- a/tests/integration/data/scan_2D_MFILE.DAT +++ b/tests/integration/data/scan_2D_MFILE.DAT @@ -548,7 +548,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.0930E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.9070E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -1711,7 +1711,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9548E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0452E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -2874,7 +2874,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8606E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1394E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5559E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5559E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5112E+02 OP @@ -4037,7 +4037,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.8847E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.1153E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -5200,7 +5200,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9218E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0782E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -6363,7 +6363,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9136E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0864E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -7526,7 +7526,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9320E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0680E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -8689,7 +8689,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9395E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0605E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -9852,7 +9852,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9780E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0220E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -11015,7 +11015,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9910E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0090E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -12178,7 +12178,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9399E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0601E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -13341,7 +13341,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9353E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0647E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -14504,7 +14504,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9505E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0495E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -15667,7 +15667,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9754E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0246E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP @@ -16830,7 +16830,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.9990E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.0010E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.5000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.5000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5000E+02 OP diff --git a/tests/integration/data/scan_MFILE.DAT b/tests/integration/data/scan_MFILE.DAT index 54597237d1..b0f9ab6760 100644 --- a/tests/integration/data/scan_MFILE.DAT +++ b/tests/integration/data/scan_MFILE.DAT @@ -402,7 +402,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -1397,7 +1397,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -2392,7 +2392,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -3387,7 +3387,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -4382,7 +4382,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -5377,7 +5377,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -6372,7 +6372,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -7367,7 +7367,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP @@ -8362,7 +8362,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 6.1276E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 3.8724E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 5.1000E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 5.1000E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 5.1000E+01 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 4.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.2750E+02 OP diff --git a/tests/unit/data/large_tokamak_MFILE.DAT b/tests/unit/data/large_tokamak_MFILE.DAT index 811f965f8f..120ecbcb52 100644 --- a/tests/unit/data/large_tokamak_MFILE.DAT +++ b/tests/unit/data/large_tokamak_MFILE.DAT @@ -544,7 +544,7 @@ Inductive_fraction______________________________________________________ (f_c_plasma_inductive)_______________________ 5.6376E-01 Total___________________________________________________________________ (plasipf+f_c_plasma_auxiliary+f_c_plasma_inductive)_________ 1.0000E+00 Fraction_of_the_plasma_current_produced_by_non-inductive_means__________ (f_c_plasma_non_inductive)____________________ 4.3624E-01 ITV - Electron_cyclotron_injected_power_(MW)__________________________________ (p_ecrh_injected_mw)______________________ 7.9710E+01 OP + Electron_cyclotron_injected_power_(MW)__________________________________ (p_hcd_ecrh_injected_total_mw)______________________ 7.9710E+01 OP Maximum_allowable_ECRH_power_(MW)_______________________________________ (p_hcd_injected_max)_____________________ 2.0000E+02 ECH_wall_plug_efficiency________________________________________________ (eta_ecrh_injector_wall_plug)______________________ 5.0000E-01 ECH_wall_plug_power_(MW)________________________________________________ (p_hcd_ecrh_electric_mw)_____________________ 1.5942E+02 OP diff --git a/tests/unit/test_costs_1990.py b/tests/unit/test_costs_1990.py index 63e1526b3a..0ff4454224 100644 --- a/tests/unit/test_costs_1990.py +++ b/tests/unit/test_costs_1990.py @@ -2889,7 +2889,7 @@ class Acc223Param(NamedTuple): i_hcd_primary: Any = None - p_ecrh_injected_mw: Any = None + p_hcd_ecrh_injected_total_mw: Any = None p_beam_injected_mw: Any = None @@ -2950,7 +2950,7 @@ class Acc223Param(NamedTuple): fcdfuel=0.10000000000000001, p_hcd_lowhyb_injected_total_mw=0, i_hcd_primary=10, - p_ecrh_injected_mw=51.978447720428512, + p_hcd_ecrh_injected_total_mw=51.978447720428512, p_beam_injected_mw=0, dcdrv2=59.899999999999999, mcdriv=1, @@ -2985,7 +2985,7 @@ class Acc223Param(NamedTuple): fcdfuel=0.10000000000000001, p_hcd_lowhyb_injected_total_mw=0, i_hcd_primary=10, - p_ecrh_injected_mw=51.978447720428512, + p_hcd_ecrh_injected_total_mw=51.978447720428512, p_beam_injected_mw=0, dcdrv2=59.899999999999999, mcdriv=1, @@ -3051,7 +3051,9 @@ def test_acc223(acc223param, monkeypatch, costs): ) monkeypatch.setattr( - current_drive_variables, "p_ecrh_injected_mw", acc223param.p_ecrh_injected_mw + current_drive_variables, + "p_hcd_ecrh_injected_total_mw", + acc223param.p_hcd_ecrh_injected_total_mw, ) monkeypatch.setattr( diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 6463dbb5aa..29b8f6adea 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -41,7 +41,7 @@ class CudrivParam(NamedTuple): p_hcd_electric_total_mw: Any = None - p_ecrh_injected_mw: Any = None + p_hcd_ecrh_injected_total_mw: Any = None p_hcd_beam_injected_total_mw: Any = None @@ -197,7 +197,7 @@ class CudrivParam(NamedTuple): expected_p_hcd_electric_total_mw: Any = None - expected_p_ecrh_injected_mw: Any = None + expected_p_hcd_ecrh_injected_total_mw: Any = None expected_gamcd: Any = None @@ -220,7 +220,7 @@ class CudrivParam(NamedTuple): CudrivParam( p_hcd_secondary_electric_mw=0, p_hcd_electric_total_mw=0, - p_ecrh_injected_mw=0, + p_hcd_ecrh_injected_total_mw=0, p_hcd_beam_injected_total_mw=0, p_hcd_lowhyb_injected_total_mw=0, c_beam_total=0, @@ -298,7 +298,7 @@ class CudrivParam(NamedTuple): iprint=0, outfile=11, expected_p_hcd_electric_total_mw=240.99200038011492, - expected_p_ecrh_injected_mw=120.49600019005746, + expected_p_hcd_ecrh_injected_total_mw=120.49600019005746, expected_gamcd=0.30000000000000004, expected_etacd=0.5, expected_p_hcd_injected_total_mw=120.49600019005746, @@ -310,7 +310,7 @@ class CudrivParam(NamedTuple): CudrivParam( p_hcd_secondary_electric_mw=0, p_hcd_electric_total_mw=240.99200038011492, - p_ecrh_injected_mw=120.49600019005746, + p_hcd_ecrh_injected_total_mw=120.49600019005746, p_hcd_beam_injected_total_mw=0, p_hcd_lowhyb_injected_total_mw=0, c_beam_total=0, @@ -388,7 +388,7 @@ class CudrivParam(NamedTuple): iprint=0, outfile=11, expected_p_hcd_electric_total_mw=240.99200038011492, - expected_p_ecrh_injected_mw=120.49600019005746, + expected_p_hcd_ecrh_injected_total_mw=120.49600019005746, expected_gamcd=0.30000000000000004, expected_etacd=0.5, expected_p_hcd_injected_total_mw=120.49600019005746, @@ -425,7 +425,9 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): ) monkeypatch.setattr( - current_drive_variables, "p_ecrh_injected_mw", cudrivparam.p_ecrh_injected_mw + current_drive_variables, + "p_hcd_ecrh_injected_total_mw", + cudrivparam.p_hcd_ecrh_injected_total_mw, ) monkeypatch.setattr( @@ -720,8 +722,8 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): cudrivparam.expected_p_hcd_electric_total_mw ) - assert current_drive_variables.p_ecrh_injected_mw == pytest.approx( - cudrivparam.expected_p_ecrh_injected_mw + assert current_drive_variables.p_hcd_ecrh_injected_total_mw == pytest.approx( + cudrivparam.expected_p_hcd_ecrh_injected_total_mw ) assert current_drive_variables.eta_cd_norm_hcd_primary == pytest.approx( From f30b2cb57c1c29d51814392514f4b8d237c01754 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Apr 2025 17:26:10 +0100 Subject: [PATCH 38/41] =?UTF-8?q?=F0=9F=94=84=20Refactor=20current=20drive?= =?UTF-8?q?=20method=20calls=20for=20clarity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/costs.py | 3 +- process/current_drive.py | 117 +++++++++++++++++++-------------------- process/output.py | 2 +- process/physics.py | 2 +- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/process/costs.py b/process/costs.py index cd2edb00e8..a8dbc66222 100644 --- a/process/costs.py +++ b/process/costs.py @@ -1807,7 +1807,8 @@ def acc223(self): self.c2231 = ( 1.0e-6 * cost_variables.ucech - * (1.0e6 * current_drive_variables.p_hcd_ecrh_injected_total_mw) ** exprf + * (1.0e6 * current_drive_variables.p_hcd_ecrh_injected_total_mw) + ** exprf ) if cost_variables.ifueltyp == 1: diff --git a/process/current_drive.py b/process/current_drive.py index 05e069a98a..e12c1abfee 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1231,7 +1231,7 @@ def __init__( self.neutral_beam = neutral_beam self.electron_bernstein = electron_bernstein - def cudriv(self, output: bool) -> None: + def cudriv(self) -> None: """ Calculate the current drive power requirements. @@ -1250,7 +1250,6 @@ def cudriv(self, output: bool) -> None: current_drive_variables.p_hcd_icrh_injected_total_mw = 0.0e0 current_drive_variables.p_hcd_ebw_injected_total_mw = 0.0e0 current_drive_variables.c_beam_total = 0.0e0 - beam_current_fix = 0.0e0 current_drive_variables.p_beam_orbit_loss_mw = 0.0e0 pinjmw1 = 0.0 @@ -1422,8 +1421,7 @@ def cudriv(self, output: bool) -> None: heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + current_drive_variables.p_hcd_secondary_extra_heat_mw - / current_drive_variables.eta_lowhyb_injector_wall_plug - ) + ) / current_drive_variables.eta_lowhyb_injector_wall_plug # Wall plug to injector efficiency current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( @@ -1432,6 +1430,7 @@ def cudriv(self, output: bool) -> None: current_drive_variables.p_hcd_lowhyb_injected_total_mw += ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw ) # ========================================================== @@ -1447,8 +1446,7 @@ def cudriv(self, output: bool) -> None: heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + current_drive_variables.p_hcd_secondary_extra_heat_mw - / current_drive_variables.eta_icrh_injector_wall_plug - ) + ) / current_drive_variables.eta_icrh_injector_wall_plug # Wall plug to injector efficiency current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( @@ -1457,6 +1455,7 @@ def cudriv(self, output: bool) -> None: current_drive_variables.p_hcd_icrh_injected_total_mw += ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw ) # ========================================================== @@ -1468,22 +1467,22 @@ def cudriv(self, output: bool) -> None: current_drive_variables.p_hcd_secondary_injected_mw ) - current_drive_variables.p_hcd_ecrh_injected_total_mw += ( - current_drive_variables.p_hcd_secondary_injected_mw - ) - # Wall plug power heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + current_drive_variables.p_hcd_secondary_extra_heat_mw - / current_drive_variables.eta_ecrh_injector_wall_plug - ) + ) / current_drive_variables.eta_ecrh_injector_wall_plug # Wall plug to injector efficiency current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( current_drive_variables.eta_ecrh_injector_wall_plug ) + current_drive_variables.p_hcd_ecrh_injected_total_mw += ( + current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw + ) + # ========================================================== # Electron berstein cases @@ -1497,14 +1496,18 @@ def cudriv(self, output: bool) -> None: heat_transport_variables.p_hcd_secondary_electric_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + current_drive_variables.p_hcd_secondary_extra_heat_mw - / current_drive_variables.eta_ebw_injector_wall_plug - ) + ) / current_drive_variables.eta_ebw_injector_wall_plug # Wall plug to injector efficiency current_drive_variables.eta_hcd_secondary_injector_wall_plug = ( current_drive_variables.eta_ebw_injector_wall_plug ) + current_drive_variables.p_hcd_ebw_injected_total_mw += ( + current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw + ) + # ========================================================== # Neutral beam cases @@ -1568,6 +1571,11 @@ def cudriv(self, output: bool) -> None: / current_drive_variables.e_beam_kev ) # Neutral beam current (A) + current_drive_variables.p_hcd_beam_injected_total_mw += ( + current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw + ) + # ========================================================== # Lower hybrid cases @@ -1584,8 +1592,7 @@ def cudriv(self, output: bool) -> None: heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.p_hcd_primary_injected_mw + current_drive_variables.p_hcd_primary_extra_heat_mw - / current_drive_variables.eta_lowhyb_injector_wall_plug - ) + ) / current_drive_variables.eta_lowhyb_injector_wall_plug # Wall plug power current_drive_variables.p_hcd_lowhyb_electric_mw = ( @@ -1609,17 +1616,14 @@ def cudriv(self, output: bool) -> None: p_hcd_primary_ions_mw = ( current_drive_variables.p_hcd_primary_injected_mw ) - current_drive_variables.p_hcd_icrh_injected_total_mw += ( - current_drive_variables.p_hcd_primary_injected_mw - ) # Wall plug power - current_drive_variables.p_hcd_lowhyb_electric_mw = ( + current_drive_variables.p_hcd_icrh_electric_mw = ( current_drive_variables.p_hcd_icrh_injected_total_mw / current_drive_variables.eta_icrh_injector_wall_plug ) heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.p_hcd_lowhyb_electric_mw + current_drive_variables.p_hcd_icrh_electric_mw ) # Wall plug to injector efficiency @@ -1627,36 +1631,41 @@ def cudriv(self, output: bool) -> None: current_drive_variables.eta_icrh_injector_wall_plug ) + current_drive_variables.p_hcd_icrh_injected_total_mw += ( + current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + # =========================================================== # Electron cyclotron cases if current_drive_variables.i_hcd_primary in [3, 7, 10, 13]: - current_drive_variables.p_hcd_ecrh_injected_total_mw += ( - current_drive_variables.p_hcd_primary_injected_mw - ) - p_hcd_primary_electrons_mw = ( current_drive_variables.p_hcd_primary_injected_mw ) - # Wall plug power - current_drive_variables.p_hcd_ecrh_electric_mw = ( - current_drive_variables.p_hcd_ecrh_injected_total_mw - / current_drive_variables.eta_ecrh_injector_wall_plug - ) - # Wall plug to injector efficiency heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.p_hcd_primary_injected_mw + current_drive_variables.p_hcd_primary_extra_heat_mw - / current_drive_variables.eta_ecrh_injector_wall_plug - ) + ) / current_drive_variables.eta_ecrh_injector_wall_plug current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ecrh_injector_wall_plug ) + current_drive_variables.p_hcd_ecrh_injected_total_mw += ( + current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + + # Wall plug power + current_drive_variables.p_hcd_ecrh_electric_mw = ( + current_drive_variables.p_hcd_ecrh_injected_total_mw + / current_drive_variables.eta_ecrh_injector_wall_plug + ) + # =========================================================== # Electron bernstein cases @@ -1677,13 +1686,17 @@ def cudriv(self, output: bool) -> None: heat_transport_variables.p_hcd_primary_electric_mw = ( current_drive_variables.p_hcd_primary_injected_mw + current_drive_variables.p_hcd_primary_extra_heat_mw - / current_drive_variables.eta_ebw_injector_wall_plug - ) + ) / current_drive_variables.eta_ebw_injector_wall_plug current_drive_variables.eta_hcd_primary_injector_wall_plug = ( current_drive_variables.eta_ebw_injector_wall_plug ) + current_drive_variables.p_hcd_ebw_injected_total_mw += ( + current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + # =========================================================== elif current_drive_variables.i_hcd_primary in [5, 8]: @@ -1742,6 +1755,11 @@ def cudriv(self, output: bool) -> None: / current_drive_variables.e_beam_kev ) # Neutral beam current (A) + current_drive_variables.p_hcd_beam_injected_total_mw += ( + current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + # =========================================================== # Total injected power that contributed to heating @@ -1797,8 +1815,11 @@ def cudriv(self, output: bool) -> None: + physics_variables.p_plasma_ohmic_mw ) - if not output: - return + def output_current_drive(self): + """ + Output the current drive information to the output file. + This method writes the current drive information to the output file. + """ po.oheadr(self.outfile, "Heating & Current Drive System") @@ -1963,17 +1984,6 @@ def cudriv(self, output: bool) -> None: "OP ", ) - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.ovarre( - self.outfile, - "Secondary fixed neutral beam current (A)", - "(beam_current_fix)", - beam_current_fix, - "OP ", - ) - po.ovarre( self.outfile, "Neutral beam wall plug efficiency", @@ -2180,17 +2190,6 @@ def cudriv(self, output: bool) -> None: "OP ", ) - if (current_drive_variables.i_hcd_secondary == 5) or ( - current_drive_variables.i_hcd_secondary == 8 - ): - po.ovarre( - self.outfile, - "Secondary fixed neutral beam current (A)", - "(beam_current_fix)", - beam_current_fix, - "OP ", - ) - po.ovarre( self.outfile, "Neutral beam wall plug efficiency", diff --git a/process/output.py b/process/output.py index 16cc4f67d9..98c95c4060 100644 --- a/process/output.py +++ b/process/output.py @@ -43,7 +43,7 @@ def write(models, _outfile): models.physics.outplas() # TODO what is this? Not in caller.f90? - models.current_drive.cudriv(output=True) + models.current_drive.output_current_drive() # Pulsed reactor model models.pulse.run(output=True) diff --git a/process/physics.py b/process/physics.py index a3ecb0d3d1..ea172b1602 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2044,7 +2044,7 @@ def physics(self): # Auxiliary current drive power calculations if current_drive_variables.i_hcd_calculations != 0: - self.current_drive.cudriv(False) + self.current_drive.cudriv() # ***************************** # # FUSION REACTIONS # From cb34a38313b8904b8c79973ff38b0153506e0bef Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Apr 2025 17:26:10 +0100 Subject: [PATCH 39/41] =?UTF-8?q?=F0=9F=94=84=20Refactor=20current=20drive?= =?UTF-8?q?=20method=20calls=20for=20clarity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/test_current_drive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 29b8f6adea..0ea3612fc0 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -716,7 +716,7 @@ def test_cudriv(cudrivparam, monkeypatch, current_drive): monkeypatch.setattr(cost_variables, "startupratio", cudrivparam.startupratio) - current_drive.cudriv(output=False) + current_drive.cudriv() assert heat_transport_variables.p_hcd_electric_total_mw == pytest.approx( cudrivparam.expected_p_hcd_electric_total_mw From 32811fd436800620f9135dc40b880fe8fe178bfb Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 14 Apr 2025 16:21:21 +0100 Subject: [PATCH 40/41] Re make current drive unit tests to new style, create case for lower hybrid --- process/current_drive.py | 108 +++-- tests/unit/test_current_drive.py | 769 +++---------------------------- 2 files changed, 138 insertions(+), 739 deletions(-) diff --git a/process/current_drive.py b/process/current_drive.py index e12c1abfee..028e9aafd6 100644 --- a/process/current_drive.py +++ b/process/current_drive.py @@ -1395,7 +1395,7 @@ def cudriv(self) -> None: - current_drive_variables.f_c_plasma_hcd_secondary ) * physics_variables.plasma_current - / current_drive_variables.eta_cd_norm_hcd_primary + / current_drive_variables.eta_cd_hcd_primary ) # Calculate the driven current for the primary heating method @@ -1404,6 +1404,11 @@ def cudriv(self) -> None: * current_drive_variables.p_hcd_primary_injected_mw * 1.0e6 ) + # Calculate the fraction of the plasma current driven by the primary heating method + current_drive_variables.f_c_plasma_hcd_primary = ( + current_drive_variables.c_hcd_primary_driven + / physics_variables.plasma_current + ) # =========================================================== @@ -1415,6 +1420,7 @@ def cudriv(self) -> None: # Injected power p_hcd_secondary_electrons_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw ) # Wall plug power @@ -1440,6 +1446,7 @@ def cudriv(self) -> None: # Injected power p_hcd_secondary_ions_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw ) # Wall plug power @@ -1465,6 +1472,7 @@ def cudriv(self) -> None: # Injected power p_hcd_secondary_electrons_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw ) # Wall plug power @@ -1490,6 +1498,7 @@ def cudriv(self) -> None: # Injected power p_hcd_secondary_electrons_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw ) # Wall plug power @@ -1523,6 +1532,7 @@ def cudriv(self) -> None: # Shinethrough power (atoms that are not ionised) [MW]: current_drive_variables.p_beam_shine_through_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw * (1.0 - current_drive_variables.f_p_beam_shine_through) ) @@ -1531,6 +1541,7 @@ def cudriv(self) -> None: current_drive_variables.f_p_beam_orbit_loss * ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw - current_drive_variables.p_beam_shine_through_mw ) ) @@ -1538,6 +1549,7 @@ def cudriv(self) -> None: # Power deposited current_drive_variables.p_beam_plasma_coupled_mw = ( current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw - current_drive_variables.p_beam_shine_through_mw - current_drive_variables.p_beam_orbit_loss_mw ) @@ -1553,7 +1565,10 @@ def cudriv(self) -> None: ) current_drive_variables.pwpnb = ( - current_drive_variables.p_hcd_secondary_injected_mw + ( + current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw + ) / current_drive_variables.eta_beam_injector_wall_plug ) # neutral beam wall plug power @@ -1567,7 +1582,13 @@ def cudriv(self) -> None: current_drive_variables.c_beam_total = ( 1.0e-3 - * (current_drive_variables.p_hcd_secondary_injected_mw * 1.0e6) + * ( + ( + current_drive_variables.p_hcd_secondary_injected_mw + + current_drive_variables.p_hcd_secondary_extra_heat_mw + ) + * 1.0e6 + ) / current_drive_variables.e_beam_kev ) # Neutral beam current (A) @@ -1582,10 +1603,12 @@ def cudriv(self) -> None: if current_drive_variables.i_hcd_primary in [1, 4, 6]: p_hcd_primary_electrons_mw = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw ) current_drive_variables.p_hcd_lowhyb_injected_total_mw += ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw ) # Wall plug power @@ -1594,37 +1617,31 @@ def cudriv(self) -> None: + current_drive_variables.p_hcd_primary_extra_heat_mw ) / current_drive_variables.eta_lowhyb_injector_wall_plug + # Wall plug to injector efficiency + current_drive_variables.eta_hcd_primary_injector_wall_plug = ( + current_drive_variables.eta_lowhyb_injector_wall_plug + ) + # Wall plug power current_drive_variables.p_hcd_lowhyb_electric_mw = ( current_drive_variables.p_hcd_lowhyb_injected_total_mw / current_drive_variables.eta_lowhyb_injector_wall_plug ) - heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.p_hcd_lowhyb_electric_mw - ) - - # Wall plug to injector efficiency - current_drive_variables.eta_hcd_primary_injector_wall_plug = ( - current_drive_variables.eta_lowhyb_injector_wall_plug - ) - # =========================================================== # Ion cyclotron cases if current_drive_variables.i_hcd_primary in [2]: p_hcd_primary_ions_mw = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw ) # Wall plug power - current_drive_variables.p_hcd_icrh_electric_mw = ( - current_drive_variables.p_hcd_icrh_injected_total_mw - / current_drive_variables.eta_icrh_injector_wall_plug - ) heat_transport_variables.p_hcd_primary_electric_mw = ( - current_drive_variables.p_hcd_icrh_electric_mw - ) + current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) / current_drive_variables.eta_icrh_injector_wall_plug # Wall plug to injector efficiency current_drive_variables.eta_hcd_primary_injector_wall_plug = ( @@ -1636,6 +1653,12 @@ def cudriv(self) -> None: + current_drive_variables.p_hcd_primary_extra_heat_mw ) + # Wall plug power + current_drive_variables.p_hcd_icrh_electric_mw = ( + current_drive_variables.p_hcd_icrh_injected_total_mw + / current_drive_variables.eta_icrh_injector_wall_plug + ) + # =========================================================== # Electron cyclotron cases @@ -1643,6 +1666,7 @@ def cudriv(self) -> None: if current_drive_variables.i_hcd_primary in [3, 7, 10, 13]: p_hcd_primary_electrons_mw = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw ) # Wall plug to injector efficiency @@ -1671,15 +1695,9 @@ def cudriv(self) -> None: # Electron bernstein cases if current_drive_variables.i_hcd_primary in [12]: - current_drive_variables.p_ebw_injected_mw += ( - current_drive_variables.p_hcd_primary_injected_mw - ) - p_hcd_primary_electrons_mw = current_drive_variables.p_ebw_injected_mw - - # Wall plug power - current_drive_variables.p_hcd_ebw_electric_mw = ( + p_hcd_primary_electrons_mw = ( current_drive_variables.p_ebw_injected_mw - / current_drive_variables.eta_ebw_injector_wall_plug + + current_drive_variables.p_hcd_primary_extra_heat_mw ) # Wall plug to injector efficiency @@ -1697,6 +1715,12 @@ def cudriv(self) -> None: + current_drive_variables.p_hcd_primary_extra_heat_mw ) + # Wall plug power + current_drive_variables.p_hcd_ebw_electric_mw = ( + current_drive_variables.p_ebw_injected_mw + / current_drive_variables.eta_ebw_injector_wall_plug + ) + # =========================================================== elif current_drive_variables.i_hcd_primary in [5, 8]: @@ -1710,6 +1734,7 @@ def cudriv(self) -> None: # Shinethrough power (atoms that are not ionised) [MW]: current_drive_variables.p_beam_shine_through_mw = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw * (1.0 - current_drive_variables.f_p_beam_shine_through) ) @@ -1718,6 +1743,7 @@ def cudriv(self) -> None: current_drive_variables.f_p_beam_orbit_loss * ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw - current_drive_variables.p_beam_shine_through_mw ) ) @@ -1725,6 +1751,7 @@ def cudriv(self) -> None: # Power deposited current_drive_variables.p_beam_plasma_coupled_mw = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw - current_drive_variables.p_beam_shine_through_mw - current_drive_variables.p_beam_orbit_loss_mw ) @@ -1738,6 +1765,7 @@ def cudriv(self) -> None: current_drive_variables.pwpnb = ( current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw / current_drive_variables.eta_beam_injector_wall_plug ) @@ -1751,7 +1779,13 @@ def cudriv(self) -> None: current_drive_variables.c_beam_total = ( 1.0e-3 - * (current_drive_variables.p_hcd_primary_injected_mw * 1.0e6) + * ( + ( + current_drive_variables.p_hcd_primary_injected_mw + + current_drive_variables.p_hcd_primary_extra_heat_mw + ) + * 1.0e6 + ) / current_drive_variables.e_beam_kev ) # Neutral beam current (A) @@ -1799,21 +1833,11 @@ def cudriv(self) -> None: heat_transport_variables.p_hcd_electric_total_mw = 0.0e0 # Ratio of fusion to input (injection+ohmic) power - if ( - abs( - current_drive_variables.p_hcd_injected_total_mw - + current_drive_variables.p_beam_orbit_loss_mw - + physics_variables.p_plasma_ohmic_mw - ) - < 1.0e-6 - ): - current_drive_variables.bigq = 1.0e18 - else: - current_drive_variables.bigq = physics_variables.fusion_power / ( - current_drive_variables.p_hcd_injected_total_mw - + current_drive_variables.p_beam_orbit_loss_mw - + physics_variables.p_plasma_ohmic_mw - ) + current_drive_variables.bigq = physics_variables.fusion_power / ( + current_drive_variables.p_hcd_injected_total_mw + + current_drive_variables.p_beam_orbit_loss_mw + + physics_variables.p_plasma_ohmic_mw + ) def output_current_drive(self): """ diff --git a/tests/unit/test_current_drive.py b/tests/unit/test_current_drive.py index 0ea3612fc0..2385a21989 100644 --- a/tests/unit/test_current_drive.py +++ b/tests/unit/test_current_drive.py @@ -1,5 +1,3 @@ -from typing import Any, NamedTuple - import pytest from process.current_drive import ( @@ -11,7 +9,6 @@ NeutralBeam, ) from process.fortran import ( - cost_variables, current_drive_variables, heat_transport_variables, physics_variables, @@ -36,721 +33,99 @@ def current_drive(): ) -class CudrivParam(NamedTuple): - p_hcd_secondary_electric_mw: Any = None - - p_hcd_electric_total_mw: Any = None - - p_hcd_ecrh_injected_total_mw: Any = None - - p_hcd_beam_injected_total_mw: Any = None - - p_hcd_lowhyb_injected_total_mw: Any = None - - c_beam_total: Any = None - - p_beam_orbit_loss_mw: Any = None - - i_hcd_primary: Any = None - - i_hcd_secondary: Any = None - - p_hcd_primary_extra_heat_mw: Any = None - - p_hcd_secondary_extra_heat_mw: Any = None - - p_hcd_secondary_injected_mw: Any = None - - i_hcd_calculations: Any = None - - feffcd: Any = None - - f_p_beam_injected_ions: Any = None - - f_p_beam_shine_through: Any = None - - eta_cd_norm_hcd_primary: Any = None - - eta_cd_norm_ecrh: Any = None - - eta_lowhyb_injector_wall_plug: Any = None - - eta_hcd_primary_injector_wall_plug: Any = None - - eta_hcd_secondary_injector_wall_plug: Any = None - - eta_ecrh_injector_wall_plug: Any = None - - f_p_beam_orbit_loss: Any = None - - p_hcd_injected_total_mw: Any = None - - pwpnb: Any = None - - eta_beam_injector_wall_plug: Any = None - - e_beam_kev: Any = None - - eta_cd_hcd_primary: Any = None - - p_hcd_lowhyb_electric_mw: Any = None - - p_hcd_ecrh_electric_mw: Any = None - - p_beam_injected_mw: Any = None - - p_beam_shine_through_mw: Any = None - - p_hcd_injected_electrons_mw: Any = None - - p_hcd_injected_ions_mw: Any = None - - bigq: Any = None - - f_c_plasma_bootstrap: Any = None - - f_c_plasma_bootstrap_max: Any = None - - n_beam_decay_lengths_core: Any = None - - p_hcd_injected_max: Any = None - - dx_beam_shield: Any = None - - frbeam: Any = None - - rtanbeam: Any = None - - rtanmax: Any = None - - f_c_plasma_diamagnetic: Any = None - - f_c_plasma_pfirsch_schluter: Any = None - - f_c_plasma_internal: Any = None - - n_ecrh_harmonic: Any = None - - xi_ebw: Any = None - - dene: Any = None - - te: Any = None - - rmajor: Any = None - - ten: Any = None - - zeff: Any = None - - dlamee: Any = None - - beta: Any = None - - rhopedt: Any = None - - rhopedn: Any = None - - te0: Any = None - - teped: Any = None - - tesep: Any = None - - alphat: Any = None - - alphan: Any = None - - ne0: Any = None - - nesep: Any = None - - neped: Any = None - - bt: Any = None - - rminor: Any = None - - tbeta: Any = None - - plasma_current: Any = None - - ipedestal: Any = None - - f_c_plasma_auxiliary: Any = None - - ignite: Any = None - - p_plasma_ohmic_mw: Any = None - - fusion_power: Any = None - - f_c_plasma_inductive: Any = None - - f_c_plasma_non_inductive: Any = None - - startupratio: Any = None - - iprint: Any = None - - outfile: Any = None - - expected_p_hcd_electric_total_mw: Any = None - - expected_p_hcd_ecrh_injected_total_mw: Any = None - - expected_gamcd: Any = None - - expected_etacd: Any = None - - expected_p_hcd_injected_total_mw: Any = None - - expected_effcd: Any = None - - expected_p_hcd_ecrh_electric_mw: Any = None - - expected_p_hcd_injected_electrons_mw: Any = None - - expected_bigq: Any = None - - -@pytest.mark.parametrize( - "cudrivparam", - ( - CudrivParam( - p_hcd_secondary_electric_mw=0, - p_hcd_electric_total_mw=0, - p_hcd_ecrh_injected_total_mw=0, - p_hcd_beam_injected_total_mw=0, - p_hcd_lowhyb_injected_total_mw=0, - c_beam_total=0, - p_beam_orbit_loss_mw=0, - i_hcd_primary=10, - i_hcd_secondary=0, - p_hcd_primary_extra_heat_mw=75, - p_hcd_secondary_extra_heat_mw=0, - p_hcd_secondary_injected_mw=0, - i_hcd_calculations=1, - feffcd=1, - f_p_beam_injected_ions=0.5, - f_p_beam_shine_through=0, - eta_cd_norm_hcd_primary=0, - eta_cd_norm_ecrh=0.30000000000000004, - eta_lowhyb_injector_wall_plug=0.29999999999999999, - eta_hcd_primary_injector_wall_plug=0, - eta_hcd_secondary_injector_wall_plug=0, - eta_ecrh_injector_wall_plug=0.5, - f_p_beam_orbit_loss=0, - p_hcd_injected_total_mw=0, - pwpnb=0, - eta_beam_injector_wall_plug=0.29999999999999999, - e_beam_kev=1000, - eta_cd_hcd_primary=0, - p_hcd_lowhyb_electric_mw=0, - p_hcd_ecrh_electric_mw=0, - p_beam_injected_mw=0, - p_beam_shine_through_mw=0, - p_hcd_injected_electrons_mw=0, - p_hcd_injected_ions_mw=0, - bigq=0, - f_c_plasma_bootstrap=0.27635918746616817, - f_c_plasma_bootstrap_max=0.95000000000000007, - n_beam_decay_lengths_core=0, - p_hcd_injected_max=200, - dx_beam_shield=0.5, - frbeam=1.05, - rtanbeam=0, - rtanmax=0, - f_c_plasma_diamagnetic=0, - f_c_plasma_pfirsch_schluter=0, - f_c_plasma_internal=0.27635918746616817, - n_ecrh_harmonic=1, - xi_ebw=0.80000000000000004, - dene=7.5e19, - te=12, - rmajor=8, - ten=12.626131115905864, - zeff=2.0909945616489103, - dlamee=17.510652035055571, - beta=0.030000000000000006, - rhopedt=0.94000000000000006, - rhopedn=0.94000000000000006, - te0=24.402321098330372, - teped=5.5, - tesep=0.10000000000000001, - alphat=1.45, - alphan=1, - ne0=8.515060981068918e19, - nesep=4.1177885154594193e19, - neped=7.000240476281013e19, - bt=5.7000000000000002, - rminor=2.6666666666666665, - tbeta=2, - plasma_current=18398455.678867526, - ipedestal=1, - f_c_plasma_auxiliary=0.12364081253383186, - ignite=0, - p_plasma_ohmic_mw=0, - fusion_power=0, - f_c_plasma_inductive=0.59999999999999998, - f_c_plasma_non_inductive=0.40000000000000002, - startupratio=1, - iprint=0, - outfile=11, - expected_p_hcd_electric_total_mw=240.99200038011492, - expected_p_hcd_ecrh_injected_total_mw=120.49600019005746, - expected_gamcd=0.30000000000000004, - expected_etacd=0.5, - expected_p_hcd_injected_total_mw=120.49600019005746, - expected_effcd=0.05000000000000001, - expected_p_hcd_ecrh_electric_mw=240.99200038011492, - expected_p_hcd_injected_electrons_mw=120.49600019005746, - expected_bigq=0, - ), - CudrivParam( - p_hcd_secondary_electric_mw=0, - p_hcd_electric_total_mw=240.99200038011492, - p_hcd_ecrh_injected_total_mw=120.49600019005746, - p_hcd_beam_injected_total_mw=0, - p_hcd_lowhyb_injected_total_mw=0, - c_beam_total=0, - p_beam_orbit_loss_mw=0, - i_hcd_primary=10, - i_hcd_secondary=0, - p_hcd_primary_extra_heat_mw=75, - p_hcd_secondary_extra_heat_mw=0, - p_hcd_secondary_injected_mw=0, - i_hcd_calculations=1, - feffcd=1, - f_p_beam_injected_ions=0.5, - f_p_beam_shine_through=0, - eta_cd_norm_hcd_primary=0.30000000000000004, - eta_cd_norm_ecrh=0.30000000000000004, - eta_lowhyb_injector_wall_plug=0.29999999999999999, - eta_hcd_primary_injector_wall_plug=0.5, - eta_hcd_secondary_injector_wall_plug=0, - eta_ecrh_injector_wall_plug=0.5, - f_p_beam_orbit_loss=0, - p_hcd_injected_total_mw=120.49600019005746, - pwpnb=0, - eta_beam_injector_wall_plug=0.29999999999999999, - e_beam_kev=1000, - eta_cd_hcd_primary=0.05000000000000001, - p_hcd_lowhyb_electric_mw=0, - p_hcd_ecrh_electric_mw=240.99200038011492, - p_beam_injected_mw=0, - p_beam_shine_through_mw=0, - p_hcd_injected_electrons_mw=120.49600019005746, - p_hcd_injected_ions_mw=0, - bigq=0, - f_c_plasma_bootstrap=0.27635918746616817, - f_c_plasma_bootstrap_max=0.95000000000000007, - n_beam_decay_lengths_core=0, - p_hcd_injected_max=200, - dx_beam_shield=0.5, - frbeam=1.05, - rtanbeam=8.4000000000000004, - rtanmax=13.179564451855533, - f_c_plasma_diamagnetic=0, - f_c_plasma_pfirsch_schluter=0, - f_c_plasma_internal=0.27635918746616817, - n_ecrh_harmonic=1, - xi_ebw=0.80000000000000004, - dene=7.5e19, - te=12, - rmajor=8, - ten=12.626131115905864, - zeff=2.0909945616489103, - dlamee=17.510652035055571, - beta=0.030000000000000006, - rhopedt=0.94000000000000006, - rhopedn=0.94000000000000006, - te0=24.402321098330372, - teped=5.5, - tesep=0.10000000000000001, - alphat=1.45, - alphan=1, - ne0=8.515060981068918e19, - nesep=4.1177885154594193e19, - neped=7.000240476281013e19, - bt=5.7000000000000002, - rminor=2.6666666666666665, - tbeta=2, - plasma_current=18398455.678867526, - ipedestal=1, - f_c_plasma_auxiliary=0.12364081253383186, - ignite=0, - p_plasma_ohmic_mw=0.76707314489379119, - fusion_power=1051.6562748933977, - f_c_plasma_inductive=0.59999999999999998, - f_c_plasma_non_inductive=0.40000000000000002, - startupratio=1, - iprint=0, - outfile=11, - expected_p_hcd_electric_total_mw=240.99200038011492, - expected_p_hcd_ecrh_injected_total_mw=120.49600019005746, - expected_gamcd=0.30000000000000004, - expected_etacd=0.5, - expected_p_hcd_injected_total_mw=120.49600019005746, - expected_effcd=0.05000000000000001, - expected_p_hcd_ecrh_electric_mw=240.99200038011492, - expected_p_hcd_injected_electrons_mw=120.49600019005746, - expected_bigq=8.6725187311435423, - ), - ), -) -def test_cudriv(cudrivparam, monkeypatch, current_drive): - """ - Automatically generated Regression Unit Test for cudriv. - - This test was generated using data from tests/regression/scenarios/large-tokamak/IN.DAT. - - :param cudrivparam: the data used to mock and assert in this test. - :type cudrivparam: cudrivparam - - :param monkeypatch: pytest fixture used to mock module/class variables - :type monkeypatch: _pytest.monkeypatch.monkeypatch - """ - - monkeypatch.setattr( - heat_transport_variables, - "p_hcd_secondary_electric_mw", - cudrivparam.p_hcd_secondary_electric_mw, - ) - - monkeypatch.setattr( - heat_transport_variables, - "p_hcd_electric_total_mw", - cudrivparam.p_hcd_electric_total_mw, - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_ecrh_injected_total_mw", - cudrivparam.p_hcd_ecrh_injected_total_mw, - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_beam_injected_total_mw", - cudrivparam.p_hcd_beam_injected_total_mw, - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_lowhyb_injected_total_mw", - cudrivparam.p_hcd_lowhyb_injected_total_mw, - ) - - monkeypatch.setattr( - current_drive_variables, "c_beam_total", cudrivparam.c_beam_total - ) - - monkeypatch.setattr( - current_drive_variables, - "p_beam_orbit_loss_mw", - cudrivparam.p_beam_orbit_loss_mw, - ) - - monkeypatch.setattr( - current_drive_variables, "i_hcd_primary", cudrivparam.i_hcd_primary - ) - - monkeypatch.setattr( - current_drive_variables, "i_hcd_secondary", cudrivparam.i_hcd_secondary - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_primary_extra_heat_mw", - cudrivparam.p_hcd_primary_extra_heat_mw, - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_secondary_extra_heat_mw", - cudrivparam.p_hcd_secondary_extra_heat_mw, - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_secondary_injected_mw", - cudrivparam.p_hcd_secondary_injected_mw, - ) - - monkeypatch.setattr( - current_drive_variables, "i_hcd_calculations", cudrivparam.i_hcd_calculations - ) - - monkeypatch.setattr(current_drive_variables, "feffcd", cudrivparam.feffcd) - - monkeypatch.setattr( - current_drive_variables, - "f_p_beam_injected_ions", - cudrivparam.f_p_beam_injected_ions, - ) - - monkeypatch.setattr( - current_drive_variables, - "f_p_beam_shine_through", - cudrivparam.f_p_beam_shine_through, - ) - - monkeypatch.setattr( - current_drive_variables, - "eta_cd_norm_hcd_primary", - cudrivparam.eta_cd_norm_hcd_primary, - ) - - monkeypatch.setattr( - current_drive_variables, "eta_cd_norm_ecrh", cudrivparam.eta_cd_norm_ecrh - ) - - monkeypatch.setattr( - current_drive_variables, - "eta_lowhyb_injector_wall_plug", - cudrivparam.eta_lowhyb_injector_wall_plug, - ) - - monkeypatch.setattr( - current_drive_variables, - "eta_hcd_primary_injector_wall_plug", - cudrivparam.eta_hcd_primary_injector_wall_plug, - ) - - monkeypatch.setattr( - current_drive_variables, - "eta_hcd_secondary_injector_wall_plug", - cudrivparam.eta_hcd_secondary_injector_wall_plug, - ) - - monkeypatch.setattr( - current_drive_variables, - "eta_ecrh_injector_wall_plug", - cudrivparam.eta_ecrh_injector_wall_plug, - ) - - monkeypatch.setattr( - current_drive_variables, "f_p_beam_orbit_loss", cudrivparam.f_p_beam_orbit_loss - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_injected_total_mw", - cudrivparam.p_hcd_injected_total_mw, - ) - - monkeypatch.setattr(current_drive_variables, "pwpnb", cudrivparam.pwpnb) - - monkeypatch.setattr( - current_drive_variables, - "eta_beam_injector_wall_plug", - cudrivparam.eta_beam_injector_wall_plug, - ) - - monkeypatch.setattr(current_drive_variables, "e_beam_kev", cudrivparam.e_beam_kev) - - monkeypatch.setattr( - current_drive_variables, "eta_cd_hcd_primary", cudrivparam.eta_cd_hcd_primary - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_lowhyb_electric_mw", - cudrivparam.p_hcd_lowhyb_electric_mw, - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_ecrh_electric_mw", - cudrivparam.p_hcd_ecrh_electric_mw, - ) - - monkeypatch.setattr( - current_drive_variables, "p_beam_injected_mw", cudrivparam.p_beam_injected_mw - ) - - monkeypatch.setattr( - current_drive_variables, - "p_beam_shine_through_mw", - cudrivparam.p_beam_shine_through_mw, - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_injected_electrons_mw", - cudrivparam.p_hcd_injected_electrons_mw, - ) - - monkeypatch.setattr( - current_drive_variables, - "p_hcd_injected_ions_mw", - cudrivparam.p_hcd_injected_ions_mw, - ) - - monkeypatch.setattr(current_drive_variables, "bigq", cudrivparam.bigq) - - monkeypatch.setattr( - current_drive_variables, - "f_c_plasma_bootstrap", - cudrivparam.f_c_plasma_bootstrap, - ) - - monkeypatch.setattr( - current_drive_variables, - "f_c_plasma_bootstrap_max", - cudrivparam.f_c_plasma_bootstrap_max, - ) - - monkeypatch.setattr( - current_drive_variables, - "n_beam_decay_lengths_core", - cudrivparam.n_beam_decay_lengths_core, - ) - - monkeypatch.setattr( - current_drive_variables, "p_hcd_injected_max", cudrivparam.p_hcd_injected_max - ) +def test_cudriv_primary_lower_hybrid(current_drive): + current_drive_variables.i_hcd_primary = 1 # Lower Hybrid + current_drive_variables.i_hcd_secondary = 0 + current_drive_variables.i_hcd_calculations = 1 + current_drive_variables.p_hcd_primary_extra_heat_mw = 0.0 + current_drive_variables.eta_cd_hcd_secondary = 0.0 + physics_variables.dene = 1e20 + physics_variables.te = 10 + physics_variables.rmajor = 6.2 + physics_variables.plasma_current = 15e6 + physics_variables.f_c_plasma_auxiliary = 0.2 + current_drive_variables.eta_lowhyb_injector_wall_plug = 0.4 + current_drive.cudriv() - monkeypatch.setattr( - current_drive_variables, "dx_beam_shield", cudrivparam.dx_beam_shield + assert current_drive_variables.eta_cd_hcd_primary == pytest.approx( + 0.07812311, rel=1e-6 ) - - monkeypatch.setattr(current_drive_variables, "frbeam", cudrivparam.frbeam) - - monkeypatch.setattr(current_drive_variables, "rtanbeam", cudrivparam.rtanbeam) - - monkeypatch.setattr(current_drive_variables, "rtanmax", cudrivparam.rtanmax) - - monkeypatch.setattr( - current_drive_variables, - "f_c_plasma_diamagnetic", - cudrivparam.f_c_plasma_diamagnetic, + assert current_drive_variables.eta_cd_norm_hcd_primary == pytest.approx( + 0.48436326, rel=1e-6 ) - - monkeypatch.setattr( - current_drive_variables, - "f_c_plasma_pfirsch_schluter", - cudrivparam.f_c_plasma_pfirsch_schluter, + assert current_drive_variables.f_c_plasma_hcd_secondary == pytest.approx( + 0.0, rel=1e-6 ) - - monkeypatch.setattr( - current_drive_variables, - "f_c_plasma_internal", - cudrivparam.f_c_plasma_internal, + assert current_drive_variables.p_hcd_primary_injected_mw == pytest.approx( + 38.4009309, rel=1e-6 ) - - monkeypatch.setattr( - current_drive_variables, "n_ecrh_harmonic", cudrivparam.n_ecrh_harmonic + assert current_drive_variables.c_hcd_primary_driven == pytest.approx( + 3000000.0, rel=1e-6 ) - - monkeypatch.setattr(current_drive_variables, "xi_ebw", cudrivparam.xi_ebw) - - monkeypatch.setattr(physics_variables, "dene", cudrivparam.dene) - - monkeypatch.setattr(physics_variables, "te", cudrivparam.te) - - monkeypatch.setattr(physics_variables, "rmajor", cudrivparam.rmajor) - - monkeypatch.setattr(physics_variables, "ten", cudrivparam.ten) - - monkeypatch.setattr(physics_variables, "zeff", cudrivparam.zeff) - - monkeypatch.setattr(physics_variables, "dlamee", cudrivparam.dlamee) - - monkeypatch.setattr(physics_variables, "beta", cudrivparam.beta) - - monkeypatch.setattr(physics_variables, "rhopedt", cudrivparam.rhopedt) - - monkeypatch.setattr(physics_variables, "rhopedn", cudrivparam.rhopedn) - - monkeypatch.setattr(physics_variables, "te0", cudrivparam.te0) - - monkeypatch.setattr(physics_variables, "teped", cudrivparam.teped) - - monkeypatch.setattr(physics_variables, "tesep", cudrivparam.tesep) - - monkeypatch.setattr(physics_variables, "alphat", cudrivparam.alphat) - - monkeypatch.setattr(physics_variables, "alphan", cudrivparam.alphan) - - monkeypatch.setattr(physics_variables, "ne0", cudrivparam.ne0) - - monkeypatch.setattr(physics_variables, "nesep", cudrivparam.nesep) - - monkeypatch.setattr(physics_variables, "neped", cudrivparam.neped) - - monkeypatch.setattr(physics_variables, "bt", cudrivparam.bt) - - monkeypatch.setattr(physics_variables, "rminor", cudrivparam.rminor) - - monkeypatch.setattr(physics_variables, "tbeta", cudrivparam.tbeta) - - monkeypatch.setattr(physics_variables, "plasma_current", cudrivparam.plasma_current) - - monkeypatch.setattr(physics_variables, "ipedestal", cudrivparam.ipedestal) - - monkeypatch.setattr( - physics_variables, "f_c_plasma_auxiliary", cudrivparam.f_c_plasma_auxiliary + assert current_drive_variables.f_c_plasma_hcd_primary == pytest.approx( + 0.2, rel=1e-6 ) - - monkeypatch.setattr(physics_variables, "ignite", cudrivparam.ignite) - - monkeypatch.setattr( - physics_variables, "p_plasma_ohmic_mw", cudrivparam.p_plasma_ohmic_mw + assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx( + 96.00232726, rel=1e-6 ) - - monkeypatch.setattr(physics_variables, "fusion_power", cudrivparam.fusion_power) - - monkeypatch.setattr( - physics_variables, - "f_c_plasma_inductive", - cudrivparam.f_c_plasma_inductive, + assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx( + 0.0, rel=1e-6 ) - - monkeypatch.setattr( - physics_variables, - "f_c_plasma_non_inductive", - cudrivparam.f_c_plasma_non_inductive, + assert current_drive_variables.p_hcd_injected_total_mw == pytest.approx( + 38.4009309, rel=1e-6 ) - - monkeypatch.setattr(cost_variables, "startupratio", cudrivparam.startupratio) - + assert current_drive_variables.p_hcd_injected_electrons_mw == pytest.approx( + 38.4009309, rel=1e-6 + ) + + +def test_cudriv_primary_lower_hybrid_with_heat(current_drive): + current_drive_variables.i_hcd_primary = 1 # Lower Hybrid + current_drive_variables.i_hcd_secondary = 0 + current_drive_variables.i_hcd_calculations = 1 + current_drive_variables.p_hcd_primary_extra_heat_mw = 5.0 # Adding primary heat + current_drive_variables.eta_cd_hcd_secondary = 0.0 + physics_variables.dene = 1e20 + physics_variables.te = 10 + physics_variables.rmajor = 6.2 + physics_variables.plasma_current = 15e6 + physics_variables.f_c_plasma_auxiliary = 0.2 + current_drive_variables.eta_lowhyb_injector_wall_plug = 0.4 current_drive.cudriv() - assert heat_transport_variables.p_hcd_electric_total_mw == pytest.approx( - cudrivparam.expected_p_hcd_electric_total_mw - ) - - assert current_drive_variables.p_hcd_ecrh_injected_total_mw == pytest.approx( - cudrivparam.expected_p_hcd_ecrh_injected_total_mw + assert current_drive_variables.eta_cd_hcd_primary == pytest.approx( + 0.07812311, rel=1e-6 ) - assert current_drive_variables.eta_cd_norm_hcd_primary == pytest.approx( - cudrivparam.expected_gamcd + 0.48436326, rel=1e-6 ) - - assert current_drive_variables.eta_hcd_primary_injector_wall_plug == pytest.approx( - cudrivparam.expected_etacd + assert current_drive_variables.f_c_plasma_hcd_secondary == pytest.approx( + 0.0, rel=1e-6 ) - - assert current_drive_variables.p_hcd_injected_total_mw == pytest.approx( - cudrivparam.expected_p_hcd_injected_total_mw + assert current_drive_variables.p_hcd_primary_injected_mw == pytest.approx( + 38.4009309, rel=1e-6 + ) # Adjusted for extra heat + assert current_drive_variables.c_hcd_primary_driven == pytest.approx( + 3000000.0, rel=1e-6 ) - - assert current_drive_variables.eta_cd_hcd_primary == pytest.approx( - cudrivparam.expected_effcd + assert current_drive_variables.f_c_plasma_hcd_primary == pytest.approx( + 0.2, rel=1e-6 ) - - assert current_drive_variables.p_hcd_ecrh_electric_mw == pytest.approx( - cudrivparam.expected_p_hcd_ecrh_electric_mw + assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx( + 108.50232725752629, rel=1e-6 + ) # Adjusted for extra heat + assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx( + 0.0, rel=1e-6 ) - + assert current_drive_variables.p_hcd_injected_total_mw == pytest.approx( + 43.4009309, rel=1e-6 + ) # Adjusted for extra heat assert current_drive_variables.p_hcd_injected_electrons_mw == pytest.approx( - cudrivparam.expected_p_hcd_injected_electrons_mw + 43.4009309, rel=1e-6 + ) + assert current_drive_variables.p_hcd_injected_ions_mw == pytest.approx( + 0.0, rel=1e-6 ) - - assert current_drive_variables.bigq == pytest.approx(cudrivparam.expected_bigq) def test_sigbeam(current_drive): From 255258c33a95dc65eea3b8fadbd5ba9948abf4e8 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 23 Apr 2025 15:17:24 +0100 Subject: [PATCH 41/41] =?UTF-8?q?=F0=9F=94=84=20Refactor=20CurrentDrive=20?= =?UTF-8?q?initialization=20to=20instantiate=20cyclotron=20and=20beam=20cl?= =?UTF-8?q?asses=20directly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heating_and_current_drive/RF/ic_overview.md | 2 +- process/main.py | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_overview.md b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_overview.md index 09f12bcf71..581e8a3805 100644 --- a/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_overview.md +++ b/documentation/proc-pages/eng-models/heating_and_current_drive/RF/ic_overview.md @@ -1,4 +1,4 @@ -# Ion Cyclotron Heating | ``IonCyclotron` +# Ion Cyclotron Heating | `IonCyclotron` Ion cyclotron heating (ICH) is a technique used in fusion tokamaks to heat ions in a plasma by applying radio frequency (RF) waves. The RF waves used in ICH are typically in the range of tens to hundreds of megahertz. diff --git a/process/main.py b/process/main.py index 4fe34b6467..8b3c8c5312 100644 --- a/process/main.py +++ b/process/main.py @@ -682,18 +682,13 @@ def __init__(self): self.fw = Fw() self.blanket_library = BlanketLibrary(fw=self.fw) self.ccfe_hcpb = CCFE_HCPB(blanket_library=self.blanket_library) - self.electron_cyclotron = ElectronCyclotron(plasma_profile=self.plasma_profile) - self.ion_cyclotron = IonCyclotron(plasma_profile=self.plasma_profile) - self.lower_hybrid = LowerHybrid(plasma_profile=self.plasma_profile) - self.neutral_beam = NeutralBeam(plasma_profile=self.plasma_profile) - self.electron_bernstein = ElectronBernstein(plasma_profile=self.plasma_profile) self.current_drive = CurrentDrive( plasma_profile=self.plasma_profile, - electron_cyclotron=self.electron_cyclotron, - ion_cyclotron=self.ion_cyclotron, - lower_hybrid=self.lower_hybrid, - neutral_beam=self.neutral_beam, - electron_bernstein=self.electron_bernstein, + electron_cyclotron=ElectronCyclotron(plasma_profile=self.plasma_profile), + ion_cyclotron=IonCyclotron(plasma_profile=self.plasma_profile), + lower_hybrid=LowerHybrid(plasma_profile=self.plasma_profile), + neutral_beam=NeutralBeam(plasma_profile=self.plasma_profile), + electron_bernstein=ElectronBernstein(plasma_profile=self.plasma_profile), ) self.physics = Physics( plasma_profile=self.plasma_profile, current_drive=self.current_drive