freegsnke.passive_structure module

Implements the FreeGSNKE object used to deal with extended vessel structures. Current is distributed uniformly over each extended structure.

Copyright 2025 UKAEA, UKRI-STFC, and The Authors, as per the COPYRIGHT and README files.

This file is part of FreeGSNKE.

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.

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.

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

class freegsnke.passive_structure.PassiveStructure(R, Z, min_refine_per_area, min_refine_per_length, refine_mode='G')[source]

Bases: Coil

Inherits from freegs4e.coil.Coil. Object to implement passive structures. Rather than listing large number of filaments it averages the relevant green functions so that currents are distributed over the structure – uniformly.

__init__(R, Z, min_refine_per_area, min_refine_per_length, refine_mode='G')[source]

Instantiates the object and builds the refinement of the provided polygonal shape.

Parameters:
  • R (array) – List of vertex coordinates, defining a passive structure polygon.

  • Z (array) – List of vertex coordinates, defining a passive structure polygon.

  • refine_mode (str, optional) – refinement mode for passive structures inputted as polygons, by default ‘G’ for ‘grid’ Use ‘LH’ for alternative mode using a Latin Hypercube implementation.

build_control_br(R, Z)[source]

Builds controlBr for a new set of R, Z grids.

Parameters:
  • R (array) – Grid on which to calculate the greens, i.e. eq.R

  • Z (array) – Grid on which to calculate the greens, i.e. eq.Z

build_control_bz(R, Z)[source]

Builds controlBz for a new set of R, Z grids.

Parameters:
  • R (array) – Grid on which to calculate the greens, i.e. eq.R

  • Z (array) – Grid on which to calculate the greens, i.e. eq.Z

build_control_psi(R, Z)[source]

Builds controlPsi for a new set of R, Z grids.

Parameters:
  • R (array) – Grid on which to calculate the greens, i.e. eq.R

  • Z (array) – Grid on which to calculate the greens, i.e. eq.Z

build_refining_filaments()[source]

Builds the grid used for the refinement

controlBr(R, Z)[source]

Retrieve Br at (R,Z) due to a unit current or calculate where necessary.

controlBz(R, Z)[source]

Retrieve Bz at (R,Z) due to a unit current or calculate where necessary.

controlPsi(R, Z)[source]

Retrieve poloidal flux at (R,Z) due to a unit current or calculate where necessary.

create_RZ_key(R, Z)[source]

Produces tuple (Rmin,Rmax,Zmin,Zmax,nx,ny) to access correct dictionary entry of greens function.

Parameters:
  • R (array) – eq.R, radial coordinate on the domain grid

  • Z (array) – eq.Z, radial coordinate on the domain grid

plot(axis=None, show=False)[source]

Plot the passive structure polygon