Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross species collisions #200

Merged
merged 34 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
28905e0
Port changes to MPI.Init() call.
mrhardman Mar 28, 2024
21e8c21
Add element boundaries to coord struct for use in Lagrange interpolat…
mrhardman Mar 28, 2024
2478e3e
Add facility to interpolate and extrapolate pdf data from one grid to…
mrhardman Mar 28, 2024
b8fe031
Merge branch 'master' into cross-species-collisions
mrhardman Apr 10, 2024
77cd751
Correct normalised collision frequency documentation to normalise cor…
mrhardman Apr 10, 2024
6be6187
Add special Fokker-Planck collision operator function to mock up fast…
mrhardman Apr 10, 2024
658fd1c
Add numerical density conserving term for the cross collision operator.
mrhardman Apr 10, 2024
6250380
New initial condition option to mock up an isotropic beam in vpa vper…
mrhardman Apr 10, 2024
bb2333f
Merge branch 'refactor-collision-inputs' into cross-species-collisions
mrhardman Apr 12, 2024
3ced39e
Bugfix for extracting input collision frequency following merge.
mrhardman Apr 12, 2024
093e93f
Update example input files following merge.
mrhardman Apr 12, 2024
d999c74
Additional velocity space initial condition for looking at anisotropi…
mrhardman Apr 12, 2024
24abc22
Include Zsprime^2 factor from gamma_ssprime in the cross collision op…
mrhardman Apr 12, 2024
202b6fa
Remove excess ::
mrhardman Apr 12, 2024
4ef9014
Bugfix for ZZ.
mrhardman Apr 12, 2024
5961076
Extract self-collisions code from cross-collision operator to improve…
mrhardman Apr 15, 2024
d38b90b
Add test which explicitly tests the new function for slowing-down col…
mrhardman Apr 15, 2024
a63f860
Add additional options to the Fokker Planck operator for physics test…
mrhardman Apr 15, 2024
f65699d
Make beam initial condition options more flexible.
mrhardman Apr 15, 2024
d83da15
Merge branch 'new_ion_source_options' into cross-species-collisions
mrhardman Apr 17, 2024
8c5ec06
Merge branch 'refactor-collision-inputs' into cross-species-collisions
mrhardman Apr 17, 2024
6e92bde
Additional plots of f(vpa,vperp) to aid diagnosis of slowing down sim…
mrhardman Apr 17, 2024
e7fc149
Reinstate normalisation factor for alpha source.
mrhardman Apr 18, 2024
bc63e28
Minor refactor of external sink term.
mrhardman Apr 22, 2024
8e5b91b
Correct the definition of the normalised collision frequency. Note th…
mrhardman Apr 22, 2024
5944a81
Addition of "beam" and "beam-with-losses" options to external sources…
mrhardman Apr 24, 2024
0b03e9b
Changes to make the Z of the evolved species an input parameter for t…
mrhardman Apr 24, 2024
8f3e242
Merge branch 'refactor-collision-inputs' into cross-species-collisions
mrhardman Apr 24, 2024
939275a
Change default Zi for collisions to be unity.
mrhardman Apr 24, 2024
a8d699b
Delete commented code.
mrhardman Apr 24, 2024
fbbca03
Merge branch 'master' into cross-species-collisions
mrhardman Apr 25, 2024
a5de74a
Merge branch 'master' into cross-species-collisions
johnomotani Apr 26, 2024
cc91689
Example slowing-down input file with source-sink behaviour, beam init…
mrhardman Apr 29, 2024
959cb63
Merge branch 'master' into cross-species-collisions
mrhardman Apr 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ charge_exchange_frequency = 0.0
ionization_frequency = 0.0
constant_ionization_rate = false

nstep = 200000
dt = 1.0e-3
nwrite = 50
nwrite_dfns = 50
use_semi_lagrange = false
n_rk_stages = 4
split_operators = false
z_ngrid = 1
z_nelement = 1
z_nelement_local = 1
Expand Down Expand Up @@ -64,3 +57,9 @@ use_fokker_planck = true
# nuii sets the normalised input C[F,F] Fokker-Planck collision frequency
nuii = 1.0
frequency_option = "manual"

[timestepping]
nstep = 200000
dt = 1.0e-3
nwrite = 50
nwrite_dfns = 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# cheap input file for a 0D2V relaxation to a collisional Maxwellian distribution with self-ion collisions.
n_ion_species = 1
n_neutral_species = 0
electron_physics = "boltzmann_electron_response"
evolve_moments_density = false
evolve_moments_parallel_flow = false
evolve_moments_parallel_pressure = false
evolve_moments_conservation = false
T_e = 1.0
T_wall = 1.0
initial_density1 = 0.5
initial_temperature1 = 1.0
initial_density2 = 0.5
initial_temperature2 = 1.0
z_IC_option1 = "sinusoid"
z_IC_density_amplitude1 = 0.001
z_IC_density_phase1 = 0.0
z_IC_upar_amplitude1 = 0.0
z_IC_upar_phase1 = 0.0
z_IC_temperature_amplitude1 = 0.0
z_IC_temperature_phase1 = 0.0
z_IC_option2 = "sinusoid"
z_IC_density_amplitude2 = 0.001
z_IC_density_phase2 = 0.0
z_IC_upar_amplitude2 = 0.0
z_IC_upar_phase2 = 0.0
z_IC_temperature_amplitude2 = 0.0
z_IC_temperature_phase2 = 0.0
vpa_IC_option1 = "isotropic-beam"
#vpa_IC_option1 = "directed-beam"
#vpa_IC_v01 =
#vpa_IC_vth0 =
#vpa_IC_vpa0 =
#vpa_IC_vperp0 =
charge_exchange_frequency = 0.0
ionization_frequency = 0.0
constant_ionization_rate = false
z_ngrid = 1
z_nelement = 1
z_nelement_local = 1
z_bc = "wall"
z_discretization = "chebyshev_pseudospectral"
r_ngrid = 1
r_nelement = 1
r_nelement_local = 1
r_bc = "periodic"
r_discretization = "chebyshev_pseudospectral"
vpa_ngrid = 5
vpa_nelement = 32
vpa_L = 6.0
vpa_bc = "zero"
vpa_discretization = "gausslegendre_pseudospectral"
vperp_ngrid = 5
vperp_nelement = 16
vperp_L = 3.0
vperp_discretization = "gausslegendre_pseudospectral"
# Fokker-Planck operator requires the "gausslegendre_pseudospectral
# options for the vpa and vperp grids

[fokker_planck_collisions]
# nuii sets the normalised input C[F,F] Fokker-Planck collision frequency
nuii = 1.0
slowing_down_test = true
frequency_option = "manual"
use_fokker_planck = true

[timestepping]
nstep = 1000
dt = 1.0e-5
nwrite = 50
nwrite_dfns = 50
65 changes: 65 additions & 0 deletions examples/fokker-planck/fokker-planck-relaxation-slowing-down.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# cheap input file for a 0D2V relaxation to a collisional Maxwellian distribution with self-ion collisions.
n_ion_species = 1
n_neutral_species = 0
electron_physics = "boltzmann_electron_response"
evolve_moments_density = false
evolve_moments_parallel_flow = false
evolve_moments_parallel_pressure = false
evolve_moments_conservation = false
T_e = 1.0
T_wall = 1.0
initial_density1 = 0.5
initial_temperature1 = 1.0
initial_density2 = 0.5
initial_temperature2 = 1.0
z_IC_option1 = "sinusoid"
z_IC_density_amplitude1 = 0.001
z_IC_density_phase1 = 0.0
z_IC_upar_amplitude1 = 0.0
z_IC_upar_phase1 = 0.0
z_IC_temperature_amplitude1 = 0.0
z_IC_temperature_phase1 = 0.0
z_IC_option2 = "sinusoid"
z_IC_density_amplitude2 = 0.001
z_IC_density_phase2 = 0.0
z_IC_upar_amplitude2 = 0.0
z_IC_upar_phase2 = 0.0
z_IC_temperature_amplitude2 = 0.0
z_IC_temperature_phase2 = 0.0
charge_exchange_frequency = 0.0
ionization_frequency = 0.0
constant_ionization_rate = false
z_ngrid = 1
z_nelement = 1
z_nelement_local = 1
z_bc = "wall"
z_discretization = "chebyshev_pseudospectral"
r_ngrid = 1
r_nelement = 1
r_nelement_local = 1
r_bc = "periodic"
r_discretization = "chebyshev_pseudospectral"
vpa_ngrid = 5
vpa_nelement = 32
vpa_L = 6.0
vpa_bc = "zero"
vpa_discretization = "gausslegendre_pseudospectral"
vperp_ngrid = 5
vperp_nelement = 16
vperp_L = 3.0
vperp_discretization = "gausslegendre_pseudospectral"
# Fokker-Planck operator requires the "gausslegendre_pseudospectral
# options for the vpa and vperp grids

[fokker_planck_collisions]
# nuii sets the normalised input C[F,F] Fokker-Planck collision frequency
nuii = 1.0
slowing_down_test = true
frequency_option = "manual"
use_fokker_planck = true

[timestepping]
nstep = 1000
dt = 1.0e-5
nwrite = 50
nwrite_dfns = 50
1 change: 0 additions & 1 deletion examples/fokker-planck/fokker-planck-relaxation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ nstep = 5000
dt = 1.0e-2
nwrite = 5000
nwrite_dfns = 5000
split_operators = false
2 changes: 1 addition & 1 deletion moment_kinetics/src/communication.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function __init__()
if !MPI.Initialized()
MPI.Init()
end

comm_world.val = MPI.COMM_WORLD.val

global_rank[] = MPI.Comm_rank(comm_world)
Expand Down
3 changes: 2 additions & 1 deletion moment_kinetics/src/coordinates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ function define_coordinate(input, parallel_io::Bool=false; run_directory=nothing
cell_width, igrid, ielement, imin, imax, igrid_full, input.discretization, input.fd_option, input.cheb_option,
input.bc, wgts, uniform_grid, duniform_dgrid, scratch, copy(scratch), copy(scratch),
scratch_2d, copy(scratch_2d), advection, send_buffer, receive_buffer, input.comm,
local_io_range, global_io_range, element_scale, element_shift, input.element_spacing_option, element_boundaries)
local_io_range, global_io_range, element_scale, element_shift, input.element_spacing_option,
element_boundaries)

if coord.n == 1 && occursin("v", coord.name)
spectral = null_velocity_dimension_info()
Expand Down
Loading
Loading