scbc3
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
scbc3 [2016/09/21 11:59] – [Single Particle modeling] simonw7 | scbc3 [2022/07/21 06:59] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | =====Introduction to Plasma R&D Codes===== | ||
+ | |||
+ | This session is intended as an introduction to the codes that we use on a day-to-day basis to service existing or new contracts. | ||
+ | |||
+ | The modeling tools fall into four main areas: | ||
+ | |||
+ | - Single Particle | ||
+ | - Kinetic | ||
+ | - Fluid (or magneto-hydrodynamics_ | ||
+ | - Hybrids | ||
+ | - Non-plasma tools (neutronics) | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | |||
+ | ====Single Particle Modeling==== | ||
+ | |||
+ | In the presence of a magnetic field, charge particles will prescribe Larmor orbits and the guiding center of their orbit will drift in response to externally applied electric and magnetic fields. | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | ====Kinetic Modeling==== | ||
+ | |||
+ | |||
+ | ====Magneto-hydrodynamic (MHD) Modeling==== | ||
+ | |||
+ | Derived from moments of the Vlasov equation, the fluid description of plasmas is with macroscopic parameters (density, temperature, | ||
+ | |||
+ | [[ http:// | ||
+ | |||
+ | If we consider the time-independent form of the force balance, we can find a solution, called the Grad-shafranov equation: | ||
+ | |||
+ | [[ https:// | ||
+ | |||
+ | |||
+ | ====Codes we use==== | ||
+ | |||
+ | ===NIMROD=== | ||
+ | [[ https:// | ||
+ | |||
+ | NIMROD solves the extended magnetohydrodynamic equations using: | ||
+ | |||
+ | * Spectral finite element discretization in two dimensions, | ||
+ | * Finite Fourier series in the third dimension, | ||
+ | * Semi-implicit and implicit temporal discretization for the range of temporal scales found in fusion experiments, | ||
+ | * Simulation particles for kinetic effects from a minority species of energetic ions, and | ||
+ | * Integro-differential methods for kinetic effects from free-streaming. | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | ===HiFi=== | ||
+ | [[ http:// | ||
+ | |||
+ | HiFi is a user-friendly massively parallel adaptive high order finite element (a.k.a. spectral element) modeling framework designed for multi-fluid numerical simulations in two- and three-dimensional geometries. | ||
+ | |||
+ | |||
+ | ===BOUT++=== | ||
+ | [[ https:// | ||
+ | |||
+ | * Framework for writing fluid / plasma simulations in curvilinear geometry. | ||
+ | * Finite-difference code, variety of numerical methods and time-integration solvers. | ||
+ | * Written from scratch in C++, borrowing some ideas from the original BOUT code. | ||
+ | * Intended to be quite modular, enabling fast testing of numerical methods. | ||
+ | * Can evolve any number of equations, with equations appearing in a readable form. | ||
+ | * Primarily designed and tested with reduced plasma fluid models in mind. | ||
+ | |||
+ | |||
+ | ===Corsica=== | ||
+ | |||
+ | [[ https:// | ||
+ | |||
+ | The Corsica magnetic fusion simulation code is a prototype for an integrated simulation that would solve models for all aspects of tokamak operations. | ||
+ | * Corsica I flexibly coupled one-dimensional calculations of particle, energy, and magnetic-flux transport in the core, or confined region, of the plasma to a calculation of a two-dimensional magnetic configuration. | ||
+ | * Corsica II coupled the one-dimensional core transport calculation to a simulation of the two-dimensional " | ||
+ | * Corsica III is being developed as funding permits and will couple the evolution of the fusion process to plasma turbulence models for a more comprehensive simulation. | ||
+ | |||
+ | |||
+ | ===nimeq=== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | To run, put the following input deck into the run directory: | ||
+ | |||
+ | & | ||
+ | nimeq_solver=" | ||
+ | f_model=" | ||
+ | f_open=0.0 | ||
+ | f1_closed=-9.9099 | ||
+ | f1_closed=-1. | ||
+ | f2_closed=0.0 | ||
+ | dfdpsi=-9.9099 | ||
+ | pres_model=" | ||
+ | p1_closed=1 | ||
+ | p2_closed=0.25 | ||
+ | p_open=0.0e-6 | ||
+ | p_axis=0.002e-3 | ||
+ | gsh_tol=1.e-8 | ||
+ | gsh_tol=1.e-8 | ||
+ | eq_iters=300 | ||
+ | eq_iters=60 | ||
+ | linmaxit=150 | ||
+ | gscenter=0.75 | ||
+ | nimeq_tx=F | ||
+ | / | ||
+ | frac_flux=1. | ||
+ | cf_min=-.3891 | ||
+ | cf_min=-9999. | ||
+ | spectral_energy=T | ||
+ | |||
+ | |||
+ | Then run nimset, then run nimeq. | ||
+ | |||
+ | ====Programming languages==== | ||
+ | |||
+ | ===Fortran=== | ||
+ | (Originally FORTRAN, FORmula TRANslating system) | ||
+ | [[ http:// | ||
+ | |||
+ | [[ http:// | ||
+ | |||
+ | ===C=== | ||
+ | [[ http:// | ||
+ | |||
+ | ===C++=== | ||
+ | [[ http:// | ||
+ | |||
+ | |||
+ | ====Transfering files around==== | ||
+ | |||
+ | |||
+ | To transfer files to your local terminal do: | ||
+ | |||
+ | $scp -P 26 username@10.1.10.11: | ||
+ | | ||
+ | To uncompress tarballs: | ||
+ | |||
+ | $tar -xvf filename.tar | ||
+ | | ||
+ | ====Starting a run==== | ||
+ | |||
+ | cd to your SCRATCH directory with | ||
+ | |||
+ | cd $SCRATCH | ||
+ | | ||
+ | Make a directory for your run: | ||
+ | |||
+ | mkdir myrun1 | ||
+ | | ||
+ | Transfer the input deck and batch script in your example directory into your run directory. | ||
+ | |||
+ | ln -sf ~trainxx/ | ||
+ | ln -sf ~trainxx/ | ||
+ | |||
+ | Then you are ready to run nimset and launch the batch script: | ||
+ | |||
+ | ./nimset | ||
+ | qsub mybatch | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | ====Broken code ==== | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | ====Launch jobs==== | ||
+ | |||
+ | cp -R rundir $SCRATCH/. | ||
+ | cd $SCRATCH | ||
+ | nano go_script | ||
+ | | ||
+ | edit out the line with -A (del should do it) | ||
+ | |||
+ | ./nimset | ||
+ | sbatch go_script | ||
+ | | ||
+ | squeue -u < | ||
+ | | ||
+ | tail nimrod.out | ||
+ | | ||
+ | | ||
+ | |||