Skip to content

Commit

Permalink
tokamak: Ignore missing psi_bdry in ffprime and pprime functions
Browse files Browse the repository at this point in the history
Used to detect when outside the core plasma. Test cases have no
X-points so no psi_bdry.
  • Loading branch information
bendudson committed Jul 31, 2024
1 parent 88a8d38 commit 642e0d0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions hypnotoad/cases/tokamak.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,8 +1715,11 @@ def fpolprime(self, psi):
"""psi-derivative of fpol
Note: Zero outside core."""
fprime = self.fprime_spl(psi * self.f_psi_sign)
psinorm = (psi - self.psi_axis) / (self.psi_bdry - self.psi_axis)
fprime[psinorm > 1.0] = 0.0
try:
psinorm = (psi - self.psi_axis) / (self.psi_bdry - self.psi_axis)
fprime[psinorm > 1.0] = 0.0
except:
pass
return fprime

@Equilibrium.handleMultiLocationArray
Expand All @@ -1733,8 +1736,11 @@ def pprime(self, psi):
if self.pprime_spl is None:
return None
pprime = self.pprime_spl(psi * self.f_psi_sign)
psinorm = (psi - self.psi_axis) / (self.psi_bdry - self.psi_axis)
pprime[psinorm > 1.0] = 0.0
try:
psinorm = (psi - self.psi_axis) / (self.psi_bdry - self.psi_axis)
pprime[psinorm > 1.0] = 0.0
except:
pass
return pprime

@property
Expand Down

0 comments on commit 642e0d0

Please sign in to comment.