Skip to content

chi is written without the signgs factor carried by phi, phipf and chipf #5

Description

@CharlesCNorton

eqfor.f90 integrates chi without signgs:

! eqfor.f90:158-163
  chi1(1) = zero
  DO i = 2, ns
     ...
     chi1(i) = chi1(i-1) + hs*(phip(i)*iotas(i))
  END DO
  chi = twopi*chi1

The quantities it has to agree with all carry it: phi = (signgs*twopi*hs)*phi (fileout.f90:61), and phipf and chipf go into the wout as twopi*signgs*phipf and twopi*signgs*chipf (wrout.f90:736, 738). chi goes in as is (wrout.f90:737).

With signgs = -1 the file holds chi = -∫ iota dphi. On input.cth_like_fixed_bdy:

quantity value
phi(ns) -0.035000
Σ iotas(js) phipf(js) hs over the half grid -0.040086
trapezoid of chipf over s -0.03846 (the axis entry is zero, see #6)
chi(ns) +0.040086

chipf(js)/phipf(js) equals iotaf(js) on every surface, so chi is the odd one out, and d(chi)/d(phi) read back from the file has the opposite sign to iotaf. PARVMEC carries the same three lines (eqfor.f:177-183), so this is inherited from 8.52. chi = twopi*signgs*chi1, or accumulating phip the way fileout.f90:61 does, fixes it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions