Skip to content

Commit

Permalink
✨ Add Menard NSTX-Petty08 hybrid confinement time calculation and upd…
Browse files Browse the repository at this point in the history
…ate Petty scaling references in documentation
  • Loading branch information
chris-ashe committed Jan 22, 2025
1 parent 769ead9 commit b93fa65
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 71 deletions.
18 changes: 16 additions & 2 deletions documentation/proc-pages/physics-models/plasma_confinement.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ $$

-------------------------

### 41: Petty H-mode scaling
### 41: Petty08 H-mode scaling

Is selected with `i_confinement_time = 41`

Expand Down Expand Up @@ -460,7 +460,6 @@ $$

-------------------------

-------------------------

### 46: Menard NSTX H-mode scaling

Expand All @@ -472,6 +471,21 @@ $$

-------------------------

### 47: Menard NSTX-Petty08 hybrid scaling

Is selected with `i_confinement_time = 47`

- If $\epsilon \le 0.4 \ (A \ge 2.5)$ apply the [Petty08 scaling](#41-petty-h-mode-scaling)
- If $\epsilon \ge 0.6 \ (A \le 1.7)$ apply the [Menard NSTX scaling](#46-menard-nstx-h-mode-scaling)

Otherwise:

$$
\tau_{\text{E}} = \frac{\epsilon - 0.4}{0.2}\tau_{\text{E,NSTX}}+ \frac{0.6-\epsilon}{0.2}\tau_{\text{E,Petty08}}
$$

-------------------------

| `i_confinement_time` | scaling law | reference |
| :-: | - | - |
| 1 | Neo-Alcator (ohmic) | [^1] |
Expand Down
90 changes: 87 additions & 3 deletions process/confinement_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ def murari_confinement_time(
)


def petty_confinement_time(
def petty08_confinement_time(
pcur: float,
bt: float,
dnla19: float,
Expand All @@ -1484,7 +1484,7 @@ def petty_confinement_time(
aspect: float,
) -> float:
"""
Calculate the beta independent dimensionless Petty confinement scaling time
Calculate the beta independent dimensionless Petty08 confinement time
Parameters:
pcur (float): Plasma current [MA]
Expand All @@ -1496,7 +1496,7 @@ def petty_confinement_time(
aspect (float): Aspect ratio
Returns:
float: Petty confinement time [s]
float: Petty08 confinement time [s]
Notes:
- This scaling uses the IPB defintiion of elongation, see reference for more information.
Expand Down Expand Up @@ -1660,5 +1660,89 @@ def menard_nstx_confinement_time(
)


def menard_nstx_petty08_hybrid_confinement_time(
pcur: float,
bt: float,
dnla19: float,
powerht: float,
rmajor: float,
kappa_ipb: float,
aspect: float,
afuel: float,
) -> float:
"""
Calculate the Menard NSTX-Petty hybrid confinement time
Parameters:
pcur (float): Plasma current [MA]
bt (float): Toroidal magnetic field [T]
dnla19 (float): Line averaged electron density in units of 10**19 m**-3
powerht (float): Net Heating power [MW]
rmajor (float): Plasma major radius [m]
kappa_ipb (float): IPB specific plasma separatrix elongation
aspect (float): Aspect ratio
afuel (float): Fuel atomic mass number
Returns:
float: Menard NSTX-Petty hybrid confinement time [s]
Notes:
- Assuming a linear interpolation in (1/aspect) between the two scalings
References:
- J. E. Menard, “Compact steady-state tokamak performance dependence on magnet and core physics limits,”
Philosophical Transactions of the Royal Society A, vol. 377, no. 2141, pp. 20170440–20170440, Feb. 2019,
doi: https://doi.org/10.1098/rsta.2017.0440.
"""
# Equivalent to A > 2.5, use Petty scaling
if (1.0e0 / aspect) <= 0.4e0:
return petty08_confinement_time(
pcur,
bt,
dnla19,
powerht,
rmajor,
kappa_ipb,
aspect,
)

# Equivalent to A < 1.7, use NSTX scaling
elif (1.0e0 / aspect) >= 0.6e0:
return menard_nstx_confinement_time(
pcur,
bt,
dnla19,
powerht,
rmajor,
kappa_ipb,
aspect,
afuel,
)
else:
return (((1.0e0 / aspect) - 0.4e0) / (0.6e0 - 0.4e0)) * (
menard_nstx_confinement_time(
pcur,
bt,
dnla19,
powerht,
rmajor,
kappa_ipb,
aspect,
afuel,
)
) + ((0.6e0 - (1.0e0 / aspect)) / (0.6e0 - 0.4e0)) * (
petty08_confinement_time(
pcur,
bt,
dnla19,
powerht,
rmajor,
kappa_ipb,
aspect,
)
)


if __name__ == "__main__":
pass
75 changes: 14 additions & 61 deletions process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7143,9 +7143,9 @@ def pcond(

# ==========================================================================

# Petty, beta independent dimensionless scaling
# Petty08, beta independent dimensionless scaling
elif i_confinement_time == 41:
tauee = hfact * confinement.petty_confinement_time(
tauee = hfact * confinement.petty08_confinement_time(
pcur,
bt,
dnla19,
Expand Down Expand Up @@ -7230,65 +7230,18 @@ def pcond(

# ==========================================================================

elif i_confinement_time == 47: # NSTX-Petty08 Hybrid
# Linear interpolation between NSTX and Petty08 in eps
# Menard 2019, Phil. Trans. R. Soc. A 377:20170440
if (1.0e0 / aspect) <= 0.4e0:
# Petty08, i.e. case (41)
tauee = (
hfact
* 0.052e0
* pcur**0.75e0
* bt**0.3e0
* dnla19**0.32e0
* powerht ** (-0.47e0)
* rmajor**2.09e0
* kappaa**0.88e0
* aspect ** (-0.84e0)
)

elif (1.0e0 / aspect) >= 0.6e0:
# NSTX, i.e.case (46)
tauee = (
hfact
* 0.095e0
* pcur**0.57e0
* bt**1.08e0
* dnla19**0.44e0
* powerht ** (-0.73e0)
* rmajor**1.97e0
* physics_variables.kappa_ipb**0.78e0
* aspect ** (-0.58e0)
* afuel**0.19e0
)

else:
taupetty = (
0.052e0
* pcur**0.75e0
* bt**0.3e0
* dnla19**0.32e0
* powerht ** (-0.47e0)
* rmajor**2.09e0
* kappaa**0.88e0
* aspect ** (-0.84e0)
)
taunstx = (
0.095e0
* pcur**0.57e0
* bt**1.08e0
* dnla19**0.44e0
* powerht ** (-0.73e0)
* rmajor**1.97e0
* physics_variables.kappa_ipb**0.78e0
* aspect ** (-0.58e0)
* afuel**0.19e0
)

tauee = hfact * (
(((1.0e0 / aspect) - 0.4e0) / (0.6e0 - 0.4e0)) * taunstx
+ ((0.6e0 - (1.0e0 / aspect)) / (0.6e0 - 0.4e0)) * taupetty
)
# Menard NSTX-Petty08 Hybrid
elif i_confinement_time == 47:
tauee = hfact * confinement.menard_nstx_petty08_hybrid_confinement_time(
pcur,
bt,
dnla19,
powerht,
rmajor,
physics_variables.kappa_ipb,
aspect,
afuel,
)

# ==========================================================================

Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2924,11 +2924,11 @@ class PcondParam(NamedTuple):
zeff=2.4987360098030775,
expected_kappaa_ipb=1.68145080681586,
expected_kappaa=1.7187938085542791,
expected_ptrepv=0.070108167457759038,
expected_ptripv=0.062223069561580698,
expected_tauee=3.7969687288631331,
expected_tauei=3.7969687288631331,
expected_taueff=3.7969687288631335,
expected_ptrepv=0.07147653259174333,
expected_ptripv=0.06343753403847416,
expected_tauee=3.7242785823911264,
expected_tauei=3.7242785823911264,
expected_taueff=3.7242785823911264,
expected_powerht=290.18368660937881,
),
),
Expand Down

0 comments on commit b93fa65

Please sign in to comment.