-
Notifications
You must be signed in to change notification settings - Fork 7
Add analytical GS field with TF ripple support #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||
17aa914 to
5df5973
Compare
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
CI Feedback 🧐(Feedback updated until commit 817b4e6)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
- Add comprehensive TODO for tokamak GEQDSK support using geoflux coordinates - Reference Simpson rule implementation in KAMEL fix-integration branch - Document 3D field superposition via field_divB0 module - Note that 3D perturbations affect field but not reference coordinates
Document field_divB0 perturbation modes: - Vacuum perturbation workflow (ipert=1) with Biot-Savart coil fields - Plasma response modes (ipert=2,3) with Fourier representation - Coil file formats (AUG, GPEC, Nemov, STELLOPT) - vacfield.x program for generating field files from coil geometries - Phased implementation plan for SIMPLE+GEQDSK Note: libneo has full 3D capability but no regression tests yet
Add comprehensive summary section covering: - 4 perturbation modes (ipert=0/1/2/3) with use cases - Vacuum perturbation workflow using vacfield.x - Plasma response mode requirements - Available tools (coil_tools, coil_convert, Python interfaces) - Current status: fully implemented but not regression tested - 3-phase integration plan for SIMPLE+GEQDSK - Example field_divB0.inp configuration This provides quick reference for understanding libneo's 3D capabilities before diving into detailed implementation phases.
Provides SIMPLE field interface for libneo's analytical Grad-Shafranov equilibrium solver with optional TF ripple perturbation. The adapter converts between SIMPLE's flux-like coordinates (r, theta, phi) and libneo's cylindrical coordinates (R, phi, Z) using a simple circular tokamak mapping: R = R0 + r*a*cos(theta), Z = r*a*sin(theta). Features: - Full Cerfon-Freidberg analytical equilibrium - Optional TF coil ripple (Nripple parameter) - Configurable shaping (kappa, delta) - Direct import from libneo analytical_tokamak_field module Usage pattern matches field_coils (direct libneo import).
Task 1: Add ANALYTICAL=6 constant to field type enums - Added to magfie.f90 alongside existing GEOFLUX, MEISS, etc. Task 2: Create tokamak.in namelist files - examples/tokamak/tokamak.in: circular equilibrium without ripple - examples/tokamak/tokamak_ripple.in: 9-coil ripple configuration - Parameters documented with comments Task 3: Add tokamak parameters to params module - Added module variables for equilibrium and ripple parameters - Extended config namelist to include tokamak_input and all tok_* params - Added read_tokamak_config() subroutine - Auto-loads tokamak.in when field_input contains "analytical" Next: Rewrite field_analytical_gs for proper coordinate system interface
- Document libneo test hierarchy (unit + integration tests complete) - Outline SIMPLE system test plan - Alpha confinement example: 128 particles, s=0.3, ITER-size, Meiss coords - System test: verify zero losses in tokamak without ripple
Create example for system test of alpha particle confinement in ITER-size analytical tokamak without ripple. Configuration: - 128 alpha particles at s=0.3 - Meiss coordinates on analytical geoflux - 1 ms integration time - Expected: zero losses This establishes baseline for ripple-induced transport tests.
Create test_tokamak_alpha_confinement to verify perfect particle confinement in analytical tokamak without ripple. Test scaffold ready but marked WILL_FAIL until: - field.F90 updated with analytical_geoflux_field integration - Analytical field initialization working in SIMPLE Once integration complete, test will verify: - Zero particles lost in axisymmetric configuration - Particles remain near starting flux surface s=0.3 - Meiss coordinates work on analytical geoflux
Mark example and system test as complete: - Example directory created with all config files - System test scaffold integrated with CMake - Both ready and waiting for Phase 3 field integration Next step: Update field.F90 to initialize analytical geoflux
Document full implementation status: - What works now: libneo complete, SIMPLE infrastructure ready - What's needed: Only field.F90 integration (10 lines of code) - Detailed phase-by-phase breakdown with commits and test results - Clear critical path: field.F90 → system test → merge - Quick reference section for the exact changes needed All infrastructure complete and tested. Ready for field integration.
6300884 to
2776210
Compare
User description
Summary
Integrates libneo's analytical Grad-Shafranov equilibrium solver with TF ripple support into SIMPLE, enabling orbit integration in analytical tokamak fields.
Changes
New Field Type:
AnalyticalGSFieldfield_analytical_gsMagneticFieldanalytical_tokamak_fieldmodule directlyCoordinate Transformation
Features
create_analytical_gs_field()with optional parametersImplementation Pattern
Follows the
field_coilspattern:Dependencies
Requires libneo PR #149 (TF ripple support)
Usage Example
Test Plan
Notes
This PR is part of the TF ripple feature branch. Tests and verification will be added after confirming build compatibility.
PR Type
Enhancement
Description
Add analytical Grad-Shafranov field with TF ripple support
Integrate GEQDSK/geoflux coordinate system for tokamak equilibria
Extend coordinate transformations with geoflux support
Add comprehensive test suite for new field types
Diagram Walkthrough
File Walkthrough
7 files
Add analytical Grad-Shafranov field implementationAdd GEQDSK geoflux field adapterAdd geoflux coordinate transformation supportAdd geoflux magnetic field evaluationAdd GEQDSK initialization supportUpdate field initialization for GEQDSKAdd GEQDSK file detection and field creation4 files
Add geoflux field unit testsAdd VMEC field unit testsAdd geoflux magfie integration testsAdd GEQDSK test data and new test targets5 files
Improve dependency path resolutionAdd libneo tokamak branch configurationAdd tokamak example build systemAdd tokamak example configurationAdd new field modules and dependencies1 files
Add comprehensive implementation plan1 files
Update libneo dependency to tokamak branch