PB3D [2.47]
Ideal linear high-n MHD stability in 3-D
Loading...
Searching...
No Matches
helena_ops Module Reference

Operations on HELENA variables. More...

Functions/Subroutines

integer function, public read_hel (n_r_in, use_pol_flux_h)
 Reads the HELENA equilibrium data.
integer function, public interp_hel_on_grid (grid_in, grid_out, eq_2, x_1, x_2, eq_2_out, x_1_out, x_2_out, eq_1, grid_name)
 Interpolate variables resulting from HELENA equilibria to another grid (angularly).
integer function, public test_metrics_h ()
 Checks whether the metric elements provided by HELENA are consistent with a direct calculation using the coordinate transformations [17].
integer function, public test_harm_cont_h ()
 Investaige harmonic content of the HELENA variables.

Detailed Description

Operations on HELENA variables.

Function/Subroutine Documentation

◆ interp_hel_on_grid()

integer function, public helena_ops::interp_hel_on_grid ( type(grid_type), intent(in) grid_in,
type(grid_type), intent(in) grid_out,
type(eq_2_type), intent(inout), optional eq_2,
type(x_1_type), intent(inout), optional x_1,
type(x_2_type), intent(inout), optional x_2,
type(eq_2_type), intent(inout), optional eq_2_out,
type(x_1_type), intent(inout), optional x_1_out,
type(x_2_type), intent(inout), optional x_2_out,
type(eq_1_type), intent(in), optional eq_1,
character(len=*), intent(in), optional grid_name )

Interpolate variables resulting from HELENA equilibria to another grid (angularly).

The input and output grid to be provided depend on the quantities to be interpolated:

  • equilibrium variables: flux variables (no need to convert) and derived quantities (need equilibrium grid)
  • metric variables: jac_FD (need equilibrium grid)
  • vectorial perturbation variables: U_i, DU_i (need perturbation grid)
  • tensorial perturbation variables: PV_i, KV_i (need perturbation grid)

Also, a message can be printed if a grid name is passed.

Note
  1. The metric coefficients are interpolated and then compensated for the straight-field-line coordinates as in [17] .
  2. By default the interpolated quantities overwrite the original ones, but alternative output variables can be provided.
  3. as the equilibrium and perturbation grid are not generally identical, this routine has to be called separately for the variables tabulated in either grid.
Returns
ierr
Parameters
[in]grid_ininput grid
[in]grid_outoutput grid
[in,out]eq_2general metric equilibrium variables
[in,out]x_1general vectorial perturbation variables
[in,out]x_2general tensorial perturbation variables
[in,out]eq_2_outfield-aligned metric equilibrium variables
[in,out]x_1_outfield-aligned vectorial perturbation variables
[in,out]x_2_outfield-aligned tensorial perturbation variables
[in]eq_1general flux equilibrium variables for metric interpolation
[in]grid_namename of grid to which to adapt quantities

Definition at line 548 of file HELENA_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_hel()

integer function, public helena_ops::read_hel ( integer, intent(inout) n_r_in,
logical, intent(inout) use_pol_flux_h )

Reads the HELENA equilibrium data.

Adapted from HELENA routine IODSK.

The variales in the HELENA mapping file are globalized in two ways:

  • X and Y are normalized w.r.t. vacuum geometric axis R_vac and toroidal field at the geometric axis B_vac.
  • R[m] = R_vac[m] (1 + eps X[]) ,
  • Z[m] = R_vac[m] eps Y[] .

The covariant toroidal field F_H, pres_H and poloidal flux are normalized w.r.t magnetic axis R_m and total toroidal field at magnetic axis B_m:

  • RBphi[Tm] = F_H[] R_m[m] B_m[T] ,
  • pres[N/m^2] = pres_H[] (B_m[T])^2/mu_0[N/A^2] ,
  • flux_p[Tm^2] = 2pi (s[])^2 cpsurf[] B_m[T] (R_m[m])^2 .

The first normalization type is the HELENA normalization, whereas the second is the MISHKA normalization.

Everything is translated to MISHKA normalization to make comparison with MISHKA simple. This is done using the factors:

  • radius[] = a[m] / R_m[m] ,
  • eps[] = a[m] / R_vac[m] , so that the expressions become:
  • R[m] = radius[] (1/eps[] + X[]) R_m[m],
  • Z[m] = radius[] Y[] R_m[m],
  • RBphi[Tm] = F_H[] B_m[T] R_m[m],
  • pres[N/m^2] = pres_H[] B_m[T]^2 mu_0[N/A^2]^-1,
  • flux_p[Tm^2] = 2pi (s[])^2 cpsurf[] B_m[T] R_m[T]^2.

Finally, in HELENA, the total current I, the poloidal beta and the density at the geometric axis can be prescribed through:

  • XIAB = mu_0 I / (a_vac B_vac) ,
  • BETAP = 8 pi S <p> / (I^2 mu_0) ,
  • ZN ,

where a_vac = eps R_vac and B_vac are vacuum quantities, S is the 2-D cross-sectional area and <p> is the 2-D averaged pressure.

Note
To translate this to the MISHKA normalization factors as
  • R_m = (eps/radius) R_vac ,
  • B_m = B_vac / B0 ,
where
  • radius is in the mapping file (12), as well as in the HELENA output (20).
  • eps is in the mapping file (12), as well as in the HELENA input (10) and output (20).
  • B0 is in the mapping file (12), as well as in the HELENA output (20).
Furthermore, the density on axis can be specified as ZN0 from HELENA input (10).
The other variables should probably not be touched for consistency.
Finally, the variables IAS and B0 are in the mapping file (12) only in patched versions. See Getting the Equilibrium.
Returns
ierr
Parameters
[in,out]n_r_innr. of normal points in input grid
[in,out]use_pol_flux_h.true. if HELENA equilibrium is based on pol. flux

Definition at line 83 of file HELENA_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_harm_cont_h()

integer function, public helena_ops::test_harm_cont_h

Investaige harmonic content of the HELENA variables.

Note
Run with one process.

Definition at line 1484 of file HELENA_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_metrics_h()

integer function, public helena_ops::test_metrics_h

Checks whether the metric elements provided by HELENA are consistent with a direct calculation using the coordinate transformations [17].

Direct calculations used:

\[\begin{aligned} \left|\nabla \psi\right|^2 &= \frac{1}{\mathcal{J}^2} \left(\left(\frac{\partial Z}{\partial \chi}\right)^2 + \left(\frac{\partial R}{\partial \chi}\right)^2\right) \\ \left|\nabla \psi \cdot \nabla \chi\right| &= \frac{1}{\mathcal{J}^2} \left( \frac{\partial Z}{\partial \chi} \frac{\partial Z}{\partial \psi} - \frac{\partial R}{\partial \chi} \frac{\partial R}{\partial \psi} \right) \\ \left|\nabla \chi\right|^2 &= \frac{1}{\mathcal{J}^2} \left(\left(\frac{\partial Z}{\partial \psi}\right)^2 + \left(\frac{\partial R}{\partial \psi}\right)^2\right) \\ \left|\nabla \phi\right|^2 &= \frac{1}{R^2} \end{aligned}\]

with

\[\mathcal{J} = \frac{\partial Z}{\partial \psi} \frac{\partial R}{\partial \chi} - \frac{\partial R}{\partial \psi} \frac{\partial Z}{\partial \chi}\]

Also, test whether the pressure balance \(\nabla p = \vec{J}\times\vec{B} \) is satisfied.

Note
Debug version only
Returns
ierr

Definition at line 1288 of file HELENA_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function: