Skip to content

Correct equation linearization issues - #44

Open
jorekart wants to merge 18 commits into
iterorganization:developfrom
jorekart:correct_equation_linearization_issues
Open

jorekart wants to merge 18 commits into
iterorganization:developfrom
jorekart:correct_equation_linearization_issues

Conversation

@jorekart

Copy link
Copy Markdown
Collaborator

Correct equation linearization issues

Depends on #41 (automatic equation verificator). Please merge that one first.

This PR fixes the linearization problems in models/model600/mod_elt_matrix_fft.f90
found by the equation verificator introduced in #41. That tool linearizes the
model-600 weak forms symbolically and compares the result, term by term, with the
hand-written residual and Jacobian. The finding numbers below refer to its
util/equation_codegen/JOREK_FINDINGS.md. There is one commit per finding.

RHS fixes (these change the converged solution)

  • Finding 10: rhs_ij_k(var_rhoimp): the toroidal channel was missing the
    impurity shock-capturing diffusivity D_par_imp_sc_num*tau_sc.
  • Finding 16: rhs_ij(var_T): the parallel pressure convection used the
    neutral density rn0 where it should use rimp0.

Amat fixes

  • Finding 3: the single-temperature diamagnetic-viscosity tangent was a
    factor of two too large.
  • Finding 5: the rho equation's neutral sources were missing the
    impurity/alpha_e(T) contributions.
  • Finding 6: the vpar time term is now linearized consistently
    (B²·dvpar/dt + ½·vpar·dB²/dt).
  • Finding 7: the tgnum_vpar terms were missing the BB2/psi
    derivatives.
  • Finding 8: the toroidal channel of the visco_par_par tangent was
    missing.
  • Finding 11: the tgnum_T/Ti/Te tangents had the wrong power of BigR.
  • Finding 12: three smaller omissions in the energy tangents: the vpar
    kinetic-coupling term, dZK*_prof_drho, and the recombination sink.
  • Finding 13: the ionization-energy tangents were missing the theta
    factor.
  • Finding 14: some terms used alpha_e/alpha_imp where the _bis form
    is needed.
  • Finding 15: the T/Te tangents were missing several ionization, radiation
    and friction-source derivatives, and one term used the uncorrected
    densities.
  • Finding 17: amat_n(var_T,var_vpar) was missing the impurity pressure.

Known remaining differences

  • Findings 4 and 9 (inward pinch): the pinch is not differentiated with
    respect to psi, and the vpar pinch tangent has the wrong sign. These are
    left to the pinch developer. @szmate00 , could you look a this?
  • Findings 1 and 2 (impurity pressure in the tauIC diamagnetic tangents):
    these are accepted as known differences, because impurities and
    tauIC /= 0 cannot be run together. That combination should be rejected at
    input time; it is not enforced yet.

Javier Artola added 15 commits September 21, 2026 16:48
… vpar source, dZKi_prof_drho, recombination sink
…on and neutral radiation in T/Te equations
@jorekart jorekart self-assigned this Sep 23, 2026
@jorekart
jorekart force-pushed the correct_equation_linearization_issues branch from 3956054 to 9c495c6 Compare September 24, 2026 08:30

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant