Skip to content

Commit

Permalink
Rename 'betap' to 'beta_poloidal' in BootstrapFraction parameter clas…
Browse files Browse the repository at this point in the history
…ses for clarity to account for new bootstrap scalings
  • Loading branch information
chris-ashe committed Nov 14, 2024
1 parent 9cea2e0 commit be43a4e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
48 changes: 24 additions & 24 deletions process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ def physics(self):
current_drive_variables.bscf_aries = (
current_drive_variables.cboot
* self.bootstrap_fraction_aries(
betap=physics_variables.betap,
beta_poloidal=physics_variables.beta_poloidal,
rli=physics_variables.rli,
core_density=physics_variables.ne0,
average_density=physics_variables.dene,
Expand All @@ -1789,7 +1789,7 @@ def physics(self):
current_drive_variables.bscf_andrade = (
current_drive_variables.cboot
* self.bootstrap_fraction_andrade(
betap=physics_variables.betap,
beta_poloidal=physics_variables.beta_poloidal,
core_pressure=physics_variables.p0,
average_pressure=physics_variables.vol_avg_pressure,
inverse_aspect=physics_variables.eps,
Expand All @@ -1798,7 +1798,7 @@ def physics(self):
current_drive_variables.bscf_hoang = (
current_drive_variables.cboot
* self.bootstrap_fraction_hoang(
betap=physics_variables.betap,
beta_poloidal=physics_variables.beta_poloidal,
pressure_index=physics_variables.alphap,
current_index=physics_variables.alphaj,
inverse_aspect=physics_variables.eps,
Expand All @@ -1807,7 +1807,7 @@ def physics(self):
current_drive_variables.bscf_wong = (
current_drive_variables.cboot
* self.bootstrap_fraction_wong(
betap=physics_variables.betap,
beta_poloidal=physics_variables.beta_poloidal,
density_index=physics_variables.alphan,
temperature_index=physics_variables.alphat,
inverse_aspect=physics_variables.eps,
Expand All @@ -1817,7 +1817,7 @@ def physics(self):
current_drive_variables.bscf_gi_I = (
current_drive_variables.cboot
* self.bootstrap_fraction_gi_I(
betap=physics_variables.betap,
beta_poloidal=physics_variables.beta_poloidal,
pressure_index=physics_variables.alphap,
temperature_index=physics_variables.alphat,
inverse_aspect=physics_variables.eps,
Expand All @@ -1830,7 +1830,7 @@ def physics(self):
current_drive_variables.bscf_gi_II = (
current_drive_variables.cboot
* self.bootstrap_fraction_gi_II(
betap=physics_variables.betap,
beta_poloidal=physics_variables.beta_poloidal,
pressure_index=physics_variables.alphap,
temperature_index=physics_variables.alphat,
inverse_aspect=physics_variables.eps,
Expand Down Expand Up @@ -5990,7 +5990,7 @@ def bootstrap_fraction_sakai(

@staticmethod
def bootstrap_fraction_aries(
betap: float,
beta_poloidal: float,
rli: float,
core_density: float,
average_density: float,
Expand All @@ -6000,7 +6000,7 @@ def bootstrap_fraction_aries(
Calculate the bootstrap fraction using the ARIES formula.
Parameters:
betap (float): Plasma poloidal beta.
beta_poloidal (float): Plasma poloidal beta.
rli (float): Plasma normalized internal inductance.
core_density (float): Core plasma density.
average_density (float): Average plasma density.
Expand All @@ -6024,11 +6024,11 @@ def bootstrap_fraction_aries(

c_bs = a_1 + b_1 * (core_density / average_density)

return c_bs * np.sqrt(inverse_aspect) * betap
return c_bs * np.sqrt(inverse_aspect) * beta_poloidal

@staticmethod
def bootstrap_fraction_andrade(
betap: float,
beta_poloidal: float,
core_pressure: float,
average_pressure: float,
inverse_aspect: float,
Expand All @@ -6037,7 +6037,7 @@ def bootstrap_fraction_andrade(
Calculate the bootstrap fraction using the Andrade et al formula.
Parameters:
betap (float): Plasma poloidal beta.
beta_poloidal (float): Plasma poloidal beta.
core_pressure (float): Core plasma pressure.
average_pressure (float): Average plasma pressure.
inverse_aspect (float): Inverse aspect ratio.
Expand All @@ -6064,11 +6064,11 @@ def bootstrap_fraction_andrade(
# Error +- 0.0007
c_bs = 0.2340

return c_bs * np.sqrt(inverse_aspect) * betap * c_p**0.8
return c_bs * np.sqrt(inverse_aspect) * beta_poloidal * c_p**0.8

@staticmethod
def bootstrap_fraction_hoang(
betap: float,
beta_poloidal: float,
pressure_index: float,
current_index: float,
inverse_aspect: float,
Expand All @@ -6077,7 +6077,7 @@ def bootstrap_fraction_hoang(
Calculate the bootstrap fraction using the Hoang et al formula.
Parameters:
betap (float): Plasma poloidal beta.
beta_poloidal (float): Plasma poloidal beta.
pressure_index (float): Pressure profile index.
current_index (float): Current profile index.
inverse_aspect (float): Inverse aspect ratio.
Expand Down Expand Up @@ -6110,11 +6110,11 @@ def bootstrap_fraction_hoang(

c_bs = np.sqrt((pressure_index + 1) / (current_index + 1))

return 0.4 * np.sqrt(inverse_aspect) * betap**0.9 * c_bs
return 0.4 * np.sqrt(inverse_aspect) * beta_poloidal**0.9 * c_bs

@staticmethod
def bootstrap_fraction_wong(
betap: float,
beta_poloidal: float,
density_index: float,
temperature_index: float,
inverse_aspect: float,
Expand All @@ -6124,7 +6124,7 @@ def bootstrap_fraction_wong(
Calculate the bootstrap fraction using the Wong et al formula.
Parameters:
betap (float): Plasma poloidal beta.
beta_poloidal (float): Plasma poloidal beta.
density_index (float): Density profile index.
temperature_index (float): Temperature profile index.
inverse_aspect (float): Inverse aspect ratio.
Expand Down Expand Up @@ -6153,11 +6153,11 @@ def bootstrap_fraction_wong(

c_bs = 0.773 + 0.019 * elongation

return c_bs * f_peak**0.25 * betap * np.sqrt(inverse_aspect)
return c_bs * f_peak**0.25 * beta_poloidal * np.sqrt(inverse_aspect)

@staticmethod
def bootstrap_fraction_gi_I(
betap: float,
beta_poloidal: float,
pressure_index: float,
temperature_index: float,
inverse_aspect: float,
Expand All @@ -6169,7 +6169,7 @@ def bootstrap_fraction_gi_I(
Calculate the bootstrap fraction using the first scaling from the Gi et al formula.
Parameters:
betap (float): Plasma poloidal beta.
beta_poloidal (float): Plasma poloidal beta.
pressure_index (float): Pressure profile index.
temperature_index (float): Temperature profile index.
inverse_aspect (float): Inverse aspect ratio.
Expand Down Expand Up @@ -6207,11 +6207,11 @@ def bootstrap_fraction_gi_I(
* (q95 / q0) ** -0.133
)

return c_bs * np.sqrt(inverse_aspect) * betap
return c_bs * np.sqrt(inverse_aspect) * beta_poloidal

@staticmethod
def bootstrap_fraction_gi_II(
betap: float,
beta_poloidal: float,
pressure_index: float,
temperature_index: float,
inverse_aspect: float,
Expand All @@ -6221,7 +6221,7 @@ def bootstrap_fraction_gi_II(
Calculate the bootstrap fraction using the second scaling from the Gi et al formula.
Parameters:
betap (float): Plasma poloidal beta.
beta_poloidal (float): Plasma poloidal beta.
pressure_index (float): Pressure profile index.
temperature_index (float): Temperature profile index.
inverse_aspect (float): Inverse aspect ratio.
Expand Down Expand Up @@ -6256,7 +6256,7 @@ def bootstrap_fraction_gi_II(
* effective_charge**0.178
)

return c_bs * np.sqrt(inverse_aspect) * betap
return c_bs * np.sqrt(inverse_aspect) * beta_poloidal

def fhfac(self, is_):
"""Function to find H-factor for power balance
Expand Down
36 changes: 18 additions & 18 deletions tests/unit/test_physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def test_bootstrap_fraction_sakai(bootstrapfractionsakaiparam, monkeypatch, phys


class BootstrapFractionAriesParam(NamedTuple):
betap: Any = None
beta_poloidal: Any = None

rli: Any = None

Expand All @@ -586,7 +586,7 @@ class BootstrapFractionAriesParam(NamedTuple):
"bootstrapfractionariesparam",
(
BootstrapFractionAriesParam(
betap=1.2708883332338736,
beta_poloidal=1.2708883332338736,
rli=1.4279108047138775,
core_density=1.0695994460047332e20,
average_density=8.1317358967210131e19,
Expand All @@ -606,7 +606,7 @@ def test_bootstrap_fraction_aries(bootstrapfractionariesparam, physics):
"""

bfs = physics.bootstrap_fraction_aries(
betap=bootstrapfractionariesparam.betap,
beta_poloidal=bootstrapfractionariesparam.beta_poloidal,
rli=bootstrapfractionariesparam.rli,
core_density=bootstrapfractionariesparam.core_density,
average_density=bootstrapfractionariesparam.average_density,
Expand All @@ -617,7 +617,7 @@ def test_bootstrap_fraction_aries(bootstrapfractionariesparam, physics):


class BootstrapFractionAndradeParam(NamedTuple):
betap: Any = None
beta_poloidal: Any = None

core_pressure: Any = None

Expand All @@ -632,7 +632,7 @@ class BootstrapFractionAndradeParam(NamedTuple):
"bootstrapfractionandradeparam",
(
BootstrapFractionAndradeParam(
betap=1.2708883332338736,
beta_poloidal=1.2708883332338736,
core_pressure=8.3049163275475602e05,
average_pressure=2.4072221239268288e05,
inverse_aspect=1 / 3,
Expand All @@ -651,7 +651,7 @@ def test_bootstrap_fraction_andrade(bootstrapfractionandradeparam, physics):
"""

bfs = physics.bootstrap_fraction_andrade(
betap=bootstrapfractionandradeparam.betap,
beta_poloidal=bootstrapfractionandradeparam.beta_poloidal,
core_pressure=bootstrapfractionandradeparam.core_pressure,
average_pressure=bootstrapfractionandradeparam.average_pressure,
inverse_aspect=bootstrapfractionandradeparam.inverse_aspect,
Expand All @@ -661,7 +661,7 @@ def test_bootstrap_fraction_andrade(bootstrapfractionandradeparam, physics):


class BootstrapFractionHoangParam(NamedTuple):
betap: Any = None
beta_poloidal: Any = None

pressure_index: Any = None

Expand All @@ -676,7 +676,7 @@ class BootstrapFractionHoangParam(NamedTuple):
"bootstrapfractionhoangparam",
(
BootstrapFractionHoangParam(
betap=1.2708883332338736,
beta_poloidal=1.2708883332338736,
pressure_index=2.4500000000000002e00,
current_index=2.8314361644755763e00,
inverse_aspect=1 / 3,
Expand All @@ -695,7 +695,7 @@ def test_bootstrap_fraction_hoang(bootstrapfractionhoangparam, physics):
"""

bfs = physics.bootstrap_fraction_hoang(
betap=bootstrapfractionhoangparam.betap,
beta_poloidal=bootstrapfractionhoangparam.beta_poloidal,
pressure_index=bootstrapfractionhoangparam.pressure_index,
current_index=bootstrapfractionhoangparam.current_index,
inverse_aspect=bootstrapfractionhoangparam.inverse_aspect,
Expand All @@ -705,7 +705,7 @@ def test_bootstrap_fraction_hoang(bootstrapfractionhoangparam, physics):


class BootstrapFractionWongParam(NamedTuple):
betap: Any = None
beta_poloidal: Any = None

density_index: Any = None

Expand All @@ -722,7 +722,7 @@ class BootstrapFractionWongParam(NamedTuple):
"bootstrapfractionwongparam",
(
BootstrapFractionWongParam(
betap=1.2708883332338736,
beta_poloidal=1.2708883332338736,
density_index=1.0000000000000000e00,
temperature_index=1.4500000000000000e00,
inverse_aspect=1 / 3,
Expand All @@ -742,7 +742,7 @@ def test_bootstrap_fraction_wong(bootstrapfractionwongparam, physics):
"""

bfs = physics.bootstrap_fraction_wong(
betap=bootstrapfractionwongparam.betap,
beta_poloidal=bootstrapfractionwongparam.beta_poloidal,
density_index=bootstrapfractionwongparam.density_index,
temperature_index=bootstrapfractionwongparam.temperature_index,
inverse_aspect=bootstrapfractionwongparam.inverse_aspect,
Expand All @@ -753,7 +753,7 @@ def test_bootstrap_fraction_wong(bootstrapfractionwongparam, physics):


class BootstrapFractionGiIParam(NamedTuple):
betap: Any = None
beta_poloidal: Any = None

pressure_index: Any = None

Expand All @@ -774,7 +774,7 @@ class BootstrapFractionGiIParam(NamedTuple):
"bootstrapfractiongiiparam",
(
BootstrapFractionGiIParam(
betap=1.2708883332338736,
beta_poloidal=1.2708883332338736,
pressure_index=2.4500000000000002e00,
temperature_index=1.4500000000000000e00,
inverse_aspect=1 / 3,
Expand All @@ -796,7 +796,7 @@ def test_bootstrap_fraction_gi_I(bootstrapfractiongiiparam, physics):
"""

bfs = physics.bootstrap_fraction_gi_I(
betap=bootstrapfractiongiiparam.betap,
beta_poloidal=bootstrapfractiongiiparam.beta_poloidal,
pressure_index=bootstrapfractiongiiparam.pressure_index,
temperature_index=bootstrapfractiongiiparam.temperature_index,
inverse_aspect=bootstrapfractiongiiparam.inverse_aspect,
Expand All @@ -809,7 +809,7 @@ def test_bootstrap_fraction_gi_I(bootstrapfractiongiiparam, physics):


class BootstrapFractionGiIIParam(NamedTuple):
betap: Any = None
beta_poloidal: Any = None

pressure_index: Any = None

Expand All @@ -826,7 +826,7 @@ class BootstrapFractionGiIIParam(NamedTuple):
"bootstrapfractiongiiiparam",
(
BootstrapFractionGiIIParam(
betap=1.2708883332338736,
beta_poloidal=1.2708883332338736,
pressure_index=2.4500000000000002e00,
temperature_index=1.4500000000000000e00,
inverse_aspect=1 / 3,
Expand All @@ -846,7 +846,7 @@ def test_bootstrap_fraction_gi_II(bootstrapfractiongiiiparam, physics):
"""

bfs = physics.bootstrap_fraction_gi_II(
betap=bootstrapfractiongiiiparam.betap,
beta_poloidal=bootstrapfractiongiiiparam.beta_poloidal,
pressure_index=bootstrapfractiongiiiparam.pressure_index,
temperature_index=bootstrapfractiongiiiparam.temperature_index,
inverse_aspect=bootstrapfractiongiiiparam.inverse_aspect,
Expand Down

0 comments on commit be43a4e

Please sign in to comment.