Skip to content

Commit

Permalink
Cosmetic change
Browse files Browse the repository at this point in the history
Changed the order of operations in <gbdrift0_psi> so it matches the old stella so we can compare simulations with the same <rng_seed>. If the order of operations is different, there will be a difference in <gbdrift0_psi> of the order of numerical noise which can manifest in different time traces.
  • Loading branch information
HanneThienpondt authored Oct 2, 2023
1 parent d5e63e4 commit 66780d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geo/vmec_interface/vmec_to_stella_geometry_interface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1582,8 +1582,8 @@ subroutine vmec_to_stella_geometry_interface(nalpha, alpha0, nzgrid, &
! Use hat{s} * (2/B^3) = 2 * shat / (B * B * B)
! Use B x ∇B · ∇ψ = psi_LCFS / sqrt(g) * ( ∂B/∂ζ * Btheta - ∂B/∂θ * Bzeta )
! Use psi_LCFS = sgn(psi_t) * psi_{t,LCFS} = <sign_toroidal_flux> * <edge_toroidal_flux_over_2pi>
gbdrift0_psi = 2 * shat / (B * B * B) * sign_toroidal_flux * edge_toroidal_flux_over_2pi / sqrt_g &
* (B_sub_theta_vmec * d_B_d_zeta - B_sub_zeta * d_B_d_theta_vmec)
gbdrift0_psi = sign_toroidal_flux * edge_toroidal_flux_over_2pi * (B_sub_theta_vmec * d_B_d_zeta &
- B_sub_zeta * d_B_d_theta_vmec) / sqrt_g * 2 * shat / (B * B * B)

! gbdrift0 = (B_sub_theta_vmec * d_B_d_zeta - B_sub_zeta * d_B_d_theta_vmec) / sqrt_g * edge_toroidal_flux_over_2pi &
! gbdrift0 = abs(edge_toroidal_flux_over_2pi) &
Expand Down

0 comments on commit 66780d2

Please sign in to comment.