-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from bendudson/bugfix-example-5
Bugfix example 5
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from . import equilibrium | ||
from . import boundary | ||
from . import jtor | ||
from . import picard | ||
|
||
def test_fixed_boundary_psi(): | ||
# This is adapted from example 5 | ||
|
||
profiles = jtor.ConstrainPaxisIp(1e3, # Plasma pressure on axis [Pascals] | ||
1e5, # Plasma current [Amps] | ||
1.0) # fvac = R*Bt | ||
|
||
eq = equilibrium.Equilibrium(Rmin=0.1, Rmax=2.0, | ||
Zmin=-1.0, Zmax=1.0, | ||
nx=65, ny=65, | ||
boundary=boundary.fixedBoundary) | ||
# Nonlinear solve | ||
picard.solve(eq, profiles) | ||
|
||
psi = eq.psi() | ||
assert psi[0,0] == 0.0 # Boundary is fixed | ||
assert psi[32,32] != 0.0 # Solution is not all zero | ||
|
||
assert eq.psi_bndry == 0.0 | ||
assert eq.poloidalBeta() > 0.0 |