Graph Framework
|
Tests for math nodes. More...
Functions | |
template<jit::float_scalar T> | |
void | test_constant () |
Constant Test. | |
template<solver::method SOLVER> | |
void | test_bohm_gross (const typename SOLVER::base tolarance) |
Bohm-Gross Test. | |
template<solver::method SOLVER> | |
void | test_light_wave (const typename SOLVER::base tolarance) |
Light wave Test. | |
template<jit::float_scalar T> | |
void | test_acoustic_wave (const T tolarance) |
Ion acoustic wave Test. | |
template<jit::float_scalar T> | |
void | test_o_mode_wave () |
O Mode Test. | |
template<jit::float_scalar T> | |
void | test_cold_plasma_cutoffs () |
Cold Plasma Dispersion Relation Right Cutoff Frequency. | |
template<jit::float_scalar T> | |
void | test_reflection (const T tolarance, const T n0, const T x0, const T kx0) |
Reflection test. | |
template<jit::float_scalar T> | |
void | test_efit () |
Efit equilibrium test. | |
template<jit::float_scalar T> | |
void | run_tests (const T tolarance) |
Run tests with a specified backend. | |
int | main (int argc, const char *argv[]) |
Main program of the test. | |
Tests for math nodes.
int main | ( | int | argc, |
const char * | argv[] | ||
) |
Main program of the test.
[in] | argc | Number of commandline arguments. |
[in] | argv | Array of commandline arguments. |
void run_tests | ( | const T | tolarance | ) |
Run tests with a specified backend.
T | Base type of the calculation. |
[in] | tolarance | Tolarance to solver the dispersion function to. |
void test_acoustic_wave | ( | const T | tolarance | ) |
Ion acoustic wave Test.
In the ion-wave dispersion relation, the group velocity should be.
vg = vs^2*k/⍵ (1)
Where vs is the sound speed.
vs = sqrt((kb*Te - ɣ*kb*ti)/mi) (2)
The wave number is constant in time.
k(t) = 0 (3)
The slope of the wave trajectory is vs
dx/dt = vs^2 (4)
T | Base type of the calculation. |
[in] | tolarance | Tolarance to solver the dispersion function to. |
void test_bohm_gross | ( | const typename SOLVER::base | tolarance | ) |
Bohm-Gross Test.
In the bohm-gross dispersion relation, the group velocity should be.
vg = 3/2*vth^2*k/⍵ (1)
Where vth is the thermal velocity.
vth = sqrt(2*kb*T/m) (2)
The wave number varies with time.
k(t) = -⍵pe'(x)/(2⍵)*t + k0 (3)
Where ⍵pe is the plasma frequency.
⍵pe2 = q^2*n(x))/(ϵ0*m) (4)
For a linear gradient in the density ⍵pe2'(x) is a constant.
⍵pe2' = ne0*q^2*0.1/(ϵ0*m) (5)
k0 must be a solution of the dispersion relation.
k0 = sqrt(3/2(⍵^2 - ⍵pe^2)/vth^2) (6)
Putting equation 3 into 1 yields the group velocity as a function of time.
vg(t) = -3/2*vth^2/⍵*⍵pe'(x)/(2⍵)*t + 3/2*vth^2/⍵*k0 (7)
This expression can be integrated to find a parabolic ray trajectory.
x(t) = -3/8*vth^2/⍵*⍵pe'(x)/⍵*t^2 + 3/2*vth^2/⍵*k0*t + x0 (8)
B = 0 or k || B
SOLVER | Class of solver to use. |
[in] | tolarance | Tolarance to solver the dispersion function to. |
void test_cold_plasma_cutoffs | ( | ) |
Cold Plasma Dispersion Relation Right Cutoff Frequency.
There are two branches on the dispersion relation. The O-Mode branch can propagate past the right cuttoff and the upper hybrid resonance but is cut off at the Plasma frequency. The x-mode is cut off by the right cutoff for frequencies above and trapped between the left and cutoff and the upper hybird resonance.
T | Base type of the calculation. |
void test_constant | ( | ) |
Constant Test.
A wave in no medium with a constant phase velocity should propagate such that
k.x - wt = Constant
T | Base type of the calculation. |
void test_efit | ( | ) |
Efit equilibrium test.
T | Base type of the calculation. |
void test_light_wave | ( | const typename SOLVER::base | tolarance | ) |
Light wave Test.
In the bohm-gross dispersion relation, the group velocity should be.
vg = c^2*k/⍵ (1)
Where c is the speed of light. The wave number varies with time.
k(t) = -⍵pe'(x)/(2⍵)*t + k0 (3)
Where ⍵pe is the plasma frequency.
⍵pe2 = q^2*n(x))/(ϵ0*m) (4)
For a linear gradient in the density ⍵pe2'(x) is a constant.
⍵pe2' = ne0*q^2*0.1/(ϵ0*m) (5)
k0 must be a solution of the dispersion relation.
k0 = sqrt((⍵^2 - ⍵pe^2)/c^2) (6)
Putting equation 3 into 1 yields the group velocity as a function of time.
vg(t) = -c^2/⍵*⍵pe'(x)/(2⍵)*t + c^2/⍵*k0 (7)
This expression can be integrated to find a parabolic ray trajectory.
x(t) = -1/4*c^2/⍵*⍵pe'(x)/⍵*t^2 + c^2/⍵*k0*t + x0 (8)
B = 0
SOLVER | Class of solver to use. |
[in] | tolarance | Tolarance to solver the dispersion function to. |
void test_o_mode_wave | ( | ) |
O Mode Test.
For a linear density gradient, the O-Mode cut off should be located at
1 - ⍵pe^2(x)/⍵^2 = 0 (1)
⍵^2 - 1 = ⍵pe^2 (2)
The plasma frequency is defined as
⍵pe^2 = ne0*q^2/(ϵ0*m)*(0.1*x + 1) (3)
Putting equation 3 into 2 yields
⍵^2 - 1 = ne0*q^2/(ϵ0*m)*(0.1*x + 1) (4)
Solving for x
(⍵^2 - 1 - ne0*q^2/(ϵ0*m))/(ne0*q^2/(ϵ0*m)*0.1) = x (5)
T | Base type of the calculation. |
void test_reflection | ( | const T | tolarance, |
const T | n0, | ||
const T | x0, | ||
const T | kx0 | ||
) |
Reflection test.
Given a wave frequency, a wave with zero k will not propagate.
T | Base type of the calculation. |
[in] | tolarance | Tolarance to solver the dispersion function to. |
[in] | n0 | Starting nz value. |
[in] | x0 | Starting x guess. |
[in] | kx0 | Starting kx guess. |