Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Toroidal Flux Objective for Finite Beta Equilibria #1159

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
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: 2 additions & 16 deletions desc/objectives/_coils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,8 @@ class ToroidalFlux(_Objective):
a vacuum equilibrium, to avoid the trivial solution of minimizing Bn
by making the coil currents zero. Instead, this objective ensures
the coils create the necessary toroidal flux for the equilibrium field.
It is also useful for finite beta to ensure the proper toroidal flux
is created even when there is nonzero residual normal field error.

Parameters
----------
Expand Down Expand Up @@ -1416,22 +1418,6 @@ def build(self, use_jit=True, verbose=1):
if self._normalize:
self._normalization = eq.Psi

# ensure vacuum eq, as is unneeded for finite beta
pres = np.max(np.abs(eq.compute("p")["p"]))
curr = np.max(np.abs(eq.compute("current")["current"]))
warnif(
pres > 1e-8,
UserWarning,
f"Pressure appears to be non-zero (max {pres} Pa), "
+ "this objective is unneeded at finite beta.",
)
warnif(
curr > 1e-8,
UserWarning,
f"Current appears to be non-zero (max {curr} A), "
+ "this objective is unneeded at finite beta.",
)

# eval_grid.num_nodes for quad flux cost,
self._dim_f = 1
timer = Timer()
Expand Down
Loading