Skip to content
Merged
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
18 changes: 6 additions & 12 deletions process/models/physics/current_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1908,11 +1908,10 @@ def current_drive(self):
# Calculate the dimensionless current drive efficiency for
# the primary heating method (ζ)
self.data.current_drive.eta_cd_dimensionless_hcd_primary = self.calculate_dimensionless_current_drive_efficiency( # noqa: E501
eta_cd_hcd=self.data.current_drive.eta_cd_hcd_primary,
nd_plasma_electrons_vol_avg=self.data.physics.nd_plasma_electrons_vol_avg,
rmajor=self.data.physics.rmajor,
temp_plasma_electron_vol_avg_kev=self.data.physics.temp_plasma_electron_vol_avg_kev,
c_hcd_driven=self.data.current_drive.c_hcd_primary_driven,
p_hcd_injected=self.data.current_drive.p_hcd_primary_injected_mw * 1.0e6,
)

if self.data.current_drive.p_hcd_secondary_injected_mw > 0.0:
Expand All @@ -1922,9 +1921,7 @@ def current_drive(self):
nd_plasma_electrons_vol_avg=self.data.physics.nd_plasma_electrons_vol_avg,
rmajor=self.data.physics.rmajor,
temp_plasma_electron_vol_avg_kev=self.data.physics.temp_plasma_electron_vol_avg_kev,
c_hcd_driven=self.data.current_drive.c_hcd_secondary_driven,
p_hcd_injected=self.data.current_drive.p_hcd_secondary_injected_mw
* 1.0e6,
eta_cd_hcd=self.data.current_drive.eta_cd_hcd_secondary,
)

# ===========================================================
Expand Down Expand Up @@ -2383,11 +2380,10 @@ def calculate_normalised_current_drive_efficiency(

@staticmethod
def calculate_dimensionless_current_drive_efficiency(
eta_cd_hcd: float,
nd_plasma_electrons_vol_avg: float,
rmajor: float,
temp_plasma_electron_vol_avg_kev: float,
c_hcd_driven: float,
p_hcd_injected: float,
) -> float:
"""Calculate the dimensionless current drive efficiency, ζ.

Expand All @@ -2402,10 +2398,8 @@ def calculate_dimensionless_current_drive_efficiency(
Major radius of the plasma in meters.
temp_plasma_electron_vol_avg_kev:
Volume averaged electron temperature in keV.
c_hcd_driven:
Current driven by the heating and current drive system.
p_hcd_injected:
Power injected by the heating and current drive system.
eta_cd_hcd
Absolute current drive efficiency in A/W.

Returns
-------
Expand All @@ -2428,7 +2422,7 @@ def calculate_dimensionless_current_drive_efficiency(
(nd_plasma_electrons_vol_avg * rmajor)
/ (temp_plasma_electron_vol_avg_kev * constants.KILOELECTRON_VOLT)
)
* (c_hcd_driven / p_hcd_injected)
* eta_cd_hcd
)

def output(self):
Expand Down
24 changes: 11 additions & 13 deletions tests/unit/models/physics/test_current_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,38 +315,36 @@ def test_current_drive_primary_electron_bernstein(current_drive):

@pytest.mark.parametrize(
(
"eta_cd_hcd",
"nd_plasma_electrons_vol_avg",
"rmajor",
"temp_plasma_electron_vol_avg_kev",
"c_hcd_driven",
"p_hcd_injected",
),
[
(1e20, 1.0, 1.0, 1.0, 1.0),
(0.05, 1e20, 1.0, 1.0),
],
)
def test_calculate_dimensionless_current_drive_efficiency_simple(
eta_cd_hcd,
nd_plasma_electrons_vol_avg,
rmajor,
temp_plasma_electron_vol_avg_kev,
c_hcd_driven,
p_hcd_injected,
current_drive,
):
cd = current_drive
expected = (
(constants.ELECTRON_CHARGE**3 / constants.EPSILON0**2)
* (
(nd_plasma_electrons_vol_avg * rmajor)
/ (temp_plasma_electron_vol_avg_kev * constants.KILOELECTRON_VOLT)
)
* (c_hcd_driven / p_hcd_injected)
* eta_cd_hcd
)
result = cd.calculate_dimensionless_current_drive_efficiency(
nd_plasma_electrons_vol_avg,
rmajor,
temp_plasma_electron_vol_avg_kev,
c_hcd_driven,
p_hcd_injected,

result = current_drive.calculate_dimensionless_current_drive_efficiency(
eta_cd_hcd=eta_cd_hcd,
nd_plasma_electrons_vol_avg=nd_plasma_electrons_vol_avg,
rmajor=rmajor,
temp_plasma_electron_vol_avg_kev=temp_plasma_electron_vol_avg_kev,
)

assert result == pytest.approx(expected, rel=1e-12)
Loading