Realtime capable first principle transport modelling for ... Documents/Fusion... · DIFFER...
Transcript of Realtime capable first principle transport modelling for ... Documents/Fusion... · DIFFER...
DIFFER is part of andDIFFER huisstijl presentatie 1 juni 2017
Realtime capable first principle transport modelling for tokamak prediction and control
J. Citrin1, T. Aniel2, C. Bourdelle2, Y. Camenen3, V. Dagnelie1, H. Doerk4, F. Felici5, A. Ho1, D. Hogeweij1, K. van de Plassche1,6, G. Verdoolaege7,8, D. van Vugt6
1DIFFER - Dutch Institute for Fundamental Energy Research, Eindhoven, the Netherlands2CEA, IRFM, F-13108 Saint Paul Lez Durance, France
3CNRS, Aix-Marseille Univ., PIIM UMR7345, Marseille, France4Max Planck Institute for Plasma Physics, Boltzmannstr. 2, Garching, Germany
5Eindhoven University of Technology, Control Systems Technology Group, Eindhoven, The Netherlands6Science and Technology of Nuclear Fusion, Eindhoven University of Technology, Eindhoven, The Netherlands
7Department of Applied Physics, Ghent University, B-9000 Ghent, Belgium8Laboratory for Plasma Physics, Royal Military Academy, B-1000 Brussels, Belgium
Acknowledgement to EUROfusion for Enabling Research grant
Integrated tokamak modelling demands tractable calculations of all components
Full prediction and optimization cannot be inferred from the isolated behaviour of the components
Heating
MHD stability
Turbulence
Plasma-wall-interaction
Fusion power
Heat exhaust
Magnetic equilibrium
Calculation of each physics component must be reduced to a tractable level
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 2
Pathway towards unprecedented model tractability while remaining first-principle-based
Reduced quasilinear model. 102 CPU hours for 1s JET-scale profile evolution
Local nonlinear gyrokinetics108 CPUh for 1s JET-scale profile evolution
Bridging 12 orders of magnitude in calculation speed
Realtime capability.Neural network emulation
Faster than realtime!
• Neural network emulation of quasilinear transport models. Realtime capable. Powerful tool for experiment design and optimization
𝑇𝑇𝑒𝑒 q-profile
Heating powerTotal current
• “Golden standard” of local nonlinear gyrokinetics. Validation against experiments
• Reduced turbulence model for tractable profile evolution. Validation against NL and exp
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 4
QuaLiKiz assumptions
• Ballooned Gaussian eigenfunction ansatz
• Shifted circle (𝑠𝑠 − 𝛼𝛼) geometry
• Electrostatic only (nonlinear EM-stabilization effects to beadded to nonlinear saturation rule)
• Collisions only with Krook operator for trapped electrons
Quasilinear modelling a significant acceleration compared to nonlinear
Fast reduced transport model QuaLiKiz: quasilinear gyrokinetic ITG/TEM/ETG heat, particle, andmomentum turbulent core transport [Bourdelle PPCF 2016]
New release, QuaLiKiz 2.3.0. 10 CPUs per flux, × 106 faster than nonlinear [Citrin submitted to PPCF]
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 5
Validation on a JET ILW baseline dischargeJET 87412 (ILW baseline). 1s evolution, approx × 4𝜏𝜏𝐸𝐸
• Boundary condition at 𝜌𝜌 = 0.85
• Rotation important for confinement improvement in all channels
• Just one example of many validations: Tore Supra: Casati PhD ‘09, Villegas PRL ‘10. JET: Baiocchi NF ‘15, Breton EPS ’17. AUG: Linder EPS ‘17
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 6
1. Quasilinear model validated vs nonlinear simulations and experiments
2. Use quasilinear model to create datasets of turbulent flux calculations. Include all tokamak parameters of interest (e.g. based on experiments). Even for linear-GENE/GYRO/etc, feasible with 107 CPUh scale HPC projects (currently ‘routine’)
3. Define training sets from the database for neural network regression
4. Use the trained neural network as the ‘transport model’
Neural networks can provide a furtherspeedup in turbulence modelling
10 𝐶𝐶𝐶𝐶𝐶𝐶𝑠𝑠 per turbulent flux is fast, but we can go much further!
We apply (shallow) multilayer perceptron neural networks
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 7
“Very fast” tokamak simulator
• Offline trajectory optimization. Reinforcement learning
Realtime tokamak simulator
• Online trajectory optimizationfaster-than-real-time (model-based predictive control)
• Controller design
• Controller validation
• Discharge supervision and monitoring(e.g. disruption mitigation)
Neural network technique opens up wide applications for scenario prediction and control
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 8
Reminder of neural network nuts and bolts
8
Multilayer perceptron neural network (simple topology)
𝑔𝑔 𝑥𝑥 =2
1 + 𝑒𝑒−𝑥𝑥 − 1
x: Inputs: e.g. Ti/Te, q, �̂�𝑠, R/Ltiy: Output: e.g. ion heat flux𝑤𝑤1,2: free weights for optimization
With, e.g.
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
𝑥𝑥4
𝑦𝑦 = �𝑤𝑤𝑗𝑗2𝑔𝑔𝑗𝑗 �𝑤𝑤𝑖𝑖,𝑗𝑗1 𝑥𝑥𝑖𝑖𝑦𝑦
𝑤𝑤𝑗𝑗2𝑤𝑤𝑖𝑖,𝑗𝑗1 𝑔𝑔1
𝑔𝑔2
𝑔𝑔3
𝑔𝑔4
𝑔𝑔5
Optimize weights by minimizing: ∑𝑁𝑁 𝑡𝑡𝑁𝑁 − 𝑦𝑦𝑁𝑁 2 + 𝜆𝜆∑ 𝑤𝑤𝑖𝑖𝑗𝑗2
𝑡𝑡𝑁𝑁 are target values, known from, e.g. QuaLiKiz runs𝜆𝜆 is the regularization factor. Avoids overfitting
Provides an analytical formula with analytical derivatives. Critical for trajectory optimization applications and implicit timestep solvers
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 99
A proof-of-principle NN transport model is developed
Neural network fit for QuaLiKiz output. ITG regime(S.Breton MSc, J. Redondo MSc ; Citrin, Breton et al., Nucl. Fusion Lett. 2015)
4D input training set for ~50,000 fluxes. NN with 2 hidden layers of 30 nodes. L-BFGS optimization𝑞𝑞 = 1 − 5 ; �̂�𝑠 = 0.1 − 3 ; 𝑇𝑇𝑖𝑖
𝑇𝑇𝑒𝑒= 0.3 − 3 ; 𝑅𝑅
𝐿𝐿𝑇𝑇𝑖𝑖= 2 − 12
Parameter scans of NN ion heat conductivity vs original QuaLiKiz results
Note that regularization even allows reasonable extrapolation.
Extrapolation not recommended, but encouraging for robustness in sparse datasets
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 10
• Neural network successfully reproduces QuaLiKiz results × 106 faster! ~1ms for a flux
• Already works well on JET ITG dominated case in flux driven integrated modellingExtension to more input dimensions (for ITG/TEM/ETG) needed for generalization
CRONOS/QLKNN simulation of flat top in JET 73342 standard H-mode. Original QLK simulation in Baiocchi PPCF 2015. Boundary condition at 𝜌𝜌 = 0.88
Neural Network QuaLiKiz validatedby JET discharge modelling
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 11
RAPTOR control-oriented simulator now multi-channel for 𝑗𝑗,𝑇𝑇𝑒𝑒 ,𝑇𝑇𝑖𝑖 ,𝑛𝑛. Faster than realtime
F. Felici and RAPTOR team
Ion temperature and density evolution now added to RAPTOR
• First simultaneous 𝑇𝑇𝑖𝑖 and 𝑇𝑇𝑒𝑒 simulationwith RAPTOR and QuaLiKiz-NN
• 6 order of magnitude speedup compared to original QuaLiKiz
• ITER scenario modelling faster than realtime. Successful comparison to previous CRONOS/GLF23 modelling (1 week simulation) [Citrin NF ‘10]
ITER hybrid scenario 𝑇𝑇𝑖𝑖 + 𝑇𝑇𝑒𝑒CRONOS/GLF23 vs RAPTOR/QLKANN4D
∼ 20𝑠𝑠simulationwalltime
𝜌𝜌𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 = 0.5 timetrace
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 12
Onwards and upwards! A 9 input dimension database for QuaLiKiz neural network training
• Database compiled! 3 ⋅ 108 flux evaluations,1.5 MCPUh of QuaLiKiz runs @ NERSC
• Also separate database for ITG, TEM, ETG fluxes (may be easier to fit)
• Non-uniform spacings for each parameter (based on experience and tests), but still a hyper-rectangle. Conceptually simple.
MSc Karel van de Plassche
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 13
A 9 input dimension database forQuaLiKiz neural network training
9D database permanently online and accessible at dataslicer.qualikiz.com
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 14
9D neural network training undergoing
Example of heat flux NN outputTransition from ITG to ETG in𝑅𝑅/𝐿𝐿𝑇𝑇𝑒𝑒 scan. QLK points are discreteFlux > 50 [GB units] is extrapolation Lots to optimize in NN fitting:
• Network topology• Activation function• Optimization routine• Regularization (cost function)• Data filtering (e.g. find QLK outliers, set
upper limit on flux to improve thresholds)
Ongoing work for 9D (Karel van de Plassche, Nishith Chennakeshava)
Soon to test in RAPTOR heat+particle transport
𝑞𝑞𝑖𝑖 NN –-𝑞𝑞𝑒𝑒 NN ETG + ITG-TEM ⋅⋅⋅𝑞𝑞𝑒𝑒 NN –-
𝑅𝑅/𝐿𝐿𝑇𝑇𝑒𝑒
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 15
Adding 𝐸𝐸𝑥𝑥𝐸𝐸 flow shear as 10th input dimension for neural network fits
MSc Victor DagnelieWorking on new Waltz-rule-style 𝐸𝐸𝑥𝑥𝐸𝐸 suppression model includingparallel flow destabilisation.Based on database of linear-GENE scans, mostly around GA-STD case parameters for now (varying 𝑅𝑅
𝐿𝐿𝑇𝑇𝑖𝑖, 𝑞𝑞, �̂�𝑠, 𝜖𝜖)
To be included in post-processing to QLK database
and try 10D NN fits
𝛾𝛾𝐸𝐸 [𝑐𝑐𝑠𝑠/𝑎𝑎]
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 16
Constructing more complete NN transport model with ~25 input dimensions
• For all local input dimensions (~25D), including shaping, 𝛽𝛽, impurities, we must restrict to subspace containing natural experimental correlations
• Construct database for training sets based on wide range of experimental scenarios, and extrapolations to future devices
• New multi-machine profile database for neural network training set sampling. Subset (including sources) for integrated modelling validation
• Have started with JET. Database now complete.~2000 discharges, 7 time slices each. Automated Gaussian Processes (GP) fitting routines, consistency checks (PhD Aaron Ho).
• Next step GK runs (QLK + lin-GENE on representative subset of ~10%)
• GP fitting routines provide automatic error bars on gradients. Informs how to sample additional inputs for GK runs to ensure thresholds are hit
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 17
Automated routines for Gaussian Processfitting of JET profile measurements
Aaron Hothis conference
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 18
We are developing a database forstoring linear gyrokinetic runs
Goal: gyrokinetic database (GKDB) openly accessible to community for storing results of linear gyrokinetic runs from various codes (linear-GENE/GKW/GYRO, etc)
• Populate training sets for neural network regression
• Code-code benchmarks
• In SQL with direct queries performed from Python, Matlab, IDL
Yann Camenen, Thierry Aniel, Karel van de Plassche, Daan van Vugt
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 19
A 10 input dimension database forQuaLiKiz neural network training
SQL schema for GKDB
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 20
Workflow of GKDB data input
Now entering phase where early adopters can volunteer to use and test
Jonathan Citrin IAEA Technical Meeting, Boston, 2017 21
Summary and outlook
• Reduced turbulence transport model QuaLikiz 2.3.0 release. Ongoing successful validations on JET and AUG discharges.
• 4D QLK neural network proof-of-principle. Validation of heat and particle transport in JET discharge. Implementation on realtime capable control-oriented simulator RAPTOR
• 9D (10 with 𝐸𝐸 × 𝐸𝐸) QLK database complete. NN fitting well underway. To be implemented and tested in RAPTOR
• New extensive JET profile database for sampling inputs for >20D GK runs. Automated Gaussian Process fit workflow. QuaLiKiz and quailinear-GENE runs and NN fits to come.
• GyroKineticDataBase (GKDB) project advancing for enhancing community wide linear benchmarks and defining neural network training sets for transport model emulation