polar_operators_m Module

Implementation of polar operators, i.e. - map from Cartesian to Polar mesh - surface average - flux surface average


Uses


Contents


Subroutines

public subroutine map_cart_to_polar(mesh, polars, u, upol)

Maps quantity from Cartesian mesh to polar grid

Arguments

Type IntentOptional Attributes Name
type(mesh_cart_t), intent(in) :: mesh

Mesh within poloidal plane

type(polars_t), intent(in) :: polars

Polar grid and matrices

real(kind=GP), intent(in), dimension(mesh%get_n_points()) :: u

Values of field on Cartesian mesh

real(kind=GP), intent(out), dimension(polars%grid%get_ntheta(), polars%grid%get_nrho() ) :: upol

Values of field on polar grid

public subroutine map_polar_to_cart(equi, mesh, polars, upol, u, intorder)

Maps quantity from polar grid to Cartesian mesh

Arguments

Type IntentOptional Attributes Name
class(equilibrium_t), intent(inout) :: equi

Equilibrium

type(mesh_cart_t), intent(in) :: mesh

Mesh within poloidal plane

type(polars_t), intent(in) :: polars

Polar grid and matrices

real(kind=GP), intent(in), dimension(polars%grid%get_ntheta(), polars%grid%get_nrho() ) :: upol

Values of field on polar grid

real(kind=GP), intent(out), dimension(mesh%get_n_points()) :: u

Values of field on Cartesian mesh

integer, intent(in), optional :: intorder

Integration order (default 3), must be an odd number

public subroutine surface_average(comm, mesh, polars, u, u_srf_av)

Computes zonal average of quantity

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI-communicator

type(mesh_cart_t), intent(in) :: mesh

Mesh within poloidal plane

type(polars_t), intent(in) :: polars

Polar grid and matrices

real(kind=GP), intent(in), dimension(mesh%get_n_points()) :: u

Values of field on Cartesian mesh

real(kind=GP), intent(out), dimension(polars%grid%get_nrho() ) :: u_srf_av

Surface average of quantity

public subroutine flux_surface_average(comm, mesh, polars, u, u_fluxsrf_av)

Computes zonal average of quantity

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI-communicator

type(mesh_cart_t), intent(in) :: mesh

Mesh within poloidal plane

type(polars_t), intent(in) :: polars

Polar grid and matrices

real(kind=GP), intent(in), dimension(mesh%get_n_points()) :: u

Values of field on Cartesian mesh

real(kind=GP), intent(out), dimension(polars%grid%get_nrho() ) :: u_fluxsrf_av

Surface average of quantity

public subroutine drift_surface_integral(comm, equi, mesh, polars, dphi, u, drift_flux, v)

Computes surface integral of flux in drift form, i.e. \int dS v/B^2 B\times\nabla u via integration along flux surface, i.e. = \int v/B du/d\theta J dphi d\theta

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI-communicator

class(equilibrium_t) :: equi

EQuilibrium

type(mesh_cart_t), intent(in) :: mesh

Mesh within poloidal plane

type(polars_t), intent(in) :: polars

Polar grid and matrices

real(kind=GP), intent(in) :: dphi

Toroidal grid distance

real(kind=GP), intent(in), dimension(mesh%get_n_points()) :: u

Field that gardient acts upon

real(kind=GP), intent(out), dimension(polars%grid%get_nrho()) :: drift_flux

Drift flux

real(kind=GP), intent(in), optional, dimension(mesh%get_n_points()) :: v

Secondary field, default values = 1