freegsnke.boundary module

Functions to impose boundary conditions on psi(plasma)

Copyright 2016 Ben Dudson, University of York. Email: benjamin.dudson@york.ac.uk

This file is part of FreeGSNKE.

FreeGSNKE is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

FreeGSNKE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with FreeGSNKE. If not, see <http://www.gnu.org/licenses/>.

freegsnke.boundary.fixedBoundary(eq: object, Jtor: ndarray, psi: ndarray) → None[source]

Set psi=0 on all boundaries.

Parameters:
  • eq (object) – Equilibrium object; not used.

  • Jtor (np.ndarray) – Toroidal current density, shape (nx, ny) (not used).

  • psi (np.ndarray) – Poloidal flux, shape (nx, ny). Boundary values are modified in place.

freegsnke.boundary.freeBoundary(eq: object, Jtor: ndarray, psi: ndarray) → None[source]

Apply a free boundary condition using Green’s functions.

Note: this method is inefficient because it requires an integral over the area of the domain for each point on the boundary.

Parameters:
  • eq (object) – Equilibrium object; provides the grid R and Z (shape (nx, ny)).

  • Jtor (np.ndarray) – Toroidal current density, shape (nx, ny).

  • psi (np.ndarray) – Poloidal flux, shape (nx, ny). Boundary values are modified in place.

freegsnke.boundary.freeBoundaryHagenow(eq: object, Jtor: ndarray, psi: ndarray) → None[source]

Apply a free boundary condition using von Hagenow’s method.

A fixed-boundary problem is solved first; the boundary values of psi are then obtained from loop integrals of the normal derivative at the boundary.

Parameters:
  • eq (object) – Equilibrium object; provides R, Z and the callSolver method.

  • Jtor (np.ndarray) – Toroidal current density, shape (nx, ny).

  • psi (np.ndarray) – Poloidal flux, shape (nx, ny). Boundary values are modified in place.