Skip to content

Commit 5128ac1

Browse files
fs2819Freddie Sheehanjohn4255hansec
authored
TokaMaker+TORAX updates (OpenFUSIONToolkit#318)
Most important changes - Profile convolution replaces hard-coded FF′/p′ fallbacks; Jphi input to TokaMaker first, then FF' used as fallback - New pedestal architecture (set_pedestal overhauled) -- full pedestal config (config_mode, ped_height_{Te,Ti,ne}, formation_model for the L/H transition), adaptive-source prefactors, a manual-IBC pedestal mode, and an L->H core boost. Default remains ADAPTIVE_SOURCE with new MTANH pedestal shape. - Coil current rate limiting -- set_coil_rate_limits(dIdt | V+R, dt_floor) tightens each coil's GS bounds to a slew rate window around the last solved current, clipped to the global bounds. - Unified coil configuration -- all coil settings now live in tm_inputs under coil_* keys, with one global coil_bounds feeding seed-eqdsk generation, the coupled GS solves, and the rate-limit clip. - Coil limits accept A/turn as well as A-turns -- coil_bounds_units='A/turn' lets you specify limits in TokaMaker's native per-winding unit. Default stays A-turns; inputs convert on the way in and are stored internally in A-turns, so state/plots/rate-limits are unchanged. Applies to both bounds and dI/dt limits. - Diverted-window config merged + LCFS shape override -- set_diverted_shape_targets(...) replaces set_x_points(...): same X-point / strike-point / trim args plus a new shape_target that overrides the seed-eqdsk LCFS shape during the diverted window only (same isoflux weights; trim and strike points still apply). - Config save/load workflow — save_tmtx_config() / run_tmtx_from_config() with seed-eqdsk generation from trajectories; TORAX configs dumped as JSON in debug mode. - fly() gains loop0, steady_state_mode, relax_dt - EQDSK failure handling improved -- TORAX interpolates between good eqdsk files; save_eqdsk retries across (nr, nz) until one succeeds. - New diagnostics/plots -- plot_coil_current_tunnel, plot_PLH_components (P_SOL vs P_LH), IBC debug plotting, TM solve-level diagnostics, Tau_E/H98 and vol-avg Te/Ti on scalar plots. - ITER example rebuilt **Breaking / behavior-changing updates:** - `set_x_points()` removed -> `set_diverted_shape_targets()`. The old name is a stub that raises NotImplementedError (a hard raise rather than a silent no-op, so a stale call can't leave the diverted window unconfigured). Config key x_points -> diverted_shape_targets (loader still accepts the old key). The unrelated x_points key inside seed_eqdsk_config is unchanged. - set_heating default physics changed -- generic_heat_absorption_fraction now defaults to 1.0 (was ~0.0) and generic_heat_electron_heat_fraction to 0.4 (was 0.6). --------- Co-authored-by: Freddie Sheehan <f.sheehan@columbia.edu> Co-authored-by: John L <j42558080+1@gmail.com> Co-authored-by: Chris Hansen <cjh2199@columbia.edu>
1 parent 9a24e4f commit 5128ac1

6 files changed

Lines changed: 8809 additions & 1744 deletions

File tree

src/examples/TokaMaker/AdvancedWorkflows/Pulse_Design/ITER_TokaMaker_TORAX/ITER_TokaMaker_TORAX_pulse_ex.ipynb

Lines changed: 0 additions & 1326 deletions
This file was deleted.

src/examples/TokaMaker/AdvancedWorkflows/Pulse_Design/TokaMaker_TORAX/ITER/ITER_TokaMaker_TORAX_pulse_ex.ipynb

Lines changed: 4040 additions & 0 deletions
Large diffs are not rendered by default.

src/examples/TokaMaker/AdvancedWorkflows/Pulse_Design/ITER_TokaMaker_TORAX/ITER_mesh.h5 renamed to src/examples/TokaMaker/AdvancedWorkflows/Pulse_Design/TokaMaker_TORAX/ITER/ITER_mesh.h5

File renamed without changes.

src/examples/TokaMaker/AdvancedWorkflows/Pulse_Design/ITER_TokaMaker_TORAX/requirements_TokaMaker_TORAX.txt renamed to src/examples/TokaMaker/AdvancedWorkflows/Pulse_Design/TokaMaker_TORAX/requirements_TokaMaker_TORAX.txt

File renamed without changes.

src/python/OpenFUSIONToolkit/TokaMaker/pulse_design.py

Lines changed: 4758 additions & 417 deletions
Large diffs are not rendered by default.

src/tests/physics/test_pulse_design.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,17 @@ def _run_tokamaker_torax(
270270
tt.set_ne(ne, right_bc=0.25e20)
271271
tt.set_Te(te, right_bc=0.1)
272272
tt.set_Ti(te, right_bc=0.1)
273-
tt.set_pedestal(set_pedestal=True, T_i_ped=3.0, T_e_ped=3.0, n_e_ped=0.8e20)
273+
# H-mode pedestal-top targets; the TORAX L/H formation model owns the transition timing
274+
# (pedestal applied once P_SOL > P_LH), ramped over transition_time.
275+
tt.set_pedestal(
276+
config_mode="ADAPTIVE_SOURCE",
277+
ped_height_Te=3.0,
278+
ped_height_Ti=3.0,
279+
ped_height_ne=0.8e20,
280+
ped_top=0.9,
281+
transition_time=0.5,
282+
formation_model="martin_scaling",
283+
)
274284

275285
heat_times = {0.0: 30.0e6}
276286
tt.set_heating(

0 commit comments

Comments
 (0)