XGCa
|
#include <sml.hpp>
Public Member Functions | |
Simulation (NLReader::NamelistReader &nlr, double transit_time_in=1.0, double psi_norm=1.0) | |
Public Attributes | |
int | bounce |
Bounce routine switch 0 for off, 1 for inner boundary, 2 for both boundaries. More... | |
int | bounce_zero_weight |
If ==1 and bounce>0, set particle weights to zero after bouncing from the outer boundary. More... | |
double | bounce_buffer |
Buffer width between sml_outpsi and where the particle actually bounces (must be >=0) More... | |
double | dt |
Time step (s) More... | |
double | transit_time |
Torodial transit time of an ion with the characteristic energy. More... | |
int | sheath_mode |
Type of sheath (0 is none) More... | |
bool | sheath_adjust |
Whether to adjust the sheath. More... | |
bool | ptb_3db_on |
Toggle for ptb_3db. More... | |
bool | drift_on |
Toggle for using drift. More... | |
bool | neutrals |
Toggle for using neutrals. More... | |
bool | diag_heat_on |
Use heat diagnostics in sheath. More... | |
bool | xz_00_up |
Use upper region of xz when obtaining 00 mode. More... | |
int | mstep |
Max number of time steps. More... | |
int | nrk |
Order of Runge-Kutta time integration of particles + fields. More... | |
bool | electron_on |
Use kinetic electrons. More... | |
bool | limit_marker_den |
Whether to limit marker density. More... | |
int | special |
Special run (eg single particle, poincare) More... | |
int | nthreads |
Number of OMP threads on the host. More... | |
bool | field_solver_on =true |
If false, charge deposition and field solve is skipped. More... | |
bool | helmholtz_spectral |
Whether to solve Helmholtz-type equations with toroidally spectral solver. More... | |
bool | thermal_bath_on |
Switch on thermal-bath and coarse-graining operation, see ccm_param parameters. More... | |
bool | split_weight_scheme |
Whether to use the split-weight scheme. More... | |
bool | dwdt_fix_bg |
bool | dwdt_exb_only |
bool | em_mixed_variable |
Switch for use of mixed-variable formulation. More... | |
bool | em_control_variate |
Switch for use of control variate method. More... | |
int | em_pullback_mode |
double | em_pullback_dampfac |
Damping term gamma on -b.grad(phi) in pullback mode 4. More... | |
bool | em_control_variate_final_cv |
bool | em_control_variate_flag |
int | em_control_variate_niter |
Number of iterations for Ampere solve with control-variate method. More... | |
bool | em_b_para_eff |
Effective dB_|| via a modified grad-B drift (Joiner et al., PoP, 2010) More... | |
bool | em_es_step |
bool | em_dAsdt_filter_on |
Switch for applying Fourier filters on RHS of dAs/dt equation (pullback mode 4) More... | |
bool | no_turb |
Set all non-axisymmetric field perturbations to zero (electromagnetic version only) More... | |
bool | em_n0 |
Include n=0 electromagnetic mode. More... | |
bool | em_dAsdt_hypvis |
Use radial hyperviscosity in dA_s/dt (push_As) More... | |
bool | exclude_private |
Whether to exclude private region in ion charge deposition. More... | |
bool | grad_psitheta |
bool | iter_solver |
int | poisson_solver_type |
bool | update_poisson_solver |
Whether poisson solver is updated. More... | |
bool | iter_solver_converge |
bool | positive_phi00_sol |
bool | heuristic_priv_pot |
bool | poisson_natural_boundary |
int | add_pot0 |
bool | dpot_bd_apply |
Damp (n=0,m>0) potential towards the magnetic axis. More... | |
double | dpot_bd_width |
Decay length (normalized flux) for (n=0,m>0) potential towards the magnetic axis. More... | |
bool | poisson_bias |
Whether to use a (0,0) bias potential on top of phi_00. More... | |
bool | poisson_adia_wall |
EXPERIMENTAL! DON'T USE UNLESS ADVISED BY AN EXPERT. More... | |
double | dpot_te_limit |
Max absolute value of dpot/temp in getf0. More... | |
bool | em_use_dpot_te_limit |
In EM simulation: whether to force usage of the min-max limiter on the turbulent potential fluctuation. More... | |
bool | no_fp_in_f |
double | f0_grid_alpha |
bool | f0_update_analytic |
bool | f0_update_analytic_local |
If .false. –> flux-surface average update, .true. –> local. More... | |
double | f0_update_analytic_alpha |
Separate alpha from sml_f0_grid_alpha for Maxwellian contribution. More... | |
double | f0_update_analytic_damp_width |
int | f0_grid_alpha_start |
bool | ignore_f0g |
bool | symmetric_f |
Enforce axisymmetry of the total distribution function on the grid. More... | |
double | update_g_alpha |
bool | diff_on |
bool | resamp_on |
Do resampling. More... | |
bool | resamp_for_final_restart_write |
Perform resampling before dumping the final restart file. More... | |
bool | resamp_restart_read |
Whether to read a restart file written from a simulation with different grid. More... | |
bool | field_aligned_initial |
bool | flat_marker |
double | marker_temp_factor |
double | marker_temp_factor2 |
double | marker_temp_factor3 |
double | flat_marker_decay_start1 |
double | flat_marker_decay_start2 |
double | flat_marker_cutoff1 |
double | flat_marker_cutoff2 |
double | flat_marker_width1 |
double | flat_marker_width2 |
double | initial_deltaf_noise |
double | marker_min_temp |
double | low_mu_fill_population |
double | time |
Current simulation time. More... | |
int | gstep |
Current time step. More... | |
bool | multirate_timestepping |
Use multirate timestepping. More... | |
int | mr_factor |
double | mr_psi_max |
maximum normalized psi value of each multirate region More... | |
int | mstep_rmp_es |
int | mstep_rmp_em |
int | rmp_es_to_em_dt_ratio |
Ratio of EM to ES time step size in RMP penetration calculation. More... | |
bool | use_em_bounds |
bool | em_exclude_private |
double | bd_ext_delta_Ai |
double | bd_ext_delta_Ao |
bool | cce_coupling_on |
Core-edge coupling flag. More... | |
bool | use_unfused_electron_push_kernel |
bool | loop_voltage_on |
Inductive current drive: loop voltage (from Faraday's law curl(E)=-dB/dt) More... | |
bool | loop_voltage_fsa |
Make loop voltage and current drive flux-functions if true (default: true) More... | |
double | loop_voltage |
double | loop_voltage_psimax |
Inductive current drive: outer boundary (in pol. flux) of the loop voltage. More... | |
bool | current_drive_on |
double | current_drive_p |
Current drive PID controller: factor for proportional controller ( \(P\)) More... | |
double | current_drive_i |
Current drive PID controller: factor for integral controller ( \(I\)) More... | |
double | current_drive_d |
Current drive PID controller: factor for derivative controller ( \(D\)) More... | |
int | mode_select_mode |
double | mode_select_inpsi |
double | mode_select_outpsi |
double | mode_select_bd_width |
Static Public Attributes | |
static constexpr bool | is_XGCa = true |
Equivalent to the preprocessor flag for now. More... | |
static constexpr bool | reduced_deltaf = false |
Equivalent to the preprocessor flag for now. More... | |
static constexpr bool | separate_n0 = true |
Equivalent to the preprocessor flag for now. More... | |
static constexpr bool | explicit_electromagnetic = false |
Equivalent to the preprocessor flag for now. More... | |
static constexpr bool | old_f0_update_analytic = false |
Equivalent to the preprocessor flag for now. More... | |
static constexpr int | nhybrid = 2 |
Number of iterations in electrostatic electron weight evolution scheme. More... | |
Simulation< Device >::Simulation | ( | NLReader::NamelistReader & | nlr, |
double | transit_time_in = 1.0 , |
||
double | psi_norm = 1.0 |
||
) |
int Simulation< Device >::add_pot0 |
Set the potential on the solver boundary equal to the flux-surface
!! averaged potential (implies \(\delta\phi_wall=0\)). !! This is supposed to prevent a sheath-like potential drop at the mesh !! boundary and make sure that the logical sheath model takes care of !! the sheath physics. Also, it should prevent \(\delta\phi/\phi\sim1\). Additional electrostatic potential: (0) for off, (1) for reading data from file !! (2) for simple neoclassical axisymmetric field (not operational)
double Simulation< Device >::bd_ext_delta_Ai |
double Simulation< Device >::bd_ext_delta_Ao |
int Simulation< Device >::bounce |
Bounce routine switch 0 for off, 1 for inner boundary, 2 for both boundaries.
double Simulation< Device >::bounce_buffer |
Buffer width between sml_outpsi and where the particle actually bounces (must be >=0)
int Simulation< Device >::bounce_zero_weight |
If ==1 and bounce>0, set particle weights to zero after bouncing from the outer boundary.
bool Simulation< Device >::cce_coupling_on |
Core-edge coupling flag.
double Simulation< Device >::current_drive_d |
Current drive PID controller: factor for derivative controller ( \(D\))
double Simulation< Device >::current_drive_i |
Current drive PID controller: factor for integral controller ( \(I\))
bool Simulation< Device >::current_drive_on |
Whether to use dynamic current drive via adjustments of the loop voltage ! The controller output is implemented as ! \(V_{loop} = 2\pi R \eta_\parallel P \left[\Delta j_\parallel + I \int_0^t \Delta j_\parallel \mathrm{d}\tau + D \frac{\partial \Delta j_\parallel}{\partial t} \right] \) ! Time integral and derivative are with respect to the ion time step instead of time, so \(1/I\) is the integration time scale, ! and \(D\) is the derivative time scale
double Simulation< Device >::current_drive_p |
Current drive PID controller: factor for proportional controller ( \(P\))
bool Simulation< Device >::diag_heat_on |
Use heat diagnostics in sheath.
bool Simulation< Device >::diff_on |
bool Simulation< Device >::dpot_bd_apply |
Damp (n=0,m>0) potential towards the magnetic axis.
double Simulation< Device >::dpot_bd_width |
Decay length (normalized flux) for (n=0,m>0) potential towards the magnetic axis.
double Simulation< Device >::dpot_te_limit |
Max absolute value of dpot/temp in getf0.
bool Simulation< Device >::drift_on |
Toggle for using drift.
double Simulation< Device >::dt |
Time step (s)
bool Simulation< Device >::dwdt_exb_only |
bool Simulation< Device >::dwdt_fix_bg |
bool Simulation< Device >::electron_on |
Use kinetic electrons.
bool Simulation< Device >::em_b_para_eff |
Effective dB_|| via a modified grad-B drift (Joiner et al., PoP, 2010)
bool Simulation< Device >::em_control_variate |
Switch for use of control variate method.
bool Simulation< Device >::em_control_variate_final_cv |
bool Simulation< Device >::em_control_variate_flag |
int Simulation< Device >::em_control_variate_niter |
Number of iterations for Ampere solve with control-variate method.
bool Simulation< Device >::em_dAsdt_filter_on |
Switch for applying Fourier filters on RHS of dAs/dt equation (pullback mode 4)
bool Simulation< Device >::em_dAsdt_hypvis |
Use radial hyperviscosity in dA_s/dt (push_As)
bool Simulation< Device >::em_es_step |
If true, the ES algorithm will be used within the EM code (details in XGC_core/module.F90)
bool Simulation< Device >::em_exclude_private |
bool Simulation< Device >::em_mixed_variable |
Switch for use of mixed-variable formulation.
bool Simulation< Device >::em_n0 |
Include n=0 electromagnetic mode.
double Simulation< Device >::em_pullback_dampfac |
Damping term gamma on -b.grad(phi) in pullback mode 4.
int Simulation< Device >::em_pullback_mode |
(0) ??? (1) ??? (2) ??? (3) mixed-variable pullback with dA_s/dt=0, (4) pullback using Ohm's law dA_s/dt + b.grad(phi) = 0 (5) pullback using dA_s/dt + b.grad(phi) = -eta*j
bool Simulation< Device >::em_use_dpot_te_limit |
In EM simulation: whether to force usage of the min-max limiter on the turbulent potential fluctuation.
bool Simulation< Device >::exclude_private |
Whether to exclude private region in ion charge deposition.
|
static |
Equivalent to the preprocessor flag for now.
double Simulation< Device >::f0_grid_alpha |
Fraction of the particle weight that is transferred to the background distribution function (particle noise control) every sml_f_source_period time steps. As a rule of thumb, sml_f0_grid_alpha=sml_dt*sml_f_source_period can be used.
int Simulation< Device >::f0_grid_alpha_start |
For delayed onset of total-f particle noise control. (must be >=1) Values >1 cause a linear ramp-up of sml_f0_grid_alpha from 0 to its input value from time step 1 to sml_f0_grid_alpha_start.
bool Simulation< Device >::f0_update_analytic |
Switch on/off the update of the analytic part of the distribution function
double Simulation< Device >::f0_update_analytic_alpha |
Separate alpha from sml_f0_grid_alpha for Maxwellian contribution.
double Simulation< Device >::f0_update_analytic_damp_width |
For width of \(\exp^{-(x/w)^2}\) damping factor for updating density/temperature of the analytical f0
bool Simulation< Device >::f0_update_analytic_local |
If .false. –> flux-surface average update, .true. –> local.
bool Simulation< Device >::field_aligned_initial |
bool Simulation< Device >::field_solver_on =true |
If false, charge deposition and field solve is skipped.
bool Simulation< Device >::flat_marker |
double Simulation< Device >::flat_marker_cutoff1 |
double Simulation< Device >::flat_marker_cutoff2 |
double Simulation< Device >::flat_marker_decay_start1 |
double Simulation< Device >::flat_marker_decay_start2 |
double Simulation< Device >::flat_marker_width1 |
double Simulation< Device >::flat_marker_width2 |
bool Simulation< Device >::grad_psitheta |
If true, gradiant operator is calculated as \((\hat{\boldsymbol{\psi}}\cdot\nabla,\hat{\boldsymbol{\theta}}^\ast)\cdot\nabla\) instead of \((R,Z)\) coordinates.
int Simulation< Device >::gstep |
Current time step.
bool Simulation< Device >::helmholtz_spectral |
Whether to solve Helmholtz-type equations with toroidally spectral solver.
bool Simulation< Device >::heuristic_priv_pot |
Override the Poisson solver in the private region and replace the solution by !! the separatrix potential scaled with the initial electron temperature
bool Simulation< Device >::ignore_f0g |
Ignore f0g in f0 calculation. When true, it skips the update of den_f0_h, instead using the initialized value (which is zero). This is helpful to density conservation of heating when f0g is noisy due to insufficient number of particles.
double Simulation< Device >::initial_deltaf_noise |
|
static |
Equivalent to the preprocessor flag for now.
bool Simulation< Device >::iter_solver |
For sml_poisson_solver_type=0: Split Poisson equation into axisymmetric and !! non-axisymmetric parts. The axisymmetric part has the !! flux-surface averaged potential on the RHS. Solve !! iteratively by lagging the RHS potential by one !! iteration. Stop after sml_iter_solver_niter iterations. !! If .false., split Poisson equation into !! flux-surface averaged part and rest (assuming that the !! polarization term commutes with the flux-surface !! average) and the rest; solve in two steps.
bool Simulation< Device >::iter_solver_converge |
If .true., keep taking iterations in PETSc until termination criteria is met, !! i.e. until a residual tolerance is reached or it is determined that the iterations !! have diverged or exceeded sml_iter_solver_max_it. If .false., take a fixed number !! of iterations set from sml_iter_solver_niter.
bool Simulation< Device >::limit_marker_den |
Whether to limit marker density.
double Simulation< Device >::loop_voltage |
Initial value for the loop-voltage ! Positive loop voltage corresponds to an electron torque opposite to the toroidal ! direction (clockwise looking down on the torus, i.e. in negative Z-direction).
bool Simulation< Device >::loop_voltage_fsa |
Make loop voltage and current drive flux-functions if true (default: true)
bool Simulation< Device >::loop_voltage_on |
Inductive current drive: loop voltage (from Faraday's law curl(E)=-dB/dt)
double Simulation< Device >::loop_voltage_psimax |
Inductive current drive: outer boundary (in pol. flux) of the loop voltage.
double Simulation< Device >::low_mu_fill_population |
double Simulation< Device >::marker_min_temp |
double Simulation< Device >::marker_temp_factor |
double Simulation< Device >::marker_temp_factor2 |
double Simulation< Device >::marker_temp_factor3 |
double Simulation< Device >::mode_select_bd_width |
double Simulation< Device >::mode_select_inpsi |
int Simulation< Device >::mode_select_mode |
double Simulation< Device >::mode_select_outpsi |
int Simulation< Device >::mr_factor |
multirate timestepping for core region ions; mr_ratio (> 1) is the
factor used to accelerate the core region physics.
double Simulation< Device >::mr_psi_max |
maximum normalized psi value of each multirate region
int Simulation< Device >::mstep |
Max number of time steps.
int Simulation< Device >::mstep_rmp_em |
Number of electromagnetic time steps for RMP penetration calculation with damped Newton iteration
int Simulation< Device >::mstep_rmp_es |
Number of electrostatic time steps for RMP penetration calculation with damped Newton iteration
bool Simulation< Device >::multirate_timestepping |
Use multirate timestepping.
bool Simulation< Device >::neutrals |
Toggle for using neutrals.
|
static |
Number of iterations in electrostatic electron weight evolution scheme.
bool Simulation< Device >::no_fp_in_f |
If .true. the distribution function used for the source routines will not include particle information (only for testing)
bool Simulation< Device >::no_turb |
Set all non-axisymmetric field perturbations to zero (electromagnetic version only)
int Simulation< Device >::nrk |
Order of Runge-Kutta time integration of particles + fields.
int Simulation< Device >::nthreads |
Number of OMP threads on the host.
|
static |
Equivalent to the preprocessor flag for now.
bool Simulation< Device >::poisson_adia_wall |
EXPERIMENTAL! DON'T USE UNLESS ADVISED BY AN EXPERT.
bool Simulation< Device >::poisson_bias |
Whether to use a (0,0) bias potential on top of phi_00.
bool Simulation< Device >::poisson_natural_boundary |
int Simulation< Device >::poisson_solver_type |
(0) Simple axisymmetric Poisson solver (single equation) !! (–> see sml_iter_solver) !! (1) Linear Poisson equation for the axisymmetric !! potential (as in sml_iter_solver=.true.) but !! with constraint equation for the flux-surface averaged !! potential on the RHS. Solved with Schur complement solver. !! Much faster and accurate than the iterative solver, but !! causes instability in simulations with open field-lines. !! (2) Non-linear Poisson equation
bool Simulation< Device >::positive_phi00_sol |
EXPERIMENTAL! DON'T USE UNLESS ADVISED BY AN EXPERT !! If true, makes sure that \(\langle\phi\rangle > 0\) in SOL and !! private flux region by adding a constant to \(\phi\)
bool Simulation< Device >::ptb_3db_on |
Toggle for ptb_3db.
|
static |
Equivalent to the preprocessor flag for now.
bool Simulation< Device >::resamp_for_final_restart_write |
Perform resampling before dumping the final restart file.
bool Simulation< Device >::resamp_on |
Do resampling.
bool Simulation< Device >::resamp_restart_read |
Whether to read a restart file written from a simulation with different grid.
int Simulation< Device >::rmp_es_to_em_dt_ratio |
Ratio of EM to ES time step size in RMP penetration calculation.
|
static |
Equivalent to the preprocessor flag for now.
bool Simulation< Device >::sheath_adjust |
Whether to adjust the sheath.
int Simulation< Device >::sheath_mode |
Type of sheath (0 is none)
int Simulation< Device >::special |
Special run (eg single particle, poincare)
bool Simulation< Device >::split_weight_scheme |
Whether to use the split-weight scheme.
bool Simulation< Device >::symmetric_f |
Enforce axisymmetry of the total distribution function on the grid.
bool Simulation< Device >::thermal_bath_on |
Switch on thermal-bath and coarse-graining operation, see ccm_param parameters.
double Simulation< Device >::time |
Current simulation time.
double Simulation< Device >::transit_time |
Torodial transit time of an ion with the characteristic energy.
double Simulation< Device >::update_g_alpha |
Fraction of the numerical marker particle density that is transferred to the g2
bool Simulation< Device >::update_poisson_solver |
Whether poisson solver is updated.
bool Simulation< Device >::use_em_bounds |
bool Simulation< Device >::use_unfused_electron_push_kernel |
bool Simulation< Device >::xz_00_up |
Use upper region of xz when obtaining 00 mode.