Skip to content

Commit b2bef7e

Browse files
jcitrinTorax team
authored and
Torax team
committed
Fix EQDSK geometry coupling and add a new ITER hybrid test case.
New ITERhybrid EQDSK file generated from CHEASE data. Good comparison with the simulation using CHEASE geometry. Summary of fixes: 1. vpr definition bug leading to major impact on plasma volume 2. Avoiding LCFS flux-surface-integral issues for diverted cases by taking the last contour just inside the LCFS. 3. Rmaj taken now as Rgeo (LCFS Rmaj), and local Rmaj and Rmin used for delta (triangularity) calculations 4. StandardGeometryIntermediate values at the magnetic axis are prescribed, since a contour cannot be defined there. The number of surfaces to calculate, and the location of the LCFS contour with respect to the boundary psi, are user-inputs, with reasonable defaults set but need to be checked against more varied sets of EQDSK files. The EQDSK converter has only been tested against CHEASE-generated EQDSK which is at a specific COCOS. Therefore issues may arise if the input EQDSK is in a different COCOS. In near-future work we should demand that the EQDSK COCOS is an input, and we use the eqdsk convertor to convert to the TORAX COCOS, which itself also needs to be made fully self-consistent in a future PR. This important caveat is mentioned in the documentation, as well as a user-warning when running TORAX with EQDSK geometry. PiperOrigin-RevId: 697621831
1 parent dc5fcb5 commit b2bef7e

11 files changed

+3859
-81
lines changed

docs/configuration.rst

+62-25
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ geometry
392392
--------
393393

394394
``geometry_type`` (str = 'chease')
395-
Geometry model used. There are currently three options:
395+
Geometry model used, from the following options.
396396

397397
* ``'circular'``
398398
An ad-hoc circular geometry model. Includes elongation corrections.
@@ -404,49 +404,86 @@ geometry
404404
* ``'fbt'``
405405
Loads FBT geometry files.
406406

407-
``nrho`` (int = 25)
408-
Number of radial grid points
407+
* ``'eqdsk'``
408+
Loads a EQDSK geometry file, and carries out the appropriate flux-surface-averages of the 2D poloidal flux.
409+
Use of EQDSK geometry comes with the following caveat:
410+
The TORAX EQDSK converter has only been tested against CHEASE-generated EQDSK which is COCOS=2.
411+
The converter is not guaranteed to work as expected with arbitrary EQDSK input, so please verify carefully.
412+
Future work will be done to correctly handle EQDSK inputs provided with a specific COCOS value.
409413

410-
``geometry_file`` (str = 'ITER_hybrid_citrin_equil_cheasedata.mat2cols')
411-
Only used for ``geometry_type='chease'``. Sets the geometry file loaded.
412-
The geometry directory is set with the ``TORAX_GEOMETRY_DIR`` environment variable. If none is set, then the default is ``torax/data/third_party/geo``.
414+
Geometry dicts for all geometry types can contain the following additional keys.
413415

414-
``LY_file`` (str = None)
415-
Only used for ``geometry_type='fbt'``. Sets a single-slice FBT LY geometry file to be loaded.
416+
``nrho`` (int = 25)
417+
Number of radial grid points
416418

417-
``LY_bundle_file`` (str = None)
418-
Only used for ``geometry_type='fbt'``. Sets the FBT LY bundle file to be loaded, corresponding to multiple time-slices.
419+
``hi_res_fac`` (int = 4)
420+
Only used when the initial condition ``psi`` is from plasma current. Sets up a higher resolution mesh
421+
with ``nrho_hires = nrho * hi_res_fac``, used for ``j`` to ``psi`` conversions.
419422

420-
``LY_to_torax_times`` (ndarray = None)
421-
Only used for ``geometry_type='fbt'``. Sets the TORAX simulation times corresponding to the individual slices in the
422-
FBT LY bundle file. If not provided, then the times are taken from the LY_bundle_file itself. The length of the array
423-
must match the number of slices in the bundle.
423+
Geometry dicts for all non-circular geometry types can contain the following additional keys.
424424

425-
``L_file`` (str = None)
426-
Only used for ``geometry_type='fbt'``. Sets the FBT L geometry file loaded.
425+
``geometry_file`` (str = 'ITER_hybrid_citrin_equil_cheasedata.mat2cols')
426+
Required for all geometry types except ``'circular'``. Sets the geometry file loaded.
427+
The geometry directory is set with the ``TORAX_GEOMETRY_DIR`` environment variable. If none is set, then the default is ``torax/data/third_party/geo``.
427428

428429
``geometry_dir`` (str = None)
429430
Optionally overrides the``TORAX_GEOMETRY_DIR`` environment variable.
430431

431432
``Ip_from_parameters`` (bool = True)
432-
Only used for ``geometry_type='chease'``.Toggles whether total plasma current is read from the configuration file,
433-
or from the geometry file. If True, then the :math:`\psi` calculated from the geometry file is scaled to match the desired :math:`I_p`.
433+
Toggles whether total plasma current is read from the configuration file, or from the geometry file.
434+
If True, then the :math:`\psi` calculated from the geometry file is scaled to match the desired :math:`I_p`.
435+
436+
Geometry dicts for analytical circular geometry require the following additional keys.
434437

435438
``Rmaj`` (float = 6.2)
436-
Major radius (R) in meters. Not used for ``geometry_type='fbt'``, where Rmaj is taken from the FBT geometry file.
439+
Major radius (R) in meters.
437440

438441
``Rmin`` (float = 2.0)
439-
Minor radius (a) in meters. Not used for ``geometry_type='fbt'``, where Rmin is taken from the FBT geometry file.
442+
Minor radius (a) in meters.
440443

441444
``B0`` (float = 5.3)
442-
Vacuum toroidal magnetic field on axis [T]. Not used for ``geometry_type='fbt'``, where B0 is taken from the FBT geometry file.
445+
Vacuum toroidal magnetic field on axis [T].
443446

444447
``kappa`` (float = 1.72)
445-
Only used for ``geometry_type='circular'``. Sets the plasma elongation used for volume, area and q-profile corrections.
448+
Sets the plasma elongation used for volume, area and q-profile corrections.
446449

447-
``hi_res_fac`` (int = 4)
448-
Only used when the initial condition ``psi`` is from plasma current. Sets up a higher resolution mesh
449-
with ``nrho_hires = nrho * hi_res_fac``, used for ``j`` to ``psi`` conversions.
450+
Geometry dicts for CHEASE geometry require the following additional keys for denormalization.
451+
452+
``Rmaj`` (float = 6.2)
453+
Major radius (R) in meters.
454+
455+
``Rmin`` (float = 2.0)
456+
Minor radius (a) in meters.
457+
458+
``B0`` (float = 5.3)
459+
Vacuum toroidal magnetic field on axis [T].
460+
461+
Geometry dicts for FBT geometry require the following additional keys.
462+
463+
``LY_file`` (str = None)
464+
Sets a single-slice FBT LY geometry file to be loaded.
465+
466+
``LY_bundle_file`` (str = None)
467+
Sets the FBT LY bundle file to be loaded, corresponding to multiple time-slices.
468+
469+
``LY_to_torax_times`` (ndarray = None)
470+
Sets the TORAX simulation times corresponding to the individual slices in the
471+
FBT LY bundle file. If not provided, then the times are taken from the LY_bundle_file
472+
itself. The length of the array must match the number of slices in the bundle.
473+
474+
``L_file`` (str = None)
475+
Sets the FBT L geometry file loaded.
476+
477+
Geometry dicts for EQDSK geometry can contain the following additional keys.
478+
It is only recommended to change the default values if issues arise.
479+
480+
``n_surfaces`` (int = 100)
481+
Number of surfaces for which flux surface averages are calculated.
482+
483+
``last_surface_factor`` (float = 0.99)
484+
Multiplication factor of the boundary poloidal flux, used for the contour
485+
defining geometry terms at the LCFS on the TORAX grid. Needed to avoid
486+
divergent integrations in diverted geometries.
450487

451488
For setting up time-dependent geometry, a subset of varying geometry parameters
452489
and input files can be defined in a ``geometry_configs`` dict, which is a

0 commit comments

Comments
 (0)