Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions process/models/physics/current_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ def __init__(
def run(self):
"""This model doesn't need to be run"""

def cudriv(self):
def current_drive(self):
"""Calculate the current drive power requirements.

This method computes the power requirements of the current drive system
Expand All @@ -1588,7 +1588,6 @@ def cudriv(self):
current_drive_variables.c_beam_total = 0.0e0
current_drive_variables.p_beam_orbit_loss_mw = 0.0e0

pinjmw1 = 0.0
p_hcd_primary_ions_mw = 0.0
p_hcd_primary_electrons_mw = 0.0
p_hcd_secondary_electrons_mw = 0.0
Expand Down Expand Up @@ -1911,8 +1910,7 @@ def cudriv(self):
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)
)
) * (current_drive_variables.f_p_beam_shine_through)

# First orbit loss
current_drive_variables.p_beam_orbit_loss_mw = (
Expand Down Expand Up @@ -2113,8 +2111,7 @@ def cudriv(self):
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)
)
) * (current_drive_variables.f_p_beam_shine_through)

# First orbit loss
current_drive_variables.p_beam_orbit_loss_mw = (
Expand All @@ -2135,17 +2132,18 @@ def cudriv(self):
)

p_hcd_primary_ions_mw = (
pinjmw1 * 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_primary_electrons_mw = pinjmw1 * (
1.0e0 - current_drive_variables.f_p_beam_injected_ions
p_hcd_primary_electrons_mw = (
current_drive_variables.p_beam_plasma_coupled_mw
* (1.0e0 - current_drive_variables.f_p_beam_injected_ions)
)

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
)
) / current_drive_variables.eta_beam_injector_wall_plug

# Neutral beam wall plug power
heat_transport_variables.p_hcd_primary_electric_mw = (
Expand Down Expand Up @@ -2188,8 +2186,6 @@ def cudriv(self):
+ current_drive_variables.p_hcd_secondary_injected_mw
)

pinjmw1 = p_hcd_primary_electrons_mw + p_hcd_primary_ions_mw

# Total injected power given to electrons
current_drive_variables.p_hcd_injected_electrons_mw = (
p_hcd_primary_electrons_mw + p_hcd_secondary_electrons_mw
Expand Down
2 changes: 1 addition & 1 deletion process/models/physics/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def run(self):
# Auxiliary current drive power calculations

if current_drive_variables.i_hcd_calculations != 0:
self.current_drive.cudriv()
self.current_drive.current_drive()

# ***************************** #
# FUSION REACTIONS #
Expand Down
26 changes: 13 additions & 13 deletions tests/unit/test_current_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def current_drive():
)


def test_cudriv_primary_lower_hybrid(current_drive):
def test_current_drive_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
Expand All @@ -46,7 +46,7 @@ def test_cudriv_primary_lower_hybrid(current_drive):
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()
current_drive.current_drive()

assert current_drive_variables.eta_cd_hcd_primary == pytest.approx(
0.07812311, rel=1e-6
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_cudriv_primary_lower_hybrid(current_drive):
)


def test_cudriv_primary_lower_hybrid_with_heat(current_drive):
def test_current_drive_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
Expand All @@ -90,7 +90,7 @@ def test_cudriv_primary_lower_hybrid_with_heat(current_drive):
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()
current_drive.current_drive()

assert current_drive_variables.eta_cd_hcd_primary == pytest.approx(
0.07812311, rel=1e-6
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_sigbeam(current_drive):
) == pytest.approx(2.013589662302492e-11)


def test_cudriv_primary_neutral_beam(current_drive):
def test_current_drive_primary_neutral_beam(current_drive):
current_drive_variables.i_hcd_primary = 5 # Neutral Beam
current_drive_variables.i_hcd_secondary = 0
current_drive_variables.i_hcd_calculations = 1
Expand All @@ -146,7 +146,7 @@ def test_cudriv_primary_neutral_beam(current_drive):
physics_variables.n_charge_plasma_effective_vol_avg = 2.0
physics_variables.dlamie = 1.0
physics_variables.n_charge_plasma_effective_mass_weighted_vol_avg = 0.4
current_drive.cudriv()
current_drive.current_drive()

assert current_drive_variables.eta_cd_hcd_primary == pytest.approx(
0.050571139708731186, rel=1e-6
Expand All @@ -165,7 +165,7 @@ def test_cudriv_primary_neutral_beam(current_drive):
)
assert current_drive_variables.f_c_plasma_hcd_primary == pytest.approx(0.2, rel=1e-6)
assert heat_transport_variables.p_hcd_primary_electric_mw == pytest.approx(
59.32237274617019, rel=1e-6
197.74124248723396, rel=1e-6
)
assert heat_transport_variables.p_hcd_secondary_electric_mw == pytest.approx(
0.0, rel=1e-6
Expand All @@ -175,7 +175,7 @@ def test_cudriv_primary_neutral_beam(current_drive):
)


def test_cudriv_primary_electron_cyclotron(current_drive):
def test_current_drive_primary_electron_cyclotron(current_drive):
current_drive_variables.i_hcd_primary = 3 # Electron Cyclotron
current_drive_variables.i_hcd_secondary = 0
current_drive_variables.i_hcd_calculations = 1
Expand All @@ -189,7 +189,7 @@ def test_cudriv_primary_electron_cyclotron(current_drive):
current_drive_variables.eta_ecrh_injector_wall_plug = 0.5
physics_variables.dlamee = 1.0
physics_variables.temp_plasma_electron_density_weighted_kev = 10.0
current_drive.cudriv()
current_drive.current_drive()

assert current_drive_variables.eta_cd_hcd_primary == pytest.approx(
0.33870967741935487, rel=1e-6
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_cudriv_primary_electron_cyclotron(current_drive):
)


def test_cudriv_primary_ion_cyclotron(current_drive):
def test_current_drive_primary_ion_cyclotron(current_drive):
current_drive_variables.i_hcd_primary = 2 # Ion Cyclotron
current_drive_variables.i_hcd_secondary = 0
current_drive_variables.i_hcd_calculations = 1
Expand All @@ -235,7 +235,7 @@ def test_cudriv_primary_ion_cyclotron(current_drive):
current_drive_variables.eta_icrh_injector_wall_plug = 0.35
physics_variables.n_charge_plasma_effective_vol_avg = 2.0
physics_variables.temp_plasma_electron_density_weighted_kev = 10.0
current_drive.cudriv()
current_drive.current_drive()

assert current_drive_variables.eta_cd_hcd_primary == pytest.approx(
0.025403225806451612, rel=1e-6
Expand Down Expand Up @@ -264,7 +264,7 @@ def test_cudriv_primary_ion_cyclotron(current_drive):
)


def test_cudriv_primary_electron_bernstein(current_drive):
def test_current_drive_primary_electron_bernstein(current_drive):
current_drive_variables.i_hcd_primary = 12 # Electron Bernstein
current_drive_variables.i_hcd_secondary = 0
current_drive_variables.i_hcd_calculations = 1
Expand All @@ -283,7 +283,7 @@ def test_cudriv_primary_electron_bernstein(current_drive):
constants.ELECTRON_CHARGE = constants.ELECTRON_CHARGE
constants.ELECTRON_MASS = constants.ELECTRON_MASS
constants.EPSILON0 = constants.EPSILON0
current_drive.cudriv()
current_drive.current_drive()

assert current_drive_variables.eta_cd_hcd_primary == pytest.approx(
0.011640447389800388, rel=1e-6
Expand Down
Loading