ASCOT5
Loading...
Searching...
No Matches
Functions
simulate_gc_fixed.c File Reference

Simulate guiding centers using fixed time-step. More...

#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#include <math.h>
#include "../ascot5.h"
#include "../endcond.h"
#include "../consts.h"
#include "../physlib.h"
#include "../simulate.h"
#include "../particle.h"
#include "../wall.h"
#include "../diag.h"
#include "../B_field.h"
#include "../E_field.h"
#include "../plasma.h"
#include "simulate_gc_fixed.h"
#include "step/step_gc_rk4.h"
#include "mccc/mccc.h"

Go to the source code of this file.

Functions

real simulate_gc_fixed_inidt (sim_data *sim, particle_simd_gc *p, int i)
 Calculates time step value.
 
void simulate_gc_fixed (particle_queue *pq, sim_data *sim)
 Simulates guiding centers using fixed time-step.
 

Detailed Description

Simulate guiding centers using fixed time-step.

Definition in file simulate_gc_fixed.c.

Function Documentation

◆ simulate_gc_fixed_inidt()

real simulate_gc_fixed_inidt ( sim_data * sim,
particle_simd_gc * p,
int i )

Calculates time step value.

The time step is calculated as a user-defined fraction of gyro time, whose formula accounts for relativity, or an user defined value is used as is depending on simulation options.

Parameters
simpointer to simulation data struct
pSIMD array of markers
iindex of marker for which time step is assessed
Returns
Calculated time step

Definition at line 178 of file simulate_gc_fixed.c.

◆ simulate_gc_fixed()

void simulate_gc_fixed ( particle_queue * pq,
sim_data * sim )

Simulates guiding centers using fixed time-step.

The simulation includes:

  • orbit-following with RK4 method
  • Coulomb collisions with Euler-Maruyama method

The simulation is carried until all markers 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 time-step is user-defined either directly or as a fraction of gyrotime.

Parameters
pqparticles to be simulated
simsimulation data

Definition at line 46 of file simulate_gc_fixed.c.