ASCOT5
Loading...
Searching...
No Matches
simulate_gc_adaptive.h File Reference

Header file for simulate_gc_adaptive.c. More...

#include "../ascot5.h"
#include "../simulate.h"
#include "../particle.h"

Go to the source code of this file.

Data Structures

struct  Crossing
 
struct  Acceleration
 

Functions

void recalculate_acceleration (Acceleration *acc, sim_data *sim, particle_simd_gc *p, particle_simd_gc *p0)
 
void simulate_gc_adaptive (particle_queue *pq, sim_data *sim)
 Simulates guiding centers using adaptive time-step.
 

Detailed Description

Header file for simulate_gc_adaptive.c.

Definition in file simulate_gc_adaptive.h.

Function Documentation

◆ recalculate_acceleration()

void recalculate_acceleration ( Acceleration * acc,
sim_data * sim,
particle_simd_gc * p,
particle_simd_gc * p0 )

Recalculate acceleration factor.

The acceleration is updated when crossing OMP. During the first crossing, the counter for orbit time is started. For the next crossing, we check if OMP was crossed in the same direction as first. If not, the crossing is ignored and for the third crossing we check the direction again. If this is not in the same direction as the first, the counters are nullified, acceleration is set to one, and the process is started again. This way we can account both for passing and banana particles, and for the cases where collisions have changed the orbit topology.

When we have two suitable crossings, the acceleration factor is updated and the counter for the orbit time and crossings are nullified.

Definition at line 385 of file simulate_gc_adaptive.c.

◆ simulate_gc_adaptive()

void simulate_gc_adaptive ( particle_queue * pq,
sim_data * sim )

Simulates guiding centers using adaptive time-step.

The simulation includes:

  • orbit-following with Cash-Karp method
  • Coulomb collisions with Milstein method

The simulation is carried until all marker have met some end condition or are aborted/rejected. The final state of the markers is stored in the given marker array. Other output is stored in the diagnostic array.

The adaptive time-step is determined by integrator error tolerances as well as user-defined limits for how much marker state can change during a single time-step.

Parameters
pqparticles to be simulated
simsimulation data

Definition at line 55 of file simulate_gc_adaptive.c.