ForceFreeStates - FEATURE - Widen the harmonic range at startup when the forcing spectrum needs it

Open
#563 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
julia

Research direction

Start by locating the ForceFreeStates setup and the forcing materialization paths for file forcing and coil Biot–Savart; the issue does not name files or tests. Read how the current harmonic bounds and edge-harmonic flux check are calculated, then trace where the spectrum is used in the FFS solve and PE stage. Done when the range widens based on the stated flux criterion, reports the selected bounds, and reuses the materialized spectrum.

Written by the indexing model from the issue text.

Description

Goal

Check the forcing spectrum at the start of a run, and widen the ForceFreeStates (FFS) poloidal harmonic range (mlow:mhigh) when it is too narrow to resolve the forcing.

Motivation

The FFS harmonic range is fixed from the q profile plus delta_mlow/delta_mhigh, before the forcing is looked at. The forcing is then projected onto that range. Any forcing flux outside it is silently dropped:

  • File forcing: normal_field_T file forcing is now projected onto the run's harmonics (see #549). The B·n̂ → flux weight spreads amplitude several harmonics beyond the file's own, so a file that reaches the edge of the run's range loses flux there.
  • Coil forcing: coil forcing is decomposed directly on mlow:mhigh and is truncated the same way.

Today the only check is the warning added in #549. It covers truncation of the file's own spectrum, not truncation by the run.

Proposal

  • Early materialization: materialize the forcing spectrum (file conversion or coil Biot–Savart) before the FFS solve, on a range wider than the default.
  • Range criterion: use the same edge-harmonic criterion as the file check. If the harmonics at or beyond the run's mlow/mhigh carry more than a set fraction of the forcing flux, widen the range until they don't. Report the chosen range with an @info.
  • Option: make the widening opt-out, or behind a deck option, since it raises mpert and the cost of the solve. A user-set range that is too narrow should at least warn.
  • Reuse: reuse the early spectrum in the perturbed-equilibrium (PE) stage rather than materializing it twice.
Dominant language
Julia
Stars
11
Forks
7
Avg merge
4d 1h
Merged PRs (30d)
68

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenFUSIONToolkit/GPEC

All issues in OpenFUSIONToolkit/GPEC

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.