Skip to content

Are contravariant b fields in GPEC or RMATCH (or both) correct? #235

@matt-pharr

Description

@matt-pharr

In gpeq.f/gpeq_sol(psi), the contravariant magnetic fields are calculated -- this is also found in rmatch/match.f/match_output_solution(). In gpeq.f, the grad-psi component of the contravariant b field is:

bwp_mn=(chi1*singfac*twopi*ifac*xsp_mn)

However, in rmatch, it also calculates the magnetic field,

outtotsol(:,ip)=chi1*ifac*singfac*outtotsol(:,ip)

In Jong-Kyu's thesis, the contravariant B fields are found in equation 2.58, where it states,

$$\displaystyle \delta B^\psi = \frac{\chi '}{\mathcal{J}}\left(\frac{\partial}{\partial \vartheta} + q \frac{\partial}{\partial \varphi}\right) \xi^\psi$$

This makes sense as in both codes, singfac=m-nq, chi1$=2\pi\psi_o$. outtotsol is the same thing that gets written in the rpec workflow to make u1 in gpec, so those should be the same. The only thing different between them is a factor of $2\pi$. I am working on getting the code able to compare these, but what do you all think @logan-nc @parkjk ?

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions