Currently, btor, used for calculating the momentum flux, is not initialized or computed for VMEC geometries. This leads to NaNs and incorrect results in the output.
Code Example
See stella_geometry.f90 line 300:
case (geo_option_vmec)
vmec_chosen = .true.
!> read in input parameters for vmec
!> nalpha may be specified via input file
if (debug) write (*, *) 'init_geometry::read_vmec_parameters'
call read_vmec_parameters
!> allocate geometry arrays
if (debug) write (*, *) 'init_geometry::allocate_arrays'
call allocate_arrays(nalpha, nzgrid)
if (debug) write (*, *) 'init_geometry::allocate_temporary_arrays'
call allocate_temporary_arrays(nalpha, nzgrid)
!> get geometry coefficients from vmec
if (debug) write (*, *) 'init_geometry::get_vmec_geo'
!> abs(twist_and_shift_geo_fac) is dkx/dky * jtwist
!> minus its sign gives the direction of the shift in kx
!> to be used for twist-and-shift BC
allocate (twist_and_shift_geo_fac_full(nalpha, -nzgrid:nzgrid))
twist_and_shift_geo_fac_full = 0
!> The code will start computing for the initial zgrid
stellarator_symmetric_BC = .false.
call get_vmec_geo(new_zeta_min, stellarator_symmetric_BC, &
nzgrid, nalpha, naky, geo_surf, grho, bmag, gradpar, &
b_dot_grad_z, grad_alpha_grad_alpha, &
grad_alpha_grad_psi, grad_psi_grad_psi, &
gds23, gds24, gds25, gds26, gbdrift_alpha, gbdrift0_psi, &
cvdrift_alpha, cvdrift0_psi, sign_torflux, &
theta_vmec, zed_scalefac, aref, bref, alpha, zeta, &
field_period_ratio, x_displacement_fac)
Issue Description
Currently,
btor
, used for calculating the momentum flux, is not initialized or computed for VMEC geometries. This leads to NaNs and incorrect results in the output.Code Example
See
stella_geometry.f90
line 300:See
stella_diagnostics.f90
line 577:Expected Behavior
btor
should be properly initialized and computed for VMEC geometries to avoid NaNs and ensure correct results.