diff --git a/examples/fokker-planck-1D2V/fokker-planck-1D2V-even_nz-shorttest-nstep200.toml b/examples/fokker-planck-1D2V/fokker-planck-1D2V-even_nz-shorttest-nstep200.toml index 7422ef0b0..9f56e39db 100644 --- a/examples/fokker-planck-1D2V/fokker-planck-1D2V-even_nz-shorttest-nstep200.toml +++ b/examples/fokker-planck-1D2V/fokker-planck-1D2V-even_nz-shorttest-nstep200.toml @@ -1,47 +1,11 @@ -#use_manufactured_solns_for_init = true -#use_manufactured_solns_for_advance = false -n_ion_species = 1 -n_neutral_species = 0 -electron_physics = "boltzmann_electron_response" -#electron_physics = "boltzmann_electron_response_with_simple_sheath" evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = false -#force_Er_zero_at_wall = false #true -#epsilon_offset = 0.1 -#use_vpabar_in_mms_dfni = true -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 = 1.0 constant_ionization_rate = true -nstep = 200 -dt = 1.0e-4 -nwrite = 1000 -nwrite_dfns = 1000 -use_semi_lagrange = false -n_rk_stages = 4 -split_operators = false z_ngrid = 5 z_nelement = 16 #z_nelement_local = 2 @@ -67,31 +31,34 @@ vperp_L = 3.0 #vperp_discretization = "chebyshev_pseudospectral" vperp_discretization = "gausslegendre_pseudospectral" -#vz_ngrid = 17 -#vz_nelement = 4 -#vz_L = 12.0 -#vz_bc = "periodic" -#vz_discretization = "chebyshev_pseudospectral" - -#vr_ngrid = 17 -#vr_nelement = 4 -#vr_L = 12.0 -#vr_bc = "periodic" -#vr_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +#electron_physics = "boltzmann_electron_response_with_simple_sheath" +T_e = 1.0 +T_wall = 1.0 -#vzeta_ngrid = 17 -#vzeta_nelement = 4 -#vzeta_L = 12.0 -#vzeta_bc = "periodic" -#vzeta_discretization = "chebyshev_pseudospectral" +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 -#[ion_numerical_dissipation] -#vpa_dissipation_coefficient = 0.0 -#vperp_dissipation_coefficient = 0.0 -#z_dissipation_coefficient = 0.1 -#r_dissipation_coefficient = 0.0 +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 [fokker_planck_collisions] use_fokker_planck = true nuii = 1.0 frequency_option = "manual" + +[timestepping] +nstep = 50 +dt = 1.0e-4 +nwrite = 10 +nwrite_dfns = 10 diff --git a/examples/fokker-planck/fokker-planck-relaxation-report-resolutions.toml b/examples/fokker-planck/fokker-planck-relaxation-report-resolutions.toml index 3c11ac2d6..b79376025 100644 --- a/examples/fokker-planck/fokker-planck-relaxation-report-resolutions.toml +++ b/examples/fokker-planck/fokker-planck-relaxation-report-resolutions.toml @@ -1,31 +1,8 @@ # 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 @@ -53,6 +30,27 @@ vperp_bc = "zero" # Fokker-Planck operator requires the "gausslegendre_pseudospectral # options for the vpa and vperp grids +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + + [fokker_planck_collisions] use_fokker_planck = true # nuii sets the normalised input C[F,F] Fokker-Planck collision frequency diff --git a/examples/fokker-planck/fokker-planck-relaxation-slowing-down-alphas.toml b/examples/fokker-planck/fokker-planck-relaxation-slowing-down-alphas.toml index e6b75e29c..f6bccbe51 100644 --- a/examples/fokker-planck/fokker-planck-relaxation-slowing-down-alphas.toml +++ b/examples/fokker-planck/fokker-planck-relaxation-slowing-down-alphas.toml @@ -1,28 +1,9 @@ # cheap input file for a 0D2V relaxation to a collisional Maxwellian distribution with self-ion collisions and collisions with fixed Maxwellian background of cold ions and electrons. -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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.0 -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 -vpa_IC_option1 = "isotropic-beam" -vpa_IC_v01 = 1.0 -vpa_IC_vth01 = 0.1 -#vpa_IC_option1 = "directed-beam" -#vpa_IC_vpa01 = -1.5 -#vpa_IC_vperp01 = 0.0 + charge_exchange_frequency = 0.0 ionization_frequency = 0.0 constant_ionization_rate = false @@ -90,3 +71,31 @@ nstep = 50000 dt = 2.5e-4 nwrite = 100 nwrite_dfns = 100 + +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "isotropic-beam" +#initialization_option = "directed-beam" +v0 = 1.0 +vth0 = 0.1 +#vpa0 = -1.5 +#vperp0 = 0.0 diff --git a/examples/fokker-planck/fokker-planck-relaxation-slowing-down-beam.toml b/examples/fokker-planck/fokker-planck-relaxation-slowing-down-beam.toml deleted file mode 100644 index 9f0a16f23..000000000 --- a/examples/fokker-planck/fokker-planck-relaxation-slowing-down-beam.toml +++ /dev/null @@ -1,71 +0,0 @@ -# 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 diff --git a/examples/fokker-planck/fokker-planck-relaxation-slowing-down.toml b/examples/fokker-planck/fokker-planck-relaxation-slowing-down.toml index 9fe59dbe2..f637a06ef 100644 --- a/examples/fokker-planck/fokker-planck-relaxation-slowing-down.toml +++ b/examples/fokker-planck/fokker-planck-relaxation-slowing-down.toml @@ -1,31 +1,8 @@ # 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 @@ -51,6 +28,27 @@ vperp_discretization = "gausslegendre_pseudospectral" # Fokker-Planck operator requires the "gausslegendre_pseudospectral # options for the vpa and vperp grids +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + + [fokker_planck_collisions] # nuii sets the normalised input C[F,F] Fokker-Planck collision frequency nuii = 1.0 diff --git a/examples/fokker-planck/fokker-planck-relaxation.toml b/examples/fokker-planck/fokker-planck-relaxation.toml index 0f633c12b..9a512fbf8 100644 --- a/examples/fokker-planck/fokker-planck-relaxation.toml +++ b/examples/fokker-planck/fokker-planck-relaxation.toml @@ -1,31 +1,8 @@ # 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.0 -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 @@ -52,6 +29,26 @@ vperp_discretization = "gausslegendre_pseudospectral" # Fokker-Planck operator requires the "gausslegendre_pseudospectral # options for the vpa and vperp grids +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [fokker_planck_collisions] use_fokker_planck = true # nuii sets the normalised input C[F,F] Fokker-Planck collision frequency diff --git a/examples/fokker-planck/fokker-planck-source-sink-slowing-down-alphas-no-self-collisions.toml b/examples/fokker-planck/fokker-planck-source-sink-slowing-down-alphas-no-self-collisions.toml index 1a95fc210..1300c4ef9 100644 --- a/examples/fokker-planck/fokker-planck-source-sink-slowing-down-alphas-no-self-collisions.toml +++ b/examples/fokker-planck/fokker-planck-source-sink-slowing-down-alphas-no-self-collisions.toml @@ -1,28 +1,8 @@ # cheap input file for a 0D2V relaxation to a collisional Maxwellian distribution with self-ion collisions and collisions with fixed Maxwellian background of cold ions and electrons. -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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.0 -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 -vpa_IC_option1 = "isotropic-beam" -vpa_IC_v01 = 1.0 -vpa_IC_vth01 = 0.1 -#vpa_IC_option1 = "directed-beam" -#vpa_IC_vpa01 = -1.5 -#vpa_IC_vperp01 = 0.0 charge_exchange_frequency = 0.0 ionization_frequency = 0.0 constant_ionization_rate = false @@ -50,6 +30,34 @@ vperp_bc = "zero" # Fokker-Planck operator requires the "gausslegendre_pseudospectral # options for the vpa and vperp grids +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "isotropic-beam" +#initialization_option = "directed-beam" +v0 = 1.0 +vth0 = 0.1 +#vpa0 = -1.5 +#vperp0 = 0.0 + [fokker_planck_collisions] # nuii sets the normalised input C[F,F] Fokker-Planck collision frequency nuii = 1.876334222e-3 #(1/nu_alphae, as computed from input diagnostic) diff --git a/examples/fokker-planck/fokker-planck-source-sink-slowing-down-alphas.toml b/examples/fokker-planck/fokker-planck-source-sink-slowing-down-alphas.toml index cd49c82e7..13c56692e 100644 --- a/examples/fokker-planck/fokker-planck-source-sink-slowing-down-alphas.toml +++ b/examples/fokker-planck/fokker-planck-source-sink-slowing-down-alphas.toml @@ -1,28 +1,8 @@ # cheap input file for a 0D2V relaxation to a collisional Maxwellian distribution with self-ion collisions and collisions with fixed Maxwellian background of cold ions and electrons. -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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.0 -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 -vpa_IC_option1 = "isotropic-beam" -vpa_IC_v01 = 1.0 -vpa_IC_vth01 = 0.1 -#vpa_IC_option1 = "directed-beam" -#vpa_IC_vpa01 = -1.5 -#vpa_IC_vperp01 = 0.0 charge_exchange_frequency = 0.0 ionization_frequency = 0.0 constant_ionization_rate = false @@ -50,6 +30,35 @@ vperp_bc = "zero" # Fokker-Planck operator requires the "gausslegendre_pseudospectral # options for the vpa and vperp grids +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "isotropic-beam" +#initialization_option = "directed-beam" +v0 = 1.0 +vth0 = 0.1 +#vpa0 = -1.5 +#vperp0 = 0.0 + + [fokker_planck_collisions] # nuii sets the normalised input C[F,F] Fokker-Planck collision frequency nuii = 1.876334222e-3 #(1/nu_alphae, as computed from input diagnostic) diff --git a/examples/geometry/1D-mirror.toml b/examples/geometry/1D-mirror.toml index 6a8fe60a3..4b7a954b1 100644 --- a/examples/geometry/1D-mirror.toml +++ b/examples/geometry/1D-mirror.toml @@ -1,50 +1,10 @@ -n_ion_species = 1 -n_neutral_species = 0 -boltzmann_electron_response = true 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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.5 ionization_frequency = 0.05 constant_ionization_rate = true -use_semi_lagrange = false -n_rk_stages = 4 -split_operators = false r_ngrid = 1 r_nelement = 1 z_ngrid = 5 @@ -67,6 +27,34 @@ vz_L = 18.0 vz_bc = "both_zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 +[ion_species] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [ion_numerical_dissipation] vpa_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1 vperp_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1 diff --git a/examples/gk-ions/2D-periodic-gk.toml b/examples/gk-ions/2D-periodic-gk.toml index 0d27dfb1e..19659aede 100644 --- a/examples/gk-ions/2D-periodic-gk.toml +++ b/examples/gk-ions/2D-periodic-gk.toml @@ -1,51 +1,10 @@ -n_ion_species = 1 -n_neutral_species = 0 -boltzmann_electron_response = true evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = false -gyrokinetic_ions = true -T_e = 1.0 -T_wall = 1.0 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 -charge_exchange_frequency = 0.5 +charge_exchange_frequency = 0.0 ionization_frequency = 0.05 constant_ionization_rate = true -use_semi_lagrange = false -n_rk_stages = 4 -split_operators = false r_ngrid = 5 r_nelement = 2 r_bc = "periodic" @@ -69,6 +28,37 @@ vz_L = 18.0 vz_bc = "both_zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +gyrokinetic_ions = true +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + + [geometry] #option="1D-mirror" DeltaB=0.0 diff --git a/examples/kinetic-electrons/periodic_split3_boltzmann.toml b/examples/kinetic-electrons/periodic_split3_boltzmann.toml index 27a3eff33..5ad042d4b 100644 --- a/examples/kinetic-electrons/periodic_split3_boltzmann.toml +++ b/examples/kinetic-electrons/periodic_split3_boltzmann.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -electron_physics = "boltzmann_electron_response" evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.1 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.1 -z_IC_temperature_phase1 = 1.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.0 constant_ionization_rate = false @@ -63,6 +25,58 @@ vz_L = 12.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.1 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.1 +temperature_phase = 1.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(3)" nstep = 1000000 diff --git a/examples/kinetic-electrons/periodic_split3_braginskii-IMEX.toml b/examples/kinetic-electrons/periodic_split3_braginskii-IMEX.toml index 4dfe44807..f359c859d 100644 --- a/examples/kinetic-electrons/periodic_split3_braginskii-IMEX.toml +++ b/examples/kinetic-electrons/periodic_split3_braginskii-IMEX.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -electron_physics = "braginskii_fluid" evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.1 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.1 -z_IC_temperature_phase1 = 1.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.0 constant_ionization_rate = false @@ -63,6 +25,56 @@ vz_L = 12.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "braginskii_fluid" +recycling_fraction = 0.5 +T_e = 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.1 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.1 +temperature_phase = 1.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 + [timestepping] type = "KennedyCarpenterARK324" implicit_ion_advance = false diff --git a/examples/kinetic-electrons/periodic_split3_braginskii.toml b/examples/kinetic-electrons/periodic_split3_braginskii.toml index 31741e462..6f5c8d737 100644 --- a/examples/kinetic-electrons/periodic_split3_braginskii.toml +++ b/examples/kinetic-electrons/periodic_split3_braginskii.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -electron_physics = "braginskii_fluid" evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.1 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.1 -z_IC_temperature_phase1 = 1.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.0 constant_ionization_rate = false @@ -63,6 +25,56 @@ vz_L = 12.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "braginskii_fluid" +recycling_fraction = 0.5 +T_e = 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.1 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.1 +temperature_phase = 1.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 + [timestepping] type = "Fekete4(3)" nstep = 1000000 diff --git a/examples/kinetic-electrons/periodic_split3_kinetic-IMEX.toml b/examples/kinetic-electrons/periodic_split3_kinetic-IMEX.toml index ea91e79fa..e5a02086f 100644 --- a/examples/kinetic-electrons/periodic_split3_kinetic-IMEX.toml +++ b/examples/kinetic-electrons/periodic_split3_kinetic-IMEX.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -electron_physics = "kinetic_electrons" evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.1 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.1 -z_IC_temperature_phase1 = 1.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.0 constant_ionization_rate = false @@ -63,6 +25,56 @@ vz_L = 12.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "kinetic_electrons" +recycling_fraction = 0.5 +T_e = 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.1 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.1 +temperature_phase = 1.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 + [timestepping] type = "KennedyCarpenterARK324" implicit_electron_advance = true diff --git a/examples/kinetic-electrons/periodic_split3_kinetic.toml b/examples/kinetic-electrons/periodic_split3_kinetic.toml index c2c734a78..d4a1140d0 100644 --- a/examples/kinetic-electrons/periodic_split3_kinetic.toml +++ b/examples/kinetic-electrons/periodic_split3_kinetic.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -electron_physics = "kinetic_electrons" evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.1 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.1 -z_IC_temperature_phase1 = 1.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.0 constant_ionization_rate = false @@ -63,6 +25,56 @@ vz_L = 12.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "kinetic_electrons" +recycling_fraction = 0.5 +T_e = 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.1 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.1 +temperature_phase = 1.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 + [timestepping] #type = "KennedyCarpenterARK324" type = "Fekete4(3)" diff --git a/examples/kinetic-electrons/periodic_split3_kinetic_high-collisionality.toml b/examples/kinetic-electrons/periodic_split3_kinetic_high-collisionality.toml index 133d76b16..a0c44f500 100644 --- a/examples/kinetic-electrons/periodic_split3_kinetic_high-collisionality.toml +++ b/examples/kinetic-electrons/periodic_split3_kinetic_high-collisionality.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -electron_physics = "kinetic_electrons" evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "sinusoid" -z_IC_density_amplitude1 = 0.1 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.1 -z_IC_temperature_phase1 = 1.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.0 constant_ionization_rate = false @@ -63,6 +25,56 @@ vz_L = 12.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "kinetic_electrons" +recycling_fraction = 0.5 +T_e = 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.1 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.1 +temperature_phase = 1.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 + [reference_params] Tref = 20.0 diff --git a/examples/kinetic-electrons/wall+sheath-bc_boltzmann_loworder.toml b/examples/kinetic-electrons/wall+sheath-bc_boltzmann_loworder.toml index 35bb42e02..cb1b24116 100644 --- a/examples/kinetic-electrons/wall+sheath-bc_boltzmann_loworder.toml +++ b/examples/kinetic-electrons/wall+sheath-bc_boltzmann_loworder.toml @@ -1,47 +1,9 @@ steady_state_residual = true converged_residual_value = 1.0e-3 -n_ion_species = 1 -n_neutral_species = 1 -#boltzmann_electron_response = false -#electron_physics = "kinetic_electrons" 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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 2.0 electron_charge_exchange_frequency = 0.0 nu_ei = 0.0 @@ -71,6 +33,57 @@ vz_L = 12.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [output] ascii_output = true diff --git a/examples/kinetic-electrons/wall+sheath-bc_kinetic.toml b/examples/kinetic-electrons/wall+sheath-bc_kinetic.toml index a0a928479..8136e86d0 100644 --- a/examples/kinetic-electrons/wall+sheath-bc_kinetic.toml +++ b/examples/kinetic-electrons/wall+sheath-bc_kinetic.toml @@ -1,45 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -#boltzmann_electron_response = false -electron_physics = "kinetic_electrons" 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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 2.0 electron_charge_exchange_frequency = 0.0 nu_ei = 0.0 @@ -70,6 +32,57 @@ vz_L = 8.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "kinetic_electrons" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [output] ascii_output = true diff --git a/examples/kinetic-electrons/wall+sheath-bc_kinetic_krook_loworder.toml b/examples/kinetic-electrons/wall+sheath-bc_kinetic_krook_loworder.toml index da7a1bf63..f932d0357 100644 --- a/examples/kinetic-electrons/wall+sheath-bc_kinetic_krook_loworder.toml +++ b/examples/kinetic-electrons/wall+sheath-bc_kinetic_krook_loworder.toml @@ -1,45 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -#boltzmann_electron_response = false -electron_physics = "kinetic_electrons" 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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 2.0 electron_charge_exchange_frequency = 0.0 nu_ei = 0.0 @@ -69,6 +31,57 @@ vz_L = 8.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "kinetic_electrons" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [output] ascii_output = true diff --git a/examples/kinetic-electrons/wall+sheath-bc_kinetic_loworder.toml b/examples/kinetic-electrons/wall+sheath-bc_kinetic_loworder.toml index c1e8a7637..1b8ca705d 100644 --- a/examples/kinetic-electrons/wall+sheath-bc_kinetic_loworder.toml +++ b/examples/kinetic-electrons/wall+sheath-bc_kinetic_loworder.toml @@ -1,47 +1,9 @@ steady_state_residual = true converged_residual_value = 1.0e-3 -n_ion_species = 1 -n_neutral_species = 1 -#boltzmann_electron_response = false -electron_physics = "kinetic_electrons" 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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 2.0 electron_charge_exchange_frequency = 0.0 nu_ei = 0.0 @@ -71,6 +33,57 @@ vz_L = 12.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "kinetic_electrons" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [output] #ascii_output = true diff --git a/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_boltzmann-vpadiss0.toml b/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_boltzmann-vpadiss0.toml deleted file mode 100644 index 58998f2f0..000000000 --- a/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_boltzmann-vpadiss0.toml +++ /dev/null @@ -1,97 +0,0 @@ -#runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true -evolve_moments_density = true -evolve_moments_parallel_flow = true -evolve_moments_parallel_pressure = true -evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.05 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 1.0 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 -charge_exchange_frequency = 0.75 -ionization_frequency = 0.5 -constant_ionization_rate = false -r_ngrid = 1 -r_nelement = 1 -z_ngrid = 5 -z_nelement = 32 -z_nelement_local = 16 -z_bc = "wall" -z_discretization = "chebyshev_pseudospectral" -z_element_spacing_option = "sqrt" -vpa_ngrid = 6 -vpa_nelement = 63 -vpa_L = 36.0 -vpa_bc = "zero" -vpa_discretization = "chebyshev_pseudospectral" -vz_ngrid = 6 -vz_nelement = 63 -vz_L = 36.0 -vz_bc = "zero" -vz_discretization = "chebyshev_pseudospectral" - -[timestepping] -type = "Fekete4(3)" -#nstep = 50000 -nstep = 3000000 -dt = 1.0e-6 -minimum_dt = 1.0e-6 -nwrite = 10000 -nwrite_dfns = 100000 -steady_state_residual = true -converged_residual_value = 1.0e-3 - -[ion_source] -active = true -z_profile = "gaussian" -z_width = 0.125 -source_strength = 2.0 -source_T = 2.0 - -[ion_numerical_dissipation] -#vpa_dissipation_coefficient = 1.0e-1 -#vpa_dissipation_coefficient = 1.0e-2 -#vpa_dissipation_coefficient = 1.0e-3 -force_minimum_pdf_value = 0.0 - -[neutral_numerical_dissipation] -#vz_dissipation_coefficient = 1.0e-1 -#vz_dissipation_coefficient = 1.0e-2 -#vz_dissipation_coefficient = 1.0e-3 -force_minimum_pdf_value = 0.0 - -[krook_collisions] -use_krook = true diff --git a/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_boltzmann.toml b/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_boltzmann.toml deleted file mode 100644 index 4b36701ae..000000000 --- a/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_boltzmann.toml +++ /dev/null @@ -1,97 +0,0 @@ -#runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true -evolve_moments_density = true -evolve_moments_parallel_flow = true -evolve_moments_parallel_pressure = true -evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 -charge_exchange_frequency = 0.75 -ionization_frequency = 0.5 -constant_ionization_rate = false -r_ngrid = 1 -r_nelement = 1 -z_ngrid = 5 -z_nelement = 32 -z_nelement_local = 16 -z_bc = "wall" -z_discretization = "chebyshev_pseudospectral" -z_element_spacing_option = "sqrt" -vpa_ngrid = 6 -vpa_nelement = 63 -vpa_L = 36.0 -vpa_bc = "zero" -vpa_discretization = "chebyshev_pseudospectral" -vz_ngrid = 6 -vz_nelement = 63 -vz_L = 36.0 -vz_bc = "zero" -vz_discretization = "chebyshev_pseudospectral" - -[timestepping] -type = "Fekete4(3)" -#nstep = 50000 -nstep = 1000000 -dt = 1.0e-6 -minimum_dt = 1.0e-6 -nwrite = 10000 -nwrite_dfns = 100000 -steady_state_residual = true -converged_residual_value = 1.0e-3 - -[ion_source] -active = true -z_profile = "gaussian" -z_width = 0.125 -source_strength = 2.0 -source_T = 2.0 - -[ion_numerical_dissipation] -vpa_dissipation_coefficient = 1.0e-1 -#vpa_dissipation_coefficient = 1.0e-2 -#vpa_dissipation_coefficient = 1.0e-3 -force_minimum_pdf_value = 0.0 - -[neutral_numerical_dissipation] -vz_dissipation_coefficient = 1.0e-1 -#vz_dissipation_coefficient = 1.0e-2 -#vz_dissipation_coefficient = 1.0e-3 -force_minimum_pdf_value = 0.0 - -[krook_collisions] -use_krook = true diff --git a/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_braginskii-vpadiss0-IMEX.toml b/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_braginskii-vpadiss0-IMEX.toml index c9230a33a..d0ab7a225 100644 --- a/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_braginskii-vpadiss0-IMEX.toml +++ b/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_braginskii-vpadiss0-IMEX.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -electron_physics = "braginskii_fluid" evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -64,6 +26,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "braginskii_fluid" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "KennedyCarpenterARK324" #type = "KennedyCarpenterARK324-explicit" diff --git a/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_kinetic-vpadiss0.toml b/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_kinetic-vpadiss0.toml index 0a66ed75e..1fb3f2874 100644 --- a/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_kinetic-vpadiss0.toml +++ b/examples/kinetic-electrons/wall-bc_recyclefraction0.5_split3_kinetic-vpadiss0.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -electron_physics = "kinetic_electrons_with_temperature_equation" evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 0.1 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -63,6 +25,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "kinetic_electrons_with_temperature_equation" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 0.1 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(3)" #nstep = 50000 diff --git a/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split1.toml b/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split1.toml index 7912e9680..c8178024f 100644 --- a/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split1.toml +++ b/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split1.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.5 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 0.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.5 -z_IC_temperature_phase1 = 3.14159265359 -z_IC_option2 = "sinusoid" -z_IC_density_amplitude2 = 0.5 -z_IC_density_phase2 = 3.14159265359 -z_IC_upar_amplitude2 = 0.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.5 -z_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,40 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 3.14159265359 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 3.14159265359 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 0.0 + + [timestepping] nstep = 2000 dt = 0.001 diff --git a/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split2.toml b/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split2.toml index 8e11356d9..46326e0f4 100644 --- a/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split2.toml +++ b/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split2.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.5 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 0.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.5 -z_IC_temperature_phase1 = 3.14159265359 -z_IC_option2 = "sinusoid" -z_IC_density_amplitude2 = 0.5 -z_IC_density_phase2 = 3.14159265359 -z_IC_upar_amplitude2 = 0.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.5 -z_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,39 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 3.14159265359 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 3.14159265359 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 0.0 + [timestepping] nstep = 400 dt = 0.001 diff --git a/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split3.toml b/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split3.toml index fc61e6688..fed5d3635 100644 --- a/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split3.toml +++ b/examples/nonlinear-sound-wave/nonlinear-sound-wave_cheb_split3.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -T_e = 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.5 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 0.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.5 -z_IC_temperature_phase1 = 3.14159265359 -z_IC_option2 = "sinusoid" -z_IC_density_amplitude2 = 0.5 -z_IC_density_phase2 = 3.14159265359 -z_IC_upar_amplitude2 = 0.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.5 -z_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,39 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 3.14159265359 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 3.14159265359 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 0.0 + [timestepping] nstep = 200 dt = 0.001 diff --git a/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd.toml b/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd.toml index 6a379b7ce..2d15df95f 100644 --- a/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd.toml +++ b/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.5 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 0.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.5 -z_IC_temperature_phase1 = 3.14159265359 -z_IC_option2 = "sinusoid" -z_IC_density_amplitude2 = 0.5 -z_IC_density_phase2 = 3.14159265359 -z_IC_upar_amplitude2 = 0.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.5 -z_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,39 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "finite_difference" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 3.14159265359 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 3.14159265359 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 0.0 + [timestepping] nstep = 2000 dt = 0.001 diff --git a/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split1.toml b/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split1.toml index c2f5b1a6f..0de21547e 100644 --- a/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split1.toml +++ b/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split1.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.5 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 0.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.5 -z_IC_temperature_phase1 = 3.14159265359 -z_IC_option2 = "sinusoid" -z_IC_density_amplitude2 = 0.5 -z_IC_density_phase2 = 3.14159265359 -z_IC_upar_amplitude2 = 0.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.5 -z_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,39 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "finite_difference" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 3.14159265359 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 3.14159265359 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 0.0 + [timestepping] nstep = 2000 dt = 0.001 diff --git a/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split2.toml b/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split2.toml index 8c87a564f..a5322c378 100644 --- a/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split2.toml +++ b/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split2.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.5 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 0.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.5 -z_IC_temperature_phase1 = 3.14159265359 -z_IC_option2 = "sinusoid" -z_IC_density_amplitude2 = 0.5 -z_IC_density_phase2 = 3.14159265359 -z_IC_upar_amplitude2 = 0.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.5 -z_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,39 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "finite_difference" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 3.14159265359 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 3.14159265359 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 0.0 + [timestepping] nstep = 400 dt = 0.001 diff --git a/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split3.toml b/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split3.toml index 823b932c6..b17c8ff55 100644 --- a/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split3.toml +++ b/examples/nonlinear-sound-wave/nonlinear-sound-wave_fd_split3.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -T_e = 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.5 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 0.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.5 -z_IC_temperature_phase1 = 3.14159265359 -z_IC_option2 = "sinusoid" -z_IC_density_amplitude2 = 0.5 -z_IC_density_phase2 = 3.14159265359 -z_IC_upar_amplitude2 = 0.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.5 -z_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,39 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "finite_difference" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 3.14159265359 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.5 +density_phase = 3.14159265359 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.5 +temperature_phase = 0.0 + [timestepping] nstep = 200 dt = 0.001 diff --git a/examples/numerical-dissipation/num-diss-relaxation.toml b/examples/numerical-dissipation/num-diss-relaxation.toml index 6fb8b0086..3b9e46fe5 100644 --- a/examples/numerical-dissipation/num-diss-relaxation.toml +++ b/examples/numerical-dissipation/num-diss-relaxation.toml @@ -1,31 +1,8 @@ # cheap input file for a 0D2V relaxation with numerical diffusion terms d^2 F / dvpa^2 and d^2 F / vperp^2. -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 @@ -51,6 +28,27 @@ vperp_L = 3.0 vperp_bc = "zero" vperp_discretization = "gausslegendre_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + + [timestepping] nstep = 2000 dt = 1.0e-3 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5-init.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5-init.toml index 9442b1dde..2797171d8 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5-init.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5-init.toml @@ -1,44 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = false -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -61,6 +24,57 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(3)" nstep = 10000000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5.toml index 70e81e234..556877c95 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5.toml @@ -1,44 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = false -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -61,6 +24,57 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(3)" #nstep = 50000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split1.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split1.toml index 634959e88..172492ca8 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split1.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split1.toml @@ -1,44 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 evolve_moments_density = true evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -61,6 +24,57 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(3)" #nstep = 50000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split2.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split2.toml index f1ba6bc68..193947c3c 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split2.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split2.toml @@ -1,44 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = false evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -61,6 +24,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(3)" #nstep = 50000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3-init.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3-init.toml index 7c6e17f90..ea1050a7b 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3-init.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3-init.toml @@ -1,44 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -61,6 +24,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(3)" nstep = 100000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3.toml index 1352d2fdd..7cea6791c 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3.toml @@ -1,44 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -61,6 +24,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(3)" #nstep = 50000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_SSPRK4.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_SSPRK4.toml index 73be81551..bd0fe2676 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_SSPRK4.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_SSPRK4.toml @@ -1,44 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -61,6 +24,57 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] #nstep = 50000 nstep = 1000000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete104.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete104.toml index 26a9fda8b..eb93fa736 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete104.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete104.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -63,6 +25,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete10(4)" #nstep = 50000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete42.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete42.toml index 7478a386e..85d60781c 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete42.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete42.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -63,6 +25,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete4(2)" #nstep = 50000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete64.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete64.toml index 3c86487ac..d1eb4f45f 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete64.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_fekete64.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -63,6 +25,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "Fekete6(4)" #nstep = 50000 diff --git a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_rkf54.toml b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_rkf54.toml index 8372db4cc..e8f6263b0 100644 --- a/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_rkf54.toml +++ b/examples/recycling-fraction/wall-bc_recyclefraction0.5_split3_rkf54.toml @@ -1,46 +1,8 @@ #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -63,6 +25,58 @@ vz_L = 36.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] type = "RKF5(4)" #nstep = 50000 diff --git a/examples/sheath+wall-bc_test/sheath-bc_cheb_test.toml b/examples/sheath+wall-bc_test/sheath-bc_cheb_test.toml index c2ac67f3d..4bb5e56a1 100644 --- a/examples/sheath+wall-bc_test/sheath-bc_cheb_test.toml +++ b/examples/sheath+wall-bc_test/sheath-bc_cheb_test.toml @@ -1,46 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -#boltzmann_electron_response = false -electron_physics = "boltzmann_electron_response_with_simple_sheath" 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 -phi_wall = -2.690 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 2.0 ionization_frequency = 2.0 constant_ionization_rate = false @@ -56,6 +17,58 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response_with_simple_sheath" +T_e = 1.0 +T_wall = 1.0 +phi_wall = -2.690 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 40000 dt = 0.001 diff --git a/examples/sheath+wall-bc_test/wall-bc_cheb_test.toml b/examples/sheath+wall-bc_test/wall-bc_cheb_test.toml index db9c4b664..b9ed15f46 100644 --- a/examples/sheath+wall-bc_test/wall-bc_cheb_test.toml +++ b/examples/sheath+wall-bc_test/wall-bc_cheb_test.toml @@ -1,45 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -#boltzmann_electron_response = true -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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 2.0 ionization_frequency = 2.0 constant_ionization_rate = false @@ -55,6 +17,57 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option= "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 40000 dt = 0.001 diff --git a/examples/sound-wave/sound-wave_cheb.toml b/examples/sound-wave/sound-wave_cheb.toml index 61891bfd6..4c50b1c65 100644 --- a/examples/sound-wave/sound-wave_cheb.toml +++ b/examples/sound-wave/sound-wave_cheb.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -43,6 +21,38 @@ vz_L = 8.0 vz_bc = "periodic" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [output] binary_format = "netcdf" diff --git a/examples/sound-wave/sound-wave_cheb_split1.toml b/examples/sound-wave/sound-wave_cheb_split1.toml index 4df7c7b09..9ef684754 100644 --- a/examples/sound-wave/sound-wave_cheb_split1.toml +++ b/examples/sound-wave/sound-wave_cheb_split1.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,38 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1500 dt = 0.002 diff --git a/examples/sound-wave/sound-wave_cheb_split2.toml b/examples/sound-wave/sound-wave_cheb_split2.toml index a859fbc81..27989f73c 100644 --- a/examples/sound-wave/sound-wave_cheb_split2.toml +++ b/examples/sound-wave/sound-wave_cheb_split2.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,38 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1500 dt = 0.002 diff --git a/examples/sound-wave/sound-wave_cheb_split3.toml b/examples/sound-wave/sound-wave_cheb_split3.toml index 5b7fe80ea..0443db2d4 100644 --- a/examples/sound-wave/sound-wave_cheb_split3.toml +++ b/examples/sound-wave/sound-wave_cheb_split3.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -T_e = 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.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,38 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1500 dt = 0.002 diff --git a/examples/sound-wave/sound-wave_fd.toml b/examples/sound-wave/sound-wave_fd.toml index 8d1f11a0b..5c45c3183 100644 --- a/examples/sound-wave/sound-wave_fd.toml +++ b/examples/sound-wave/sound-wave_fd.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,38 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "finite_difference" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1500 dt = 0.002 diff --git a/examples/sound-wave/sound-wave_fd_split1.toml b/examples/sound-wave/sound-wave_fd_split1.toml index 758b1b387..d25a888d4 100644 --- a/examples/sound-wave/sound-wave_fd_split1.toml +++ b/examples/sound-wave/sound-wave_fd_split1.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,38 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "finite_difference" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1500 dt = 0.002 diff --git a/examples/sound-wave/sound-wave_fd_split2.toml b/examples/sound-wave/sound-wave_fd_split2.toml index abe2ed22a..658572f1f 100644 --- a/examples/sound-wave/sound-wave_fd_split2.toml +++ b/examples/sound-wave/sound-wave_fd_split2.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 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.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,38 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "finite_difference" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1500 dt = 0.002 diff --git a/examples/sound-wave/sound-wave_fd_split3.toml b/examples/sound-wave/sound-wave_fd_split3.toml index 15627f0fb..76c205b6a 100644 --- a/examples/sound-wave/sound-wave_fd_split3.toml +++ b/examples/sound-wave/sound-wave_fd_split3.toml @@ -1,29 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -T_e = 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.62831853071 ionization_frequency = 0.0 r_ngrid = 1 @@ -38,6 +16,38 @@ vpa_L = 8.0 vpa_bc = "periodic" vpa_discretization = "finite_difference" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 + +[ion_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[neutral_species_1] +initial_density = 0.5 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[z_IC_neutral_species_1] +initialization_option = "sinusoid" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1500 dt = 0.002 diff --git a/examples/wall-bc/wall+sheath-bc.toml b/examples/wall-bc/wall+sheath-bc.toml index ccfbbde0f..4e582624e 100644 --- a/examples/wall-bc/wall+sheath-bc.toml +++ b/examples/wall-bc/wall+sheath-bc.toml @@ -1,45 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -#boltzmann_electron_response = false -electron_physics = "boltzmann_electron_response_with_simple_sheath" 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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -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_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 2.0 ionization_frequency = 2.0 constant_ionization_rate = false @@ -60,6 +22,57 @@ vz_L = 8.0 vz_bc = "periodic" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response_with_simple_sheath" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_eutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_eutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 10000 dt = 0.001 diff --git a/examples/wall-bc/wall-bc_cheb.toml b/examples/wall-bc/wall-bc_cheb.toml index 4a076b110..d0228533e 100644 --- a/examples/wall-bc/wall-bc_cheb.toml +++ b/examples/wall-bc/wall-bc_cheb.toml @@ -1,44 +1,7 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true 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 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.5 ionization_frequency = 0.75 constant_ionization_rate = false @@ -59,6 +22,57 @@ vz_L = 18.0 vz_bc = "both_zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 50000 dt = 1.0e-5 diff --git a/examples/wall-bc/wall-bc_cheb_split1.toml b/examples/wall-bc/wall-bc_cheb_split1.toml index 4c57ebf48..78474d3d0 100644 --- a/examples/wall-bc/wall-bc_cheb_split1.toml +++ b/examples/wall-bc/wall-bc_cheb_split1.toml @@ -1,45 +1,8 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true #runtime_plots = true evolve_moments_density = true evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 1.0 -T_wall = 1.0 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.5 ionization_frequency = 0.75 constant_ionization_rate = false @@ -60,6 +23,57 @@ vz_L = 18.0 vz_bc = "both_zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 50000 dt = 1.0e-5 diff --git a/examples/wall-bc/wall-bc_cheb_split2.toml b/examples/wall-bc/wall-bc_cheb_split2.toml index 53f29f0ac..81530feec 100644 --- a/examples/wall-bc/wall-bc_cheb_split2.toml +++ b/examples/wall-bc/wall-bc_cheb_split2.toml @@ -1,45 +1,8 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true #runtime_plots = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = false evolve_moments_conservation = true -T_e = 1.0 -T_wall = 1.0 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.5 ionization_frequency = 0.75 constant_ionization_rate = false @@ -60,6 +23,57 @@ vz_L = 18.0 vz_bc = "both_zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 50000 dt = 1.0e-5 diff --git a/examples/wall-bc/wall-bc_cheb_split3.toml b/examples/wall-bc/wall-bc_cheb_split3.toml index 3db98a2da..7834ba468 100644 --- a/examples/wall-bc/wall-bc_cheb_split3.toml +++ b/examples/wall-bc/wall-bc_cheb_split3.toml @@ -1,45 +1,8 @@ -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true #runtime_plots = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -T_e = 1.0 -T_wall = 1.0 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.5 ionization_frequency = 0.75 constant_ionization_rate = false @@ -60,6 +23,57 @@ vz_L = 18.0 vz_bc = "both_zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +T_e = 1.0 +T_wall = 1.0 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 50000 dt = 1.0e-5 diff --git a/examples/wall-bc/wall-bc_no-neutrals.toml b/examples/wall-bc/wall-bc_no-neutrals.toml index ce5da5ba8..fc980405f 100644 --- a/examples/wall-bc/wall-bc_no-neutrals.toml +++ b/examples/wall-bc/wall-bc_no-neutrals.toml @@ -1,50 +1,10 @@ steady_state_residual = true converged_residual_value = 1.0e-3 runtime_plots = true -n_ion_species = 1 -n_neutral_species = 0 -boltzmann_electron_response = true evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 -#charge_exchange_frequency = 0.75 -#ionization_frequency = 0.5 r_ngrid = 1 r_nelement = 1 z_ngrid = 9 @@ -63,6 +23,36 @@ vz_L = 18.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 100000 dt = 5.0e-4 diff --git a/examples/wall-bc/wall-bc_no-neutrals_split1.toml b/examples/wall-bc/wall-bc_no-neutrals_split1.toml index cae94a045..a9ac4ee25 100644 --- a/examples/wall-bc/wall-bc_no-neutrals_split1.toml +++ b/examples/wall-bc/wall-bc_no-neutrals_split1.toml @@ -1,50 +1,10 @@ steady_state_residual = true converged_residual_value = 1.0e-3 runtime_plots = true -n_ion_species = 1 -n_neutral_species = 0 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 -#charge_exchange_frequency = 0.75 -#ionization_frequency = 0.5 r_ngrid = 1 r_nelement = 1 z_ngrid = 9 @@ -63,6 +23,36 @@ vz_L = 18.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 100000 dt = 1.0e-4 diff --git a/examples/wall-bc/wall-bc_no-neutrals_split2.toml b/examples/wall-bc/wall-bc_no-neutrals_split2.toml index ce74ec368..66728bc89 100644 --- a/examples/wall-bc/wall-bc_no-neutrals_split2.toml +++ b/examples/wall-bc/wall-bc_no-neutrals_split2.toml @@ -1,50 +1,10 @@ steady_state_residual = true converged_residual_value = 1.0e-3 runtime_plots = true -n_ion_species = 1 -n_neutral_species = 0 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = false evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 -#charge_exchange_frequency = 0.75 -#ionization_frequency = 0.5 r_ngrid = 1 r_nelement = 1 z_ngrid = 9 @@ -63,6 +23,36 @@ vz_L = 18.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 100000 dt = 1.0e-4 diff --git a/examples/wall-bc/wall-bc_no-neutrals_split3.toml b/examples/wall-bc/wall-bc_no-neutrals_split3.toml index 23316e611..126a72cfd 100644 --- a/examples/wall-bc/wall-bc_no-neutrals_split3.toml +++ b/examples/wall-bc/wall-bc_no-neutrals_split3.toml @@ -1,50 +1,10 @@ steady_state_residual = true converged_residual_value = 1.0e-3 runtime_plots = true -n_ion_species = 1 -n_neutral_species = 0 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.5 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 -#charge_exchange_frequency = 0.75 -#ionization_frequency = 0.5 r_ngrid = 1 r_nelement = 1 z_ngrid = 9 @@ -63,6 +23,36 @@ vz_L = 18.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 0 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.5 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 100000 dt = 1.0e-4 diff --git a/examples/wall-bc/wall-bc_volumerecycle.toml b/examples/wall-bc/wall-bc_volumerecycle.toml index 1cbf7f1b2..71892195e 100644 --- a/examples/wall-bc/wall-bc_volumerecycle.toml +++ b/examples/wall-bc/wall-bc_volumerecycle.toml @@ -1,48 +1,10 @@ steady_state_residual = true converged_residual_value = 1.0e-3 #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = false evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -recycling_fraction = 0.25 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -65,6 +27,58 @@ vz_L = 18.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.25 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1000000 dt = 3.0e-5 diff --git a/examples/wall-bc/wall-bc_volumerecycle_split1.toml b/examples/wall-bc/wall-bc_volumerecycle_split1.toml index 442ce033d..bc5123654 100644 --- a/examples/wall-bc/wall-bc_volumerecycle_split1.toml +++ b/examples/wall-bc/wall-bc_volumerecycle_split1.toml @@ -1,48 +1,10 @@ steady_state_residual = true converged_residual_value = 1.0e-3 #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = false evolve_moments_parallel_pressure = false evolve_moments_conservation = true -recycling_fraction = 0.25 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -65,6 +27,58 @@ vz_L = 18.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.25 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1000000 dt = 3.0e-5 diff --git a/examples/wall-bc/wall-bc_volumerecycle_split2.toml b/examples/wall-bc/wall-bc_volumerecycle_split2.toml index 08eb2ed6c..acc92a7d2 100644 --- a/examples/wall-bc/wall-bc_volumerecycle_split2.toml +++ b/examples/wall-bc/wall-bc_volumerecycle_split2.toml @@ -1,48 +1,10 @@ steady_state_residual = true converged_residual_value = 1.0e-3 #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = false evolve_moments_conservation = true -recycling_fraction = 0.25 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -65,6 +27,58 @@ vz_L = 18.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.25 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1000000 dt = 3.0e-5 diff --git a/examples/wall-bc/wall-bc_volumerecycle_split3.toml b/examples/wall-bc/wall-bc_volumerecycle_split3.toml index 0c8dad98d..477a943e9 100644 --- a/examples/wall-bc/wall-bc_volumerecycle_split3.toml +++ b/examples/wall-bc/wall-bc_volumerecycle_split3.toml @@ -1,48 +1,10 @@ steady_state_residual = true converged_residual_value = 1.0e-3 #runtime_plots = true -n_ion_species = 1 -n_neutral_species = 1 -boltzmann_electron_response = true evolve_moments_density = true evolve_moments_parallel_flow = true evolve_moments_parallel_pressure = true evolve_moments_conservation = true -recycling_fraction = 0.25 -T_e = 0.2 # 1.0 -T_wall = 0.1 -initial_density1 = 1.0 -initial_temperature1 = 1.0 -z_IC_option1 = "gaussian" -z_IC_density_amplitude1 = 0.001 -z_IC_density_phase1 = 0.0 -z_IC_upar_amplitude1 = 1.0 -z_IC_upar_phase1 = 0.0 -z_IC_temperature_amplitude1 = 0.0 -z_IC_temperature_phase1 = 0.0 -vpa_IC_option1 = "gaussian" -vpa_IC_density_amplitude1 = 1.0 -vpa_IC_density_phase1 = 0.0 -vpa_IC_upar_amplitude1 = 0.0 -vpa_IC_upar_phase1 = 0.0 -vpa_IC_temperature_amplitude1 = 0.0 -vpa_IC_temperature_phase1 = 0.0 -initial_density2 = 1.0 -initial_temperature2 = 1.0 -z_IC_option2 = "gaussian" -z_IC_density_amplitude2 = 0.001 -z_IC_density_phase2 = 0.0 -z_IC_upar_amplitude2 = -1.0 -z_IC_upar_phase2 = 0.0 -z_IC_temperature_amplitude2 = 0.0 -z_IC_temperature_phase2 = 0.0 -vpa_IC_option2 = "gaussian" -vpa_IC_density_amplitude2 = 1.0 -vpa_IC_density_phase2 = 0.0 -vpa_IC_upar_amplitude2 = 0.0 -vpa_IC_upar_phase2 = 0.0 -vpa_IC_temperature_amplitude2 = 0.0 -vpa_IC_temperature_phase2 = 0.0 charge_exchange_frequency = 0.75 ionization_frequency = 0.5 constant_ionization_rate = false @@ -65,6 +27,58 @@ vz_L = 30.0 vz_bc = "zero" vz_discretization = "chebyshev_pseudospectral" +[composition] +n_ion_species = 1 +n_neutral_species = 1 +electron_physics = "boltzmann_electron_response" +recycling_fraction = 0.25 +T_e = 0.2 # 1.0 +T_wall = 0.1 + +[ion_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = 1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_ion_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[neutral_species_1] +initial_density = 1.0 +initial_temperature = 1.0 + +[z_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 0.001 +density_phase = 0.0 +upar_amplitude = -1.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + +[vpa_IC_neutral_species_1] +initialization_option = "gaussian" +density_amplitude = 1.0 +density_phase = 0.0 +upar_amplitude = 0.0 +upar_phase = 0.0 +temperature_amplitude = 0.0 +temperature_phase = 0.0 + [timestepping] nstep = 1000000 dt = 1.0e-5 diff --git a/makie_post_processing/makie_post_processing/src/shared_utils.jl b/makie_post_processing/makie_post_processing/src/shared_utils.jl index 32acaf1ec..7ce536326 100644 --- a/makie_post_processing/makie_post_processing/src/shared_utils.jl +++ b/makie_post_processing/makie_post_processing/src/shared_utils.jl @@ -1,6 +1,6 @@ module shared_utils -export calculate_and_write_frequencies, get_geometry, get_composition +export calculate_and_write_frequencies, get_geometry using moment_kinetics.analysis: fit_delta_phi_mode using moment_kinetics.array_allocation: allocate_float @@ -8,11 +8,10 @@ using moment_kinetics.coordinates: define_coordinate using moment_kinetics.input_structs: boltzmann_electron_response, boltzmann_electron_response_with_simple_sheath, grid_input, geometry_input, species_composition -using moment_kinetics.moment_kinetics_input: get_default_rhostar, setup_reference_parameters using moment_kinetics.type_definitions: mk_float, mk_int using moment_kinetics.reference_parameters: setup_reference_parameters -using moment_kinetics.moment_kinetics_input: get_default_rhostar using moment_kinetics.geo: init_magnetic_geometry, setup_geometry_input +using moment_kinetics.species_input: get_species_input using MPI """ @@ -62,58 +61,8 @@ function calculate_and_write_frequencies(run_name, ntime, time, z, itime_min, it return frequency, growth_rate, shifted_time, fitted_delta_phi end -""" -""" -function get_composition(scan_input) - reference_params = setup_reference_parameters(scan_input) - # set composition input - # MRH need to get this in way that does not duplicate code - # MRH from moment_kinetics_input.jl - electron_physics = get(scan_input, "electron_physics", boltzmann_electron_response) - - n_ion_species = get(scan_input, "n_ion_species", 1) - n_neutral_species = get(scan_input, "n_neutral_species", 1) - if electron_physics ∈ (boltzmann_electron_response, boltzmann_electron_response_with_simple_sheath) - n_species = n_ion_species + n_neutral_species - else - n_species = n_ion_species + n_neutral_species + 1 - end - T_e = get(scan_input, "T_e", 1.0) - # set wall temperature T_wall = Tw/Te - T_wall = get(scan_input, "T_wall", 1.0) - # set initial neutral temperature Tn/Tₑ = 1 - # set initial nᵢ/Nₑ = 1.0 - # set phi_wall at z = 0 - phi_wall = get(scan_input, "phi_wall", 0.0) - # if false use true Knudsen cosine for neutral wall bc - use_test_neutral_wall_pdf = get(scan_input, "use_test_neutral_wall_pdf", false) - gyrokinetic_ions = get(scan_input, "gyrokinetic_ions", false) - # constant to be used to test nonzero Er in wall boundary condition - recycling_fraction = get(scan_input, "recycling_fraction", 1.0) - # constant to be used to control Ez divergences - epsilon_offset = get(scan_input, "epsilon_offset", 0.001) - # bool to control if dfni is a function of vpa or vpabar in MMS test - use_vpabar_in_mms_dfni = get(scan_input, "use_vpabar_in_mms_dfni", true) - if use_vpabar_in_mms_dfni - alpha_switch = 1.0 - else - alpha_switch = 0.0 - end - # ratio of the neutral particle mass to the ion particle mass - mn_over_mi = 1.0 - # ratio of the electron particle mass to the ion particle mass - me_over_mi = 1.0/1836.0 - composition = species_composition(n_species, n_ion_species, n_neutral_species, - electron_physics, use_test_neutral_wall_pdf, T_e, T_wall, phi_wall, - mn_over_mi, me_over_mi, recycling_fraction, gyrokinetic_ions, allocate_float(n_species)) - return composition - -end - function get_geometry(scan_input,z,r) - reference_params = setup_reference_parameters(scan_input) - reference_rhostar = get_default_rhostar(reference_params) - geo_in = setup_geometry_input(scan_input, reference_rhostar) + geo_in = setup_geometry_input(scan_input) geometry = init_magnetic_geometry(geo_in,z,r) return geometry end diff --git a/moment_kinetics/debug_test/fokker_planck_collisions_inputs.jl b/moment_kinetics/debug_test/fokker_planck_collisions_inputs.jl index 912d7787b..671a69448 100644 --- a/moment_kinetics/debug_test/fokker_planck_collisions_inputs.jl +++ b/moment_kinetics/debug_test/fokker_planck_collisions_inputs.jl @@ -1,34 +1,41 @@ +using moment_kinetics.type_definitions: OptionsDict test_type = "Fokker-Planck collisions" # default input for test -test_input_full_f = Dict( +test_input_full_f = OptionsDict( "run_name" => "full_f", - "timestepping" => Dict{String,Any}("dt" => 0.0, + "timestepping" => OptionsDict("dt" => 0.0, "nstep" => 3, "nwrite" => 2, "nwrite_dfns" => 2), - "T_e" => 1.0, - "T_wall" => 1.0, - "electron_physics" => "boltzmann_electron_response", + "composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 0, + "T_e" => 1.0, + "T_wall" => 1.0, + "electron_physics" => "boltzmann_electron_response"), "evolve_moments_conservation" => false, "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, - "initial_density1" => 0.5, - "initial_density2" => 0.5, - "initial_temperature1" => 1.0, - "initial_temperature2" => 1.0, + "ion_species_1" => OptionsDict("initial_density" => 0.5, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("density_amplitude" => 0.001, + "density_phase" => 0.0, + "initialization_option" => "sinusoid", + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0), "charge_exchange_frequency" => 0.0, "ionization_frequency" => 0.0, "constant_ionization_rate" => false, - "n_ion_species" => 1, - "n_neutral_species" => 0, - "nuii" => 1.0, + "fokker_planck_collisions" => OptionsDict("use_fokker_planck" => true, + "nuii" => 1.0, + "frequency_option" => "manual"), "r_bc" => "periodic", "r_discretization" => "chebyshev_pseudospectral", "r_nelement" => 1, "r_ngrid" => 3, - "split_operators" => false, "vpa_L" => 6.0, "vpa_bc" => "zero", "vpa_discretization" => "gausslegendre_pseudospectral", @@ -38,20 +45,6 @@ test_input_full_f = Dict( "vperp_discretization" => "gausslegendre_pseudospectral", "vperp_nelement" => 2, "vperp_ngrid" => 3, - "z_IC_density_amplitude1" => 0.001, - "z_IC_density_amplitude2" => 0.001, - "z_IC_density_phase1" => 0.0, - "z_IC_density_phase2" => 0.0, - "z_IC_option1" => "sinusoid", - "z_IC_option2" => "sinusoid", - "z_IC_temperature_amplitude1" => 0.0, - "z_IC_temperature_amplitude2" => 0.0, - "z_IC_temperature_phase1" => 0.0, - "z_IC_temperature_phase2" => 0.0, - "z_IC_upar_amplitude1" => 0.0, - "z_IC_upar_amplitude2" => 0.0, - "z_IC_upar_phase1" => 0.0, - "z_IC_upar_phase2" => 0.0, "z_bc" => "wall", "z_discretization" => "chebyshev_pseudospectral", "z_nelement" => 1, diff --git a/moment_kinetics/debug_test/gyroaverage_inputs.jl b/moment_kinetics/debug_test/gyroaverage_inputs.jl index e0a8a5ffe..516d4c674 100644 --- a/moment_kinetics/debug_test/gyroaverage_inputs.jl +++ b/moment_kinetics/debug_test/gyroaverage_inputs.jl @@ -1,53 +1,38 @@ +using moment_kinetics.type_definitions: OptionsDict test_type = "gyroaverage" # default inputs for tests -test_input = Dict( +test_input = OptionsDict( "run_name" => "gyroaverage", - "n_ion_species" => 1, - "n_neutral_species" => 0, + "composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 0, + "gyrokinetic_ions" => true, + "T_e" => 1.0, + "T_wall" => 1.0), "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => false, - "gyrokinetic_ions" => true, - "T_e" => 1.0, - "T_wall" => 1.0, - "initial_density1" => 1.0, - "initial_temperature1" => 1.0, - "z_IC_option1" => "gaussian", - "z_IC_density_amplitude1" => 0.001, - "z_IC_density_phase1" => 0.0, - "z_IC_upar_amplitude1" => 1.0, - "z_IC_upar_phase1" => 0.0, - "z_IC_temperature_amplitude1" => 0.0, - "z_IC_temperature_phase1" => 0.0, - "vpa_IC_option1" => "gaussian", - "vpa_IC_density_amplitude1" => 1.0, - "vpa_IC_density_phase1" => 0.0, - "vpa_IC_upar_amplitude1" => 0.0, - "vpa_IC_upar_phase1" => 0.0, - "vpa_IC_temperature_amplitude1" => 0.0, - "vpa_IC_temperature_phase1" => 0.0, - "initial_density2" => 1.0, - "initial_temperature2" => 1.0, - "z_IC_option2" => "gaussian", - "z_IC_density_amplitude2" => 0.001, - "z_IC_density_phase2" => 0.0, - "z_IC_upar_amplitude2" => -1.0, - "z_IC_upar_phase2" => 0.0, - "z_IC_temperature_amplitude2" => 0.0, - "z_IC_temperature_phase2" => 0.0, - "vpa_IC_option2" => "gaussian", - "vpa_IC_density_amplitude2" => 1.0, - "vpa_IC_density_phase2" => 0.0, - "vpa_IC_upar_amplitude2" => 0.0, - "vpa_IC_upar_phase2" => 0.0, - "vpa_IC_temperature_amplitude2" => 0.0, - "vpa_IC_temperature_phase2" => 0.0, - "charge_exchange_frequency" => 0.5, + "ion_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => 1.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "charge_exchange_frequency" => 0.0, "ionization_frequency" => 0.05, "constant_ionization_rate" => true, - "timestepping" => Dict{String,Any}("nstep" => 3, + "timestepping" => OptionsDict("nstep" => 3, "dt" => 1.0e-12, "nwrite" => 2, "nwrite_dfns" => 2,), @@ -73,9 +58,9 @@ test_input = Dict( "vz_L" => 6.0, "vz_bc" => "zero", "vz_discretization" => "chebyshev_pseudospectral", - "numerical_dissipation" => Dict("vpa_dissipation_coefficient" => 1.0e-3, + "numerical_dissipation" => OptionsDict("vpa_dissipation_coefficient" => 1.0e-3, "vperp_dissipation_coefficient" => 1.0e-3), - "geometry" => Dict("DeltaB"=>0.0, + "geometry" => OptionsDict("DeltaB"=>0.0, "option"=>"constant-helical", "pitch"=>0.1, "rhostar"=> 0.1), diff --git a/moment_kinetics/debug_test/kinetic_electron_inputs.jl b/moment_kinetics/debug_test/kinetic_electron_inputs.jl index 684b114ff..cc8c50f3e 100644 --- a/moment_kinetics/debug_test/kinetic_electron_inputs.jl +++ b/moment_kinetics/debug_test/kinetic_electron_inputs.jl @@ -1,53 +1,54 @@ test_type = "Kinetic electron" +using moment_kinetics.type_definitions: OptionsDict -test_input = Dict("n_ion_species" => 1, - "n_neutral_species" => 1, - "electron_physics" => "kinetic_electrons", +test_input = OptionsDict("composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "kinetic_electrons", + "recycling_fraction" => 0.5, + "T_e" => 0.2, + "T_wall" => 0.1), "run_name" => "kinetic_electron", "base_directory" => test_output_directory, "evolve_moments_density" => true, "evolve_moments_parallel_flow" => true, "evolve_moments_parallel_pressure" => true, "evolve_moments_conservation" => true, - "recycling_fraction" => 0.5, - "T_e" => 0.2, - "T_wall" => 0.1, - "initial_density1" => 1.0, - "initial_temperature1" => 1.0, - "z_IC_option1" => "gaussian", - "z_IC_density_amplitude1" => 0.001, - "z_IC_density_phase1" => 0.0, - "z_IC_upar_amplitude1" => 1.0, - "z_IC_upar_phase1" => 0.0, - "z_IC_temperature_amplitude1" => 0.0, - "z_IC_temperature_phase1" => 0.0, - "vpa_IC_option1" => "gaussian", - "vpa_IC_density_amplitude1" => 1.0, - "vpa_IC_density_phase1" => 0.0, - "vpa_IC_upar_amplitude1" => 0.0, - "vpa_IC_upar_phase1" => 0.0, - "vpa_IC_temperature_amplitude1" => 0.0, - "vpa_IC_temperature_phase1" => 0.0, - "initial_density2" => 1.0, - "initial_temperature2" => 1.0, - "z_IC_option2" => "gaussian", - "z_IC_density_amplitude2" => 0.001, - "z_IC_density_phase2" => 0.0, - "z_IC_upar_amplitude2" => -1.0, - "z_IC_upar_phase2" => 0.0, - "z_IC_temperature_amplitude2" => 0.0, - "z_IC_temperature_phase2" => 0.0, - "vpa_IC_option2" => "gaussian", - "vpa_IC_density_amplitude2" => 1.0, - "vpa_IC_density_phase2" => 0.0, - "vpa_IC_upar_amplitude2" => 0.0, - "vpa_IC_upar_phase2" => 0.0, - "vpa_IC_temperature_amplitude2" => 0.0, - "vpa_IC_temperature_phase2" => 0.0, + "ion_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => 1.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "neutral_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => -1.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), "charge_exchange_frequency" => 0.75, "ionization_frequency" => 0.5, "constant_ionization_rate" => false, - "timestepping" => Dict{String,Any}("type" => "Fekete4(3)", + "timestepping" => OptionsDict("type" => "Fekete4(3)", "nstep" => 3, "dt" => 2.0e-8, "minimum_dt" => 1.0e-8, @@ -55,7 +56,7 @@ test_input = Dict("n_ion_species" => 1, "step_update_prefactor" => 0.4, "nwrite" => 2, "split_operators" => false), - "electron_timestepping" => Dict{String,Any}("type" => "Fekete4(3)", + "electron_timestepping" => OptionsDict("type" => "Fekete4(3)", "nstep" => 10, "dt" => 4.0e-11, "minimum_dt" => 2.0e-11, @@ -81,13 +82,13 @@ test_input = Dict("n_ion_species" => 1, "vz_L" => 6.0, "vz_bc" => "zero", "vz_discretization" => "chebyshev_pseudospectral", - "ion_source" => Dict{String,Any}("active" => true, + "ion_source" => OptionsDict("active" => true, "z_profile" => "gaussian", "z_width" => 0.125, "source_strength" => 2.0, "source_T" => 2.0), - "krook_collisions" => Dict{String,Any}("use_krook" => true), - "numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0, + "krook_collisions" => OptionsDict("use_krook" => true), + "numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0, "vpa_dissipation_coefficient" => 1e-2)) diff --git a/moment_kinetics/debug_test/mms_inputs.jl b/moment_kinetics/debug_test/mms_inputs.jl index 79fae0812..5db15d46b 100644 --- a/moment_kinetics/debug_test/mms_inputs.jl +++ b/moment_kinetics/debug_test/mms_inputs.jl @@ -1,39 +1,22 @@ +using moment_kinetics.type_definitions: OptionsDict test_type = "MMS" # default inputs for tests -test_input = Dict( - "use_manufactured_solns" => true, - "n_ion_species" => 1, - "n_neutral_species" => 1, - "electron_physics" => "boltzmann_electron_response", - "run_name" => "MMS-2D-wall_cheb-with-neutrals", +test_input = OptionsDict( + "manufactured_solns" => OptionsDict("use_for_advance"=>true), "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, + "composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0, + "T_wall" => 1.0), + "run_name" => "MMS-2D-wall_cheb-with-neutrals", "charge_exchange_frequency" => 0.0, "ionization_frequency" => 0.0, - "timestepping" => Dict{String,Any}("nstep" => 3, + "timestepping" => OptionsDict("nstep" => 3, "dt" => 1.e-8, "nwrite" => 2, "type" => "SSPRK2", @@ -70,7 +53,7 @@ test_input = Dict( "vzeta_L" => 12.0, "vzeta_bc" => "none", "vzeta_discretization" => "chebyshev_pseudospectral", - "geometry" => Dict{String,Any}("rhostar" => 1.0,), + "geometry" => OptionsDict("rhostar" => 1.0,), ) test_input_list = [ diff --git a/moment_kinetics/debug_test/recycling_fraction_inputs.jl b/moment_kinetics/debug_test/recycling_fraction_inputs.jl index 7f4b24266..fdefdfe8a 100644 --- a/moment_kinetics/debug_test/recycling_fraction_inputs.jl +++ b/moment_kinetics/debug_test/recycling_fraction_inputs.jl @@ -1,54 +1,55 @@ test_type = "Recycling fraction and adaptive timestepping" +using moment_kinetics.type_definitions: OptionsDict -test_input = Dict("n_ion_species" => 1, - "n_neutral_species" => 1, - "boltzmann_electron_response" => true, +test_input = OptionsDict("composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "boltzmann_electron_response", + "recycling_fraction" => 0.5, + "T_e" => 0.2, + "T_wall" => 2.0), + "ion_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), "run_name" => "full-f", "base_directory" => test_output_directory, "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => false, - "recycling_fraction" => 0.5, - "krook_collisions" => Dict{String,Any}("use_krook" => true), - "T_e" => 0.2, - "T_wall" => 2.0, - "initial_density1" => 1.0, - "initial_temperature1" => 1.0, - "z_IC_option1" => "gaussian", - "z_IC_density_amplitude1" => 0.001, - "z_IC_density_phase1" => 0.0, - "z_IC_upar_amplitude1" => 1.0, - "z_IC_upar_phase1" => 0.0, - "z_IC_temperature_amplitude1" => 0.0, - "z_IC_temperature_phase1" => 0.0, - "vpa_IC_option1" => "gaussian", - "vpa_IC_density_amplitude1" => 1.0, - "vpa_IC_density_phase1" => 0.0, - "vpa_IC_upar_amplitude1" => 0.0, - "vpa_IC_upar_phase1" => 0.0, - "vpa_IC_temperature_amplitude1" => 0.0, - "vpa_IC_temperature_phase1" => 0.0, - "initial_density2" => 1.0, - "initial_temperature2" => 1.0, - "z_IC_option2" => "gaussian", - "z_IC_density_amplitude2" => 0.001, - "z_IC_density_phase2" => 0.0, - "z_IC_upar_amplitude2" => -1.0, - "z_IC_upar_phase2" => 0.0, - "z_IC_temperature_amplitude2" => 0.0, - "z_IC_temperature_phase2" => 0.0, - "vpa_IC_option2" => "gaussian", - "vpa_IC_density_amplitude2" => 1.0, - "vpa_IC_density_phase2" => 0.0, - "vpa_IC_upar_amplitude2" => 0.0, - "vpa_IC_upar_phase2" => 0.0, - "vpa_IC_temperature_amplitude2" => 0.0, - "vpa_IC_temperature_phase2" => 0.0, + "krook_collisions" => OptionsDict("use_krook" => true), + "z_IC_ion_species_1" => OptionsDict("density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => 1.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0, + "initialization_option" => "gaussian"), + "vpa_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "neutral_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => -1.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), "charge_exchange_frequency" => 0.75, "ionization_frequency" => 0.5, "constant_ionization_rate" => false, - "timestepping" => Dict{String,Any}("type" => "Fekete4(3)", + "timestepping" => OptionsDict("type" => "Fekete4(3)", "nstep" => 3, "dt" => 1.0e-8, "minimum_dt" => 1.0e-8, @@ -73,7 +74,7 @@ test_input = Dict("n_ion_species" => 1, "vz_L" => 6.0, "vz_bc" => "zero", "vz_discretization" => "chebyshev_pseudospectral", - "ion_source" => Dict("active" => true, + "ion_source" => OptionsDict("active" => true, "z_profile" => "gaussian", "z_width" => 0.125, "source_strength" => 2.0, @@ -81,23 +82,23 @@ test_input = Dict("n_ion_species" => 1, test_input_split1 = merge(test_input, - Dict("run_name" => "split1", + OptionsDict("run_name" => "split1", "evolve_moments_density" => true, "evolve_moments_conservation" => true)) test_input_split2 = merge(test_input_split1, - Dict("run_name" => "split2", + OptionsDict("run_name" => "split2", "evolve_moments_parallel_flow" => true)) test_input_split2["timestepping"] = merge(test_input_split2["timestepping"], - Dict{String,Any}("step_update_prefactor" => 0.4)) + OptionsDict("step_update_prefactor" => 0.4)) test_input_split3 = merge(test_input_split2, - Dict("run_name" => "split3", + OptionsDict("run_name" => "split3", "evolve_moments_parallel_pressure" => true, "vpa_nelement" => 8, "vz_nelement" => 8, - "numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0, + "numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0, "vpa_dissipation_coefficient" => 1e-2))) test_input_split3["timestepping"] = merge(test_input_split3["timestepping"], - Dict{String,Any}("dt" => 1.0e-9, + OptionsDict("dt" => 1.0e-9, "minimum_dt" => 1.0e-9)) diff --git a/moment_kinetics/debug_test/restart_interpolation_inputs.jl b/moment_kinetics/debug_test/restart_interpolation_inputs.jl index c914bc231..1041423cf 100644 --- a/moment_kinetics/debug_test/restart_interpolation_inputs.jl +++ b/moment_kinetics/debug_test/restart_interpolation_inputs.jl @@ -1,38 +1,21 @@ test_type = "restart_interpolation" +using moment_kinetics.type_definitions: OptionsDict # default inputs for tests -base_input = Dict( +base_input = OptionsDict( "run_name" => "base", - "n_ion_species" => 2, - "n_neutral_species" => 2, - "boltzmann_electron_response" => true, + "composition" => OptionsDict("n_ion_species" => 2, + "n_neutral_species" => 2, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0), "base_directory" => test_output_directory, "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => true, - "T_e" => 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" => 2*π*0.1, "ionization_frequency" => 0.0, - "timestepping" => Dict{String,Any}("nstep" => 3, + "timestepping" => OptionsDict("nstep" => 3, "dt" => 0.0, "nwrite" => 2, "type" => "SSPRK2", @@ -59,29 +42,29 @@ base_input = Dict( "vzeta_nelement" => 1, "vr_ngrid" => 1, "vr_nelement" => 1, - "ion_numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0), - "neutral_numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0)) + "ion_numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0), + "neutral_numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0)) test_input = merge(base_input, - Dict("run_name" => "full-f", + OptionsDict("run_name" => "full-f", "z_nelement" => 3, "vpa_nelement" => 3, "vz_nelement" => 3)) test_input_split1 = merge(test_input, - Dict("run_name" => "split1", + OptionsDict("run_name" => "split1", "evolve_moments_density" => true)) test_input_split2 = merge(test_input_split1 , - Dict("run_name" => "split2", + OptionsDict("run_name" => "split2", "evolve_moments_parallel_flow" => true)) test_input_split3 = merge(test_input_split2, - Dict("run_name" => "split3", + OptionsDict("run_name" => "split3", "evolve_moments_parallel_pressure" => true)) test_input_list = [ diff --git a/moment_kinetics/debug_test/sound_wave_inputs.jl b/moment_kinetics/debug_test/sound_wave_inputs.jl index 5bbbbb0d6..45b8caedc 100644 --- a/moment_kinetics/debug_test/sound_wave_inputs.jl +++ b/moment_kinetics/debug_test/sound_wave_inputs.jl @@ -1,38 +1,21 @@ test_type = "sound_wave" +using moment_kinetics.type_definitions: OptionsDict # default inputs for tests -test_input_finite_difference_1D1V = Dict( +test_input_finite_difference_1D1V = OptionsDict( "run_name" => "finite_difference_1D1V", - "n_ion_species" => 2, - "n_neutral_species" => 2, - "boltzmann_electron_response" => true, + "composition" => OptionsDict("n_ion_species" => 2, + "n_neutral_species" => 2, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0), "base_directory" => test_output_directory, "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => true, - "T_e" => 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" => 2*π*0.1, "ionization_frequency" => 0.0, - "timestepping" => Dict{String,Any}("nstep" => 3, + "timestepping" => OptionsDict("nstep" => 3, "dt" => 1.e-8, "nwrite" => 2, "type" => "SSPRK2", @@ -62,42 +45,42 @@ test_input_finite_difference_1D1V = Dict( test_input_finite_difference_1D1V_split_1_moment = merge(test_input_finite_difference_1D1V, - Dict("run_name" => "finite_difference_1D1V_split_1_moment", + OptionsDict("run_name" => "finite_difference_1D1V_split_1_moment", "evolve_moments_density" => true)) test_input_finite_difference_1D1V_split_2_moments = merge(test_input_finite_difference_1D1V_split_1_moment, - Dict("run_name" => "finite_difference_1D1V_split_2_moments", + OptionsDict("run_name" => "finite_difference_1D1V_split_2_moments", "evolve_moments_parallel_flow" => true)) test_input_finite_difference_1D1V_split_3_moments = merge(test_input_finite_difference_1D1V_split_2_moments, - Dict("run_name" => "finite_difference_1D1V_split_3_moments", + OptionsDict("run_name" => "finite_difference_1D1V_split_3_moments", "evolve_moments_parallel_pressure" => true)) test_input_finite_difference_cx0_1D1V = merge(test_input_finite_difference_1D1V, - Dict("run_name" => "finite_difference_cx0_1D1V", + OptionsDict("run_name" => "finite_difference_cx0_1D1V", "charge_exchange_frequency" => 0.0)) test_input_finite_difference_cx0_1D1V_split_1_moment = merge(test_input_finite_difference_cx0_1D1V, - Dict("run_name" => "finite_difference_cx0_1D1V_split_1_moment", + OptionsDict("run_name" => "finite_difference_cx0_1D1V_split_1_moment", "evolve_moments_density" => true)) test_input_finite_difference_cx0_1D1V_split_2_moments = merge(test_input_finite_difference_cx0_1D1V_split_1_moment, - Dict("run_name" => "finite_difference_cx0_1D1V_split_2_moments", + OptionsDict("run_name" => "finite_difference_cx0_1D1V_split_2_moments", "evolve_moments_parallel_flow" => true)) test_input_finite_difference_cx0_1D1V_split_3_moments = merge(test_input_finite_difference_cx0_1D1V_split_2_moments, - Dict("run_name" => "finite_difference_cx0_1D1V_split_3_moments", + OptionsDict("run_name" => "finite_difference_cx0_1D1V_split_3_moments", "evolve_moments_parallel_pressure" => true)) test_input_finite_difference = merge(test_input_finite_difference_1D1V, - Dict("run_name" => "finite_difference", + OptionsDict("run_name" => "finite_difference", "r_ngrid" => 4, "r_nelement" => 1, "r_discretization" => "finite_difference", @@ -116,41 +99,41 @@ test_input_finite_difference = test_input_finite_difference_split_1_moment = merge(test_input_finite_difference, - Dict("run_name" => "finite_difference_split_1_moment", + OptionsDict("run_name" => "finite_difference_split_1_moment", "evolve_moments_density" => true)) test_input_finite_difference_split_2_moments = merge(test_input_finite_difference_split_1_moment, - Dict("run_name" => "finite_difference_split_2_moments", + OptionsDict("run_name" => "finite_difference_split_2_moments", "evolve_moments_parallel_flow" => true)) test_input_finite_difference_split_3_moments = merge(test_input_finite_difference_split_2_moments, - Dict("run_name" => "finite_difference_split_3_moments", + OptionsDict("run_name" => "finite_difference_split_3_moments", "evolve_moments_parallel_pressure" => true)) test_input_finite_difference_cx0 = merge(test_input_finite_difference, - Dict("run_name" => "finite_difference_cx0", + OptionsDict("run_name" => "finite_difference_cx0", "charge_exchange_frequency" => 0.0)) test_input_finite_difference_cx0_split_1_moment = merge(test_input_finite_difference_cx0, - Dict("run_name" => "finite_difference_cx0_split_1_moment", + OptionsDict("run_name" => "finite_difference_cx0_split_1_moment", "evolve_moments_density" => true)) test_input_finite_difference_cx0_split_2_moments = merge(test_input_finite_difference_cx0_split_1_moment, - Dict("run_name" => "finite_difference_cx0_split_2_moments", + OptionsDict("run_name" => "finite_difference_cx0_split_2_moments", "evolve_moments_parallel_flow" => true)) test_input_finite_difference_cx0_split_3_moments = merge(test_input_finite_difference_cx0_split_2_moments, - Dict("run_name" => "finite_difference_cx0_split_3_moments", + OptionsDict("run_name" => "finite_difference_cx0_split_3_moments", "evolve_moments_parallel_pressure" => true)) test_input_chebyshev = merge(test_input_finite_difference, - Dict("run_name" => "chebyshev_pseudospectral", + OptionsDict("run_name" => "chebyshev_pseudospectral", "r_discretization" => "chebyshev_pseudospectral", "r_ngrid" => 3, "r_nelement" => 1, @@ -175,42 +158,42 @@ test_input_chebyshev = merge(test_input_finite_difference, test_input_chebyshev_split_1_moment = merge(test_input_chebyshev, - Dict("run_name" => "chebyshev_pseudospectral_split_1_moment", + OptionsDict("run_name" => "chebyshev_pseudospectral_split_1_moment", "evolve_moments_density" => true)) test_input_chebyshev_split_2_moments = merge(test_input_chebyshev_split_1_moment, - Dict("run_name" => "chebyshev_pseudospectral_split_2_moments", + OptionsDict("run_name" => "chebyshev_pseudospectral_split_2_moments", "evolve_moments_parallel_flow" => true)) test_input_chebyshev_split_3_moments = merge(test_input_chebyshev_split_2_moments, - Dict("run_name" => "chebyshev_pseudospectral_split_3_moments", + OptionsDict("run_name" => "chebyshev_pseudospectral_split_3_moments", "evolve_moments_parallel_pressure" => true)) test_input_chebyshev_cx0 = merge(test_input_chebyshev, - Dict("run_name" => "chebyshev_pseudospectral_cx0", + OptionsDict("run_name" => "chebyshev_pseudospectral_cx0", "charge_exchange_frequency" => 0.0)) test_input_chebyshev_cx0_split_1_moment = merge(test_input_chebyshev_cx0, - Dict("run_name" => "chebyshev_pseudospectral_cx0_split_1_moment", + OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_split_1_moment", "evolve_moments_density" => true)) test_input_chebyshev_cx0_split_2_moments = merge(test_input_chebyshev_cx0_split_1_moment, - Dict("run_name" => "chebyshev_pseudospectral_cx0_split_2_moments", + OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_split_2_moments", "evolve_moments_parallel_flow" => true)) test_input_chebyshev_cx0_split_3_moments = merge(test_input_chebyshev_cx0_split_2_moments, - Dict("run_name" => "chebyshev_pseudospectral_cx0_split_3_moments", + OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_split_3_moments", "evolve_moments_parallel_pressure" => true)) test_input_chebyshev_1D1V = merge(test_input_finite_difference_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_1D1V", + OptionsDict("run_name" => "chebyshev_pseudospectral_1D1V", "z_discretization" => "chebyshev_pseudospectral", "z_ngrid" => 3, "z_nelement" => 2, @@ -223,37 +206,37 @@ test_input_chebyshev_1D1V = test_input_chebyshev_1D1V_split_1_moment = merge(test_input_chebyshev_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_1D1V_split_1_moment", + OptionsDict("run_name" => "chebyshev_pseudospectral_1D1V_split_1_moment", "evolve_moments_density" => true)) test_input_chebyshev_1D1V_split_2_moments = merge(test_input_chebyshev_1D1V_split_1_moment, - Dict("run_name" => "chebyshev_pseudospectral_1D1V_split_2_moments", + OptionsDict("run_name" => "chebyshev_pseudospectral_1D1V_split_2_moments", "evolve_moments_parallel_flow" => true)) test_input_chebyshev_1D1V_split_3_moments = merge(test_input_chebyshev_1D1V_split_2_moments, - Dict("run_name" => "chebyshev_pseudospectral_1D1V_split_3_moments", + OptionsDict("run_name" => "chebyshev_pseudospectral_1D1V_split_3_moments", "evolve_moments_parallel_pressure" => true, "runtime_plots" => true)) test_input_chebyshev_cx0_1D1V = merge(test_input_chebyshev_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_cx0_1D1V", + OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_1D1V", "charge_exchange_frequency" => 0.0)) test_input_chebyshev_cx0_1D1V_split_1_moment = merge(test_input_chebyshev_cx0_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_cx0_1D1V_split_1_moment", + OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_1D1V_split_1_moment", "evolve_moments_density" => true)) test_input_chebyshev_cx0_1D1V_split_2_moments = merge(test_input_chebyshev_cx0_1D1V_split_1_moment, - Dict("run_name" => "chebyshev_pseudospectral_cx0_1D1V_split_2_moments", + OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_1D1V_split_2_moments", "evolve_moments_parallel_flow" => true)) test_input_chebyshev_cx0_1D1V_split_3_moments = merge(test_input_chebyshev_cx0_1D1V_split_2_moments, - Dict("run_name" => "chebyshev_pseudospectral_cx0_1D1V_split_3_moments", + OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_1D1V_split_3_moments", "evolve_moments_parallel_pressure" => true)) test_input_list = [ diff --git a/moment_kinetics/debug_test/wall_bc_inputs.jl b/moment_kinetics/debug_test/wall_bc_inputs.jl index 7e7b2ef85..6698d2700 100644 --- a/moment_kinetics/debug_test/wall_bc_inputs.jl +++ b/moment_kinetics/debug_test/wall_bc_inputs.jl @@ -1,55 +1,24 @@ test_type = "Wall boundary conditions" +using moment_kinetics.type_definitions: OptionsDict +using moment_kinetics.input_structs: merge_dict_of_dicts # default inputs for tests -test_input_finite_difference_1D1V = Dict( +test_input_finite_difference_1D1V = OptionsDict( "run_name" => "finite_difference_1D1V", - "n_ion_species" => 2, - "n_neutral_species" => 2, - "boltzmann_electron_response" => true, + "composition" => OptionsDict("n_ion_species" => 2, + "n_neutral_species" => 2, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0, + "T_wall" => 1.0), "base_directory" => test_output_directory, "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => true, - "electron_physics" => "boltzmann_electron_response", - "T_e" => 1.0, - "T_wall" => 1.0, - "initial_density1" => 1.0, - "initial_temperature1" => 1.0, - "z_IC_option1" => "gaussian", - "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, - "vpa_IC_option1" => "gaussian", - "vpa_IC_density_amplitude1" => 1.0, - "vpa_IC_density_phase1" => 0.0, - "vpa_IC_upar_amplitude1" => 0.0, - "vpa_IC_upar_phase1" => 0.0, - "vpa_IC_temperature_amplitude1" => 0.0, - "vpa_IC_temperature_phase1" => 0.0, - "initial_density2" => 1.0, - "initial_temperature2" => 1.0, - "z_IC_option2" => "gaussian", - "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_option2" => "gaussian", - "vpa_IC_density_amplitude2" => 1.0, - "vpa_IC_density_phase2" => 0.0, - "vpa_IC_upar_amplitude2" => 0.0, - "vpa_IC_upar_phase2" => 0.0, - "vpa_IC_temperature_amplitude2" => 0.0, - "vpa_IC_temperature_phase2" => 0.0, "charge_exchange_frequency" => 2.0, "ionization_frequency" => 2.0, "constant_ionization_rate" => false, - "timestepping" => Dict{String,Any}("nstep" => 3, + "timestepping" => OptionsDict("nstep" => 3, "dt" => 1.0e-8, "nwrite" => 2, "type" => "SSPRK2", @@ -77,14 +46,14 @@ test_input_finite_difference_1D1V = Dict( "vr_ngrid" => 1, "vr_nelement" => 1) -test_input_finite_difference_simple_sheath_1D1V = merge( +test_input_finite_difference_simple_sheath_1D1V = merge_dict_of_dicts( test_input_finite_difference_1D1V, - Dict("run_name" => "finite_difference_simple_sheath_1D1V", - "electron_physics" => "boltzmann_electron_response_with_simple_sheath")) + OptionsDict("run_name" => "finite_difference_simple_sheath_1D1V", + "composition" => OptionsDict("electron_physics" => "boltzmann_electron_response_with_simple_sheath"))) test_input_finite_difference = merge( test_input_finite_difference_1D1V, - Dict("run_name" => "finite_difference", + OptionsDict("run_name" => "finite_difference", "r_ngrid" => 4, "r_nelement" => 1, "r_discretization" => "finite_difference", @@ -101,14 +70,14 @@ test_input_finite_difference = merge( "vzeta_nelement" => 1, "vzeta_discretization" => "finite_difference")) -test_input_finite_difference_simple_sheath = merge( +test_input_finite_difference_simple_sheath = merge_dict_of_dicts( test_input_finite_difference, - Dict("run_name" => "finite_difference_simple_sheath", - "electron_physics" => "boltzmann_electron_response_with_simple_sheath")) + OptionsDict("run_name" => "finite_difference_simple_sheath", + "composition" => OptionsDict("electron_physics" => "boltzmann_electron_response_with_simple_sheath"))) test_input_chebyshev_1D1V = merge( test_input_finite_difference_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_1D1V", + OptionsDict("run_name" => "chebyshev_pseudospectral_1D1V", "z_discretization" => "chebyshev_pseudospectral", "z_ngrid" => 3, "z_nelement" => 2, @@ -120,26 +89,26 @@ test_input_chebyshev_1D1V = merge( "vz_nelement" => 2)) test_input_chebyshev_split1_1D1V = merge(test_input_chebyshev_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_split1_1D1V", + OptionsDict("run_name" => "chebyshev_pseudospectral_split1_1D1V", "evolve_moments_density" => true)) test_input_chebyshev_split2_1D1V = merge(test_input_chebyshev_split1_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_split2_1D1V", + OptionsDict("run_name" => "chebyshev_pseudospectral_split2_1D1V", "evolve_moments_parallel_flow" => true)) test_input_chebyshev_split3_1D1V = merge(test_input_chebyshev_split2_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_split3_1D1V", + OptionsDict("run_name" => "chebyshev_pseudospectral_split3_1D1V", "evolve_moments_parallel_pressure" => true)) -test_input_chebyshev_simple_sheath_1D1V = merge( +test_input_chebyshev_simple_sheath_1D1V = merge_dict_of_dicts( test_input_chebyshev_1D1V, - Dict("run_name" => "chebyshev_pseudospectral_simple_sheath_1D1V", - "electron_physics" => "boltzmann_electron_response_with_simple_sheath")) + OptionsDict("run_name" => "chebyshev_pseudospectral_simple_sheath_1D1V", + "composition" => OptionsDict("electron_physics" => "boltzmann_electron_response_with_simple_sheath"))) test_input_chebyshev = merge( test_input_chebyshev_1D1V, - Dict("run_name" => "chebyshev_pseudospectral", + OptionsDict("run_name" => "chebyshev_pseudospectral", "r_discretization" => "chebyshev_pseudospectral", "r_ngrid" => 3, "r_nelement" => 1, @@ -156,10 +125,10 @@ test_input_chebyshev = merge( "vzeta_ngrid" => 3, "vzeta_nelement" => 1)) -test_input_chebyshev_simple_sheath = merge( +test_input_chebyshev_simple_sheath = merge_dict_of_dicts( test_input_chebyshev, - Dict("run_name" => "chebyshev_pseudospectral_simple_sheath", - "electron_physics" => "boltzmann_electron_response_with_simple_sheath")) + OptionsDict("run_name" => "chebyshev_pseudospectral_simple_sheath", + "composition" => OptionsDict("electron_physics" => "boltzmann_electron_response_with_simple_sheath"))) test_input_list = [ #test_input_finite_difference, diff --git a/moment_kinetics/src/communication.jl b/moment_kinetics/src/communication.jl index be3ed60a3..f8fa46fff 100644 --- a/moment_kinetics/src/communication.jl +++ b/moment_kinetics/src/communication.jl @@ -433,7 +433,7 @@ end previous_is_read .= true previous_is_written = Array{Bool}(undef, dims) previous_is_written .= true - return DebugMPISharedArray(array, is_initialized, is_read, is_written, + return DebugMPISharedArray(array, accessed, is_initialized, is_read, is_written, creation_stack_trace, previous_is_read, previous_is_written) end diff --git a/moment_kinetics/src/file_io.jl b/moment_kinetics/src/file_io.jl index 2515be182..5f6adab0d 100644 --- a/moment_kinetics/src/file_io.jl +++ b/moment_kinetics/src/file_io.jl @@ -19,7 +19,6 @@ using ..type_definitions: mk_float, mk_int using LibGit2 using MPI using Pkg -using TOML @debug_shared_array using ..communication: DebugMPISharedArray @@ -678,9 +677,7 @@ function write_provenance_tracking_info!(fid, parallel_io, run_id, restart_time_ # Convert input_dict into a TOML-formatted string so that we can store it in a # single variable. io_buffer = IOBuffer() - # The `mk_to_toml` function allows converting extra types (e.g. Enum) to things - # that can be printed to a TOML string/file. - TOML.print(mk_to_toml, io_buffer, input_dict) + options_to_TOML(io_buffer, input_dict) input_string = String(take!(io_buffer)) write_single_value!(provenance_tracking, "input", input_string, parallel_io=parallel_io, diff --git a/moment_kinetics/src/fokker_planck.jl b/moment_kinetics/src/fokker_planck.jl index fb9c6ef19..2365ce0c4 100644 --- a/moment_kinetics/src/fokker_planck.jl +++ b/moment_kinetics/src/fokker_planck.jl @@ -70,6 +70,7 @@ using ..fokker_planck_calculus: calculate_rosenbluth_potentials_via_elliptic_sol using ..fokker_planck_test: Cssp_fully_expanded_form, calculate_collisional_fluxes, H_Maxwellian, dGdvperp_Maxwellian using ..fokker_planck_test: d2Gdvpa2_Maxwellian, d2Gdvperpdvpa_Maxwellian, d2Gdvperp2_Maxwellian, dHdvpa_Maxwellian, dHdvperp_Maxwellian using ..fokker_planck_test: F_Maxwellian, dFdvpa_Maxwellian, dFdvperp_Maxwellian +using ..reference_parameters: setup_reference_parameters """ Function for reading Fokker Planck collision operator input parameters. @@ -80,7 +81,8 @@ use_fokker_planck = true nuii = 1.0 frequency_option = "manual" """ -function setup_fkpl_collisions_input(toml_input::Dict, reference_params) +function setup_fkpl_collisions_input(toml_input::Dict) + reference_params = setup_reference_parameters(toml_input) # get reference collision frequency (note factor of 1/2 due to definition choices) nuii_fkpl_default = 0.5*get_reference_collision_frequency_ii(reference_params) # read the input toml and specify a sensible default diff --git a/moment_kinetics/src/geo.jl b/moment_kinetics/src/geo.jl index 3635230dc..41be4d0db 100644 --- a/moment_kinetics/src/geo.jl +++ b/moment_kinetics/src/geo.jl @@ -12,7 +12,7 @@ using ..input_structs: geometry_input, set_defaults_and_check_section! using ..file_io: input_option_error using ..array_allocation: allocate_float using ..type_definitions: mk_float, mk_int - +using ..reference_parameters: setup_reference_parameters """ struct containing the geometric data necessary for @@ -60,6 +60,15 @@ gbdriftr::Array{mk_float,2} gbdriftz::Array{mk_float,2} end +""" + function get_default_rhostar(reference_params) + +Calculate the normalised ion gyroradius at reference parameters +""" +function get_default_rhostar(reference_params) + return reference_params.cref / reference_params.Omegaref / reference_params.Lref +end + """ function to read the geometry input data from the TOML file @@ -72,7 +81,10 @@ DeltaB = 0.0 option = "" """ -function setup_geometry_input(toml_input::Dict, reference_rhostar) +function setup_geometry_input(toml_input::Dict) + + reference_params = setup_reference_parameters(toml_input) + reference_rhostar = get_default_rhostar(reference_params) # read the input toml and specify a sensible default input_section = set_defaults_and_check_section!(toml_input, "geometry", # begin default inputs (as kwargs) diff --git a/moment_kinetics/src/input_structs.jl b/moment_kinetics/src/input_structs.jl index 30bc39cb2..2c257d5f1 100644 --- a/moment_kinetics/src/input_structs.jl +++ b/moment_kinetics/src/input_structs.jl @@ -8,8 +8,8 @@ export time_info export advection_input, advection_input_mutable export grid_input, grid_input_mutable export initial_condition_input, initial_condition_input_mutable -export mk_to_toml -export species_parameters, species_parameters_mutable +export spatial_initial_condition_input, velocity_initial_condition_input +export ion_species_parameters, neutral_species_parameters, species_parameters_mutable export species_composition export drive_input, drive_input_mutable export collisions_input, krook_collisions_input, fkpl_collisions_input @@ -17,12 +17,14 @@ export io_input export pp_input export geometry_input export set_defaults_and_check_top_level!, set_defaults_and_check_section!, - Dict_to_NamedTuple + options_to_TOML, Dict_to_NamedTuple +export merge_dict_with_kwargs!, merge_dict_of_dicts!, merge_dict_of_dicts using ..communication using ..type_definitions: mk_float, mk_int using MPI +using TOML """ """ @@ -263,7 +265,26 @@ end """ """ -struct initial_condition_input +Base.@kwdef struct spatial_initial_condition_input + # initialization inputs for one coordinate of a separable distribution function + initialization_option::String + # inputs for "gaussian" initial condition + width::mk_float + # inputs for "sinusoid" initial condition + wavenumber::mk_int + density_amplitude::mk_float + density_phase::mk_float + upar_amplitude::mk_float + upar_phase::mk_float + temperature_amplitude::mk_float + temperature_phase::mk_float + # inputs for "monomial" initial condition + monomial_degree::mk_int +end + +""" +""" +Base.@kwdef struct velocity_initial_condition_input # initialization inputs for one coordinate of a separable distribution function initialization_option::String # inputs for "gaussian" initial condition @@ -304,25 +325,49 @@ end """ """ -struct species_parameters - # type is the type of species; options are 'ion' or 'neutral' +Base.@kwdef struct ion_species_parameters + # type is the type of species type::String + # mass/reference mass + mass::mk_float + # charge number, absolute w.r.t. proton charge + zeds::mk_float # array containing the initial line-averaged temperature for this species initial_temperature::mk_float # array containing the initial line-averaged density for this species initial_density::mk_float # struct containing the initial condition info in z for this species - z_IC::initial_condition_input + z_IC::spatial_initial_condition_input # struct containing the initial condition info in r for this species - r_IC::initial_condition_input + r_IC::spatial_initial_condition_input # struct containing the initial condition info in vpa for this species - vpa_IC::initial_condition_input + vpa_IC::velocity_initial_condition_input end """ """ -mutable struct species_composition +Base.@kwdef struct neutral_species_parameters + # type is the type of species + type::String + # mass/reference mass + mass::mk_float + # array containing the initial line-averaged temperature for this species + initial_temperature::mk_float + # array containing the initial line-averaged density for this species + initial_density::mk_float + # struct containing the initial condition info in z for this species + z_IC::spatial_initial_condition_input + # struct containing the initial condition info in r for this species + r_IC::spatial_initial_condition_input + # struct containing the initial condition info in vpa for this species + vpa_IC::velocity_initial_condition_input +end + +""" +""" +Base.@kwdef struct species_composition # n_species = total number of evolved species (including ions, neutrals and electrons) + # a diagnostic, not an input parameter n_species::mk_int # n_ion_species is the number of evolved ion species n_ion_species::mk_int @@ -343,7 +388,6 @@ mutable struct species_composition T_wall::mk_float # wall potential used if electron_physics=boltzmann_electron_response_with_simple_sheath phi_wall::mk_float - # constant for testing nonzero Er # ratio of the neutral particle mass to the ion mass mn_over_mi::mk_float # ratio of the electron particle mass to the ion mass @@ -355,8 +399,10 @@ mutable struct species_composition # gyrokinetic_ions = true -> use gyroaveraged fields at fixed guiding centre and moments of the pdf computed at fixed r # gyrokinetic_ions = false -> use drift kinetic approximation gyrokinetic_ions::Bool - # scratch buffer whose size is n_species - scratch::Vector{mk_float} + # array of structs of parameters for each ion species + ion::Vector{ion_species_parameters} + # array of structs of parameters for each neutral species + neutral::Vector{neutral_species_parameters} end """ @@ -698,17 +744,6 @@ function get(d::Dict, key, default::Enum) end end -""" -Convert some types used by moment_kinetics to types that are supported by TOML -""" -function mk_to_toml(value) - if isa(value, Enum) - return string(value) - else - return value - end -end - """ Set the defaults for options in the top level of the input, and check that there are not any unexpected options (i.e. options that have no default). @@ -778,9 +813,11 @@ function set_defaults_and_check_section!(options::AbstractDict, section_name; end # Set default values if a key was not set explicitly - for (key_sym, value) ∈ kwargs + for (key_sym, default_value) ∈ kwargs key = String(key_sym) - section[key] = get(section, key, value) + # Use `Base.get()` here to take advantage of our `Enum`-handling method of + # `Base.get()` defined above. + section[key] = get(section, key, default_value) end return section @@ -795,4 +832,76 @@ function Dict_to_NamedTuple(d) return NamedTuple(Symbol(k)=>v for (k,v) ∈ d) end +""" +Dict merge function for named keyword arguments +for case when input Dict is a mixed Dict of Dicts +and non-Dict float/int/string entries, and the +keyword arguments are also a mix of Dicts and non-Dicts +""" + +function merge_dict_with_kwargs!(dict_base; args...) + for (k,v) in args + k = String(k) + if k in keys(dict_base) && isa(v, AbstractDict) + v = merge(dict_base[k], v) + end + dict_base[k] = v + end + return nothing +end + +""" +Dict merge function for merging Dicts of Dicts +In place merge, returns nothing +""" + +function merge_dict_of_dicts!(dict_base, dict_mod) + for (k,v) in dict_mod + k = String(k) + if k in keys(dict_base) && isa(v, AbstractDict) + v = merge(dict_base[k], v) + end + dict_base[k] = v + end + return nothing +end + +""" +Dict merge function for merging Dicts of Dicts +Creates new dict, which is returned +""" + +function merge_dict_of_dicts(dict_base, dict_mod) + dict_new = deepcopy(dict_base) + for (k,v) in dict_mod + k = String(k) + if k in keys(dict_new) && isa(v, AbstractDict) + v = merge(dict_new[k], v) + end + dict_new[k] = v + end + return dict_new +end + +""" + options_to_toml(io::IO [=stdout], data::AbstractDict; sorted=false, by=identity) + +Convert `moment_kinetics` 'options' (in the form of a `Dict`) to TOML format. + +This function is defined so that we can handle some extra types, for example `Enum`. + +For descriptions of the arguments, see `TOML.print`. +""" +function options_to_TOML(args...; kwargs...) + function handle_extra_types(x) + if isa(x, Enum) + return string(x) + else + error("Unhandled type $(typeof(x)) for x=$x") + end + end + + return TOML.print(handle_extra_types, args...; kwargs...) +end + end diff --git a/moment_kinetics/src/krook_collisions.jl b/moment_kinetics/src/krook_collisions.jl index 1880610e9..c05d0cd08 100644 --- a/moment_kinetics/src/krook_collisions.jl +++ b/moment_kinetics/src/krook_collisions.jl @@ -10,6 +10,7 @@ using ..input_structs: krook_collisions_input, set_defaults_and_check_section! using ..reference_parameters: get_reference_collision_frequency_ii, get_reference_collision_frequency_ee, get_reference_collision_frequency_ei +using ..reference_parameters: setup_reference_parameters """ @@ -21,7 +22,8 @@ use_krook = true nuii0 = 1.0 frequency_option = "manual" """ -function setup_krook_collisions_input(toml_input::Dict, reference_params) +function setup_krook_collisions_input(toml_input::Dict) + reference_params = setup_reference_parameters(toml_input) # get reference collision frequency nuii_krook_default = get_reference_collision_frequency_ii(reference_params) nuee_krook_default = get_reference_collision_frequency_ee(reference_params) diff --git a/moment_kinetics/src/load_data.jl b/moment_kinetics/src/load_data.jl index f4c887b84..3eb5ebbd0 100644 --- a/moment_kinetics/src/load_data.jl +++ b/moment_kinetics/src/load_data.jl @@ -30,7 +30,7 @@ using ..looping using ..moment_kinetics_input: mk_input using ..neutral_vz_advection: update_speed_neutral_vz! using ..neutral_z_advection: update_speed_neutral_z! -using ..type_definitions: mk_float, mk_int +using ..type_definitions: mk_float, mk_int, OptionsDict using ..utils: get_CFL!, get_minimum_CFL_z, get_minimum_CFL_vpa, get_minimum_CFL_neutral_z, get_minimum_CFL_neutral_vz, enum_from_string using ..vpa_advection: update_speed_vpa! @@ -189,7 +189,7 @@ function read_Dict_from_section(file_or_group, section_name; ignore_subsections= # Function that can be called recursively to read nested Dicts from sub-groups in # the output file section_io = get_group(file_or_group, section_name) - section = Dict{String,Any}() + section = OptionsDict() for key ∈ get_variable_keys(section_io) section[key] = load_variable(section_io, key) diff --git a/moment_kinetics/src/maxwell_diffusion.jl b/moment_kinetics/src/maxwell_diffusion.jl index 03b4daa96..124e43176 100644 --- a/moment_kinetics/src/maxwell_diffusion.jl +++ b/moment_kinetics/src/maxwell_diffusion.jl @@ -18,7 +18,7 @@ export setup_mxwl_diff_collisions_input, ion_vpa_maxwell_diffusion!, neutral_vz_ using ..looping using ..input_structs: mxwl_diff_collisions_input, set_defaults_and_check_section! using ..calculus: second_derivative! -using ..reference_parameters: get_reference_collision_frequency_ii +using ..reference_parameters: get_reference_collision_frequency_ii, setup_reference_parameters """ Function for reading Maxwell diffusion operator input parameters. @@ -29,7 +29,8 @@ use_maxwell_diffusion = true D_ii = 1.0 diffusion_coefficient_option = "manual" """ -function setup_mxwl_diff_collisions_input(toml_input::Dict, reference_params) +function setup_mxwl_diff_collisions_input(toml_input::Dict) + reference_params = setup_reference_parameters(toml_input) # get reference diffusion coefficient, made up of collision frequency and # thermal speed for now. NOTE THAT THIS CONSTANT PRODUCES ERRORS. DO NOT USE D_ii_mxwl_diff_default = get_reference_collision_frequency_ii(reference_params)# * @@ -256,4 +257,4 @@ function neutral_vz_maxwell_diffusion!(f_out, f_in, moments, vzeta, vr, vz, spec return nothing end -end # maxwell_diffusion \ No newline at end of file +end # maxwell_diffusion diff --git a/moment_kinetics/src/moment_kinetics.jl b/moment_kinetics/src/moment_kinetics.jl index 3712ba994..4c57e6ed8 100644 --- a/moment_kinetics/src/moment_kinetics.jl +++ b/moment_kinetics/src/moment_kinetics.jl @@ -68,6 +68,7 @@ include("energy_equation.jl") include("force_balance.jl") include("source_terms.jl") include("numerical_dissipation.jl") +include("species_input.jl") include("moment_kinetics_input.jl") include("utils.jl") include("load_data.jl") diff --git a/moment_kinetics/src/moment_kinetics_input.jl b/moment_kinetics/src/moment_kinetics_input.jl index 12e0a879f..99459663c 100644 --- a/moment_kinetics/src/moment_kinetics_input.jl +++ b/moment_kinetics/src/moment_kinetics_input.jl @@ -6,9 +6,8 @@ export mk_input export performance_test #export advective_form export read_input_file -export get_default_rhostar -using ..type_definitions: mk_float, mk_int +using ..type_definitions: mk_float, mk_int, OptionsDict using ..array_allocation: allocate_float using ..communication using ..coordinates: define_coordinate @@ -22,7 +21,7 @@ using ..input_structs using ..numerical_dissipation: setup_numerical_dissipation using ..reference_parameters using ..geo: init_magnetic_geometry, setup_geometry_input - +using ..species_input: get_species_input using MPI using TOML using UUIDs @@ -54,7 +53,11 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) # Check for input options that used to exist, but do not any more. If these are # present, the user probably needs to update their input file. - removed_options_list = ("Bzed", "Bmag", "rhostar", "geometry_option", "pitch", "DeltaB") + removed_options_list = ("Bzed", "Bmag", "rhostar", "geometry_option", "pitch", "DeltaB", + "n_ion_species","n_neutral_species","recycling_fraction","gyrokinetic_ions","T_e","T_wall", + "z_IC_option1","z_IC_option2","vpa_IC_option1","vpa_IC_option2", + "boltzmann_electron_response","boltzmann_electron_response_with_simple_sheath", + "electron_physics","nstep","dt") for opt in removed_options_list if opt ∈ keys(scan_input) error("Option '$opt' is no longer used. Please update your input file. You " @@ -62,22 +65,14 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) * "removed ones.") end end - - # n_ion_species is the number of evolved ion species - # currently only n_ion_species = 1 is supported - n_ion_species = get(scan_input, "n_ion_species", 1) - # n_neutral_species is the number of evolved neutral species - # currently only n_neutral_species = 0,1 is supported - n_neutral_species = get(scan_input, "n_neutral_species", 1) - # * if electron_physics=boltzmann_electron_response, then the electron density is - # fixed to be N_e*(eϕ/T_e) - # * if electron_physics=boltzmann_electron_response_with_simple_sheath, then the - # electron density is fixed to be N_e*(eϕ/T_e) and N_e is calculated w.r.t a - # reference value using J_||e + J_||i = 0 at z = 0 - electron_physics = get(scan_input, "electron_physics", boltzmann_electron_response) - z, r, vpa, vperp, gyrophase, vz, vr, vzeta, species, composition, drive, evolve_moments = - load_defaults(n_ion_species, n_neutral_species, electron_physics) + # read composition and species data + composition = get_species_input(scan_input) + n_ion_species = composition.n_ion_species + n_neutral_species = composition.n_neutral_species + + z, r, vpa, vperp, gyrophase, vz, vr, vzeta, drive, evolve_moments = + load_defaults() # this is the prefix for all output files associated with this run run_name = get(scan_input, "run_name", "wallBC") @@ -92,111 +87,25 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) evolve_moments.parallel_pressure = get(scan_input, "evolve_moments_parallel_pressure", false) evolve_moments.conservation = get(scan_input, "evolve_moments_conservation", false) - ####### specify any deviations from default inputs for evolved species ####### - # set initial Tₑ = 1 - composition.T_e = get(scan_input, "T_e", 1.0) - # set wall temperature T_wall = Tw/Te - composition.T_wall = get(scan_input, "T_wall", 1.0) - # set initial neutral temperature Tn/Tₑ = 1 - # set initial nᵢ/Nₑ = 1.0 - # set phi_wall at z = 0 - composition.phi_wall = get(scan_input, "phi_wall", 0.0) - # if false use true Knudsen cosine for neutral wall bc - composition.use_test_neutral_wall_pdf = get(scan_input, "use_test_neutral_wall_pdf", false) - # constant to be used to test nonzero Er in wall boundary condition - #composition.Er_constant = get(scan_input, "Er_constant", 0.0) - # The ion flux reaching the wall that is recycled as neutrals is reduced by - # `recycling_fraction` to account for ions absorbed by the wall. - composition.recycling_fraction = get(scan_input, "recycling_fraction", 1.0) - if !(0.0 <= composition.recycling_fraction <= 1.0) - error("recycling_fraction must be between 0 and 1. Got $recycling_fraction.") - end - # gyrokinetic_ions = True -> use gyroaveraged fields at fixed guiding centre and moments of the pdf computed at fixed r - # gyrokinetic_ions = False -> use drift kinetic approximation - composition.gyrokinetic_ions = get(scan_input, "gyrokinetic_ions", false) - # Reference parameters that define the conversion between physical quantities and # normalised values used in the code. reference_params = setup_reference_parameters(scan_input) - - # Set me_over_mi here so we can use reference_params - composition.me_over_mi = reference_params.me / reference_params.mref - + ## set geometry_input - geometry_in = setup_geometry_input(scan_input, get_default_rhostar(reference_params)) + geometry_in = setup_geometry_input(scan_input) - ispecies = 1 - species.ion[1].z_IC.initialization_option = get(scan_input, "z_IC_option$ispecies", "gaussian") - species.ion[1].initial_density = get(scan_input, "initial_density$ispecies", 1.0) - species.ion[1].initial_temperature = get(scan_input, "initial_temperature$ispecies", 1.0) - species.ion[1].z_IC.width = get(scan_input, "z_IC_width$ispecies", 0.125) - species.ion[1].z_IC.wavenumber = get(scan_input, "z_IC_wavenumber$ispecies", 1) - species.ion[1].z_IC.density_amplitude = get(scan_input, "z_IC_density_amplitude$ispecies", 0.001) - species.ion[1].z_IC.density_phase = get(scan_input, "z_IC_density_phase$ispecies", 0.0) - species.ion[1].z_IC.upar_amplitude = get(scan_input, "z_IC_upar_amplitude$ispecies", 0.0) - species.ion[1].z_IC.upar_phase = get(scan_input, "z_IC_upar_phase$ispecies", 0.0) - species.ion[1].z_IC.temperature_amplitude = get(scan_input, "z_IC_temperature_amplitude$ispecies", 0.0) - species.ion[1].z_IC.temperature_phase = get(scan_input, "z_IC_temperature_phase$ispecies", 0.0) - species.ion[1].r_IC.initialization_option = get(scan_input, "r_IC_option$ispecies", "gaussian") - species.ion[1].r_IC.wavenumber = get(scan_input, "r_IC_wavenumber$ispecies", 1) - species.ion[1].r_IC.density_amplitude = get(scan_input, "r_IC_density_amplitude$ispecies", 0.0) - species.ion[1].r_IC.density_phase = get(scan_input, "r_IC_density_phase$ispecies", 0.0) - species.ion[1].r_IC.upar_amplitude = get(scan_input, "r_IC_upar_amplitude$ispecies", 0.0) - species.ion[1].r_IC.upar_phase = get(scan_input, "r_IC_upar_phase$ispecies", 0.0) - species.ion[1].r_IC.temperature_amplitude = get(scan_input, "r_IC_temperature_amplitude$ispecies", 0.0) - species.ion[1].r_IC.temperature_phase = get(scan_input, "r_IC_temperature_phase$ispecies", 0.0) - species.ion[1].vpa_IC.initialization_option = get(scan_input, "vpa_IC_option$ispecies", "gaussian") - species.ion[1].vpa_IC.density_amplitude = get(scan_input, "vpa_IC_density_amplitude$ispecies", 1.000) - species.ion[1].vpa_IC.width = get(scan_input, "vpa_IC_width$ispecies", 1.0) - species.ion[1].vpa_IC.density_phase = get(scan_input, "vpa_IC_density_phase$ispecies", 0.0) - species.ion[1].vpa_IC.upar_amplitude = get(scan_input, "vpa_IC_upar_amplitude$ispecies", 0.0) - species.ion[1].vpa_IC.upar_phase = get(scan_input, "vpa_IC_upar_phase$ispecies", 0.0) - species.ion[1].vpa_IC.temperature_amplitude = get(scan_input, "vpa_IC_temperature_amplitude$ispecies", 0.0) - species.ion[1].vpa_IC.temperature_phase = get(scan_input, "vpa_IC_temperature_phase$ispecies", 0.0) - ispecies += 1 - if n_neutral_species > 0 - species.neutral[1].z_IC.initialization_option = get(scan_input, "z_IC_option$ispecies", "gaussian") - species.neutral[1].initial_density = get(scan_input, "initial_density$ispecies", 1.0) - species.neutral[1].initial_temperature = get(scan_input, "initial_temperature$ispecies", 1.0) - species.neutral[1].z_IC.width = get(scan_input, "z_IC_width$ispecies", species.ion[1].z_IC.width) - species.neutral[1].z_IC.density_amplitude = get(scan_input, "z_IC_density_amplitude$ispecies", 0.001) - species.neutral[1].z_IC.density_phase = get(scan_input, "z_IC_density_phase$ispecies", 0.0) - species.neutral[1].z_IC.upar_amplitude = get(scan_input, "z_IC_upar_amplitude$ispecies", 0.0) - species.neutral[1].z_IC.upar_phase = get(scan_input, "z_IC_upar_phase$ispecies", 0.0) - species.neutral[1].z_IC.temperature_amplitude = get(scan_input, "z_IC_temperature_amplitude$ispecies", 0.0) - species.neutral[1].z_IC.temperature_phase = get(scan_input, "z_IC_temperature_phase$ispecies", 0.0) - species.neutral[1].r_IC.initialization_option = get(scan_input, "r_IC_option$ispecies", "gaussian") - species.neutral[1].r_IC.density_amplitude = get(scan_input, "r_IC_density_amplitude$ispecies", 0.001) - species.neutral[1].r_IC.density_phase = get(scan_input, "r_IC_density_phase$ispecies", 0.0) - species.neutral[1].r_IC.upar_amplitude = get(scan_input, "r_IC_upar_amplitude$ispecies", 0.0) - species.neutral[1].r_IC.upar_phase = get(scan_input, "r_IC_upar_phase$ispecies", 0.0) - species.neutral[1].r_IC.temperature_amplitude = get(scan_input, "r_IC_temperature_amplitude$ispecies", 0.0) - species.neutral[1].r_IC.temperature_phase = get(scan_input, "r_IC_temperature_phase$ispecies", 0.0) - species.neutral[1].vpa_IC.initialization_option = get(scan_input, "vpa_IC_option$ispecies", "gaussian") - species.neutral[1].vpa_IC.density_amplitude = get(scan_input, "vpa_IC_density_amplitude$ispecies", 1.000) - species.neutral[1].vpa_IC.width = get(scan_input, "vpa_IC_width$ispecies", species.ion[1].vpa_IC.width) - species.neutral[1].vpa_IC.density_phase = get(scan_input, "vpa_IC_density_phase$ispecies", 0.0) - species.neutral[1].vpa_IC.upar_amplitude = get(scan_input, "vpa_IC_upar_amplitude$ispecies", 0.0) - species.neutral[1].vpa_IC.upar_phase = get(scan_input, "vpa_IC_upar_phase$ispecies", 0.0) - species.neutral[1].vpa_IC.temperature_amplitude = get(scan_input, "vpa_IC_temperature_amplitude$ispecies", 0.0) - species.neutral[1].vpa_IC.temperature_phase = get(scan_input, "vpa_IC_temperature_phase$ispecies", 0.0) - ispecies += 1 - end - #################### end specification of species inputs ##################### - - # Build the main collisions struct using scan_input and reference parameters - charge_exchange = get(scan_input, "charge_exchange_frequency", 2.0*sqrt(species.ion[1].initial_temperature)) + charge_exchange = get(scan_input, "charge_exchange_frequency", 2.0*sqrt(composition.ion[1].initial_temperature)) charge_exchange_electron = get(scan_input, "electron_charge_exchange_frequency", 0.0) ionization = get(scan_input, "ionization_frequency", charge_exchange) ionization_electron = get(scan_input, "electron_ionization_frequency", ionization) ionization_energy = get(scan_input, "ionization_energy", 0.0) nu_ei = get(scan_input, "nu_ei", 0.0) # set up krook collision inputs - krook_input = setup_krook_collisions_input(scan_input, reference_params) + krook_input = setup_krook_collisions_input(scan_input) # set up Fokker-Planck collision inputs - fkpl_input = setup_fkpl_collisions_input(scan_input, reference_params) + fkpl_input = setup_fkpl_collisions_input(scan_input) # set up maxwell diffusion collision inputs - mxwl_diff_input = setup_mxwl_diff_collisions_input(scan_input, reference_params) + mxwl_diff_input = setup_mxwl_diff_collisions_input(scan_input) # write total collision struct using the structs above, as each setup function # for the collisions outputs itself a struct of the type of collision, which # is a substruct of the overall collisions_input struct. @@ -208,7 +117,7 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) timestepping_section = set_defaults_and_check_section!( scan_input, "timestepping"; nstep=5, - dt=0.00025/sqrt(species.ion[1].initial_temperature), + dt=0.00025/sqrt(composition.ion[1].initial_temperature), CFL_prefactor=-1.0, nwrite=1, nwrite_dfns=nothing, @@ -448,7 +357,7 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) # do not parallelise vpa with distributed-memory MPI vpa.nelement_local = vpa.nelement_global # L is the box length in units of vthermal_species - vpa.L = get(scan_input, "vpa_L", 8.0*sqrt(species.ion[1].initial_temperature)) + vpa.L = get(scan_input, "vpa_L", 8.0*sqrt(composition.ion[1].initial_temperature)) # determine the boundary condition # only supported option at present is "zero" and "periodic" vpa.bc = get(scan_input, "vpa_bc", "periodic") @@ -466,7 +375,7 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) # do not parallelise vperp with distributed-memory MPI vperp.nelement_local = vperp.nelement_global # L is the box length in units of vthermal_species - vperp.L = get(scan_input, "vperp_L", 8.0*sqrt(species.ion[1].initial_temperature)) + vperp.L = get(scan_input, "vperp_L", 8.0*sqrt(composition.ion[1].initial_temperature)) # Note vperp.bc is set below, after numerical dissipation is initialized, so that it # can use the numerical dissipation settings to set its default value. # @@ -510,7 +419,7 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) # do not parallelise vz with distributed-memory MPI vr.nelement_local = vr.nelement_global # L is the box length in units of vthermal_species - vr.L = get(scan_input, "vr_L", 8.0*sqrt(species.ion[1].initial_temperature)) + vr.L = get(scan_input, "vr_L", 8.0*sqrt(composition.ion[1].initial_temperature)) # determine the boundary condition # only supported option at present is "zero" and "periodic" vr.bc = get(scan_input, "vr_bc", "none") @@ -527,7 +436,7 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) # do not parallelise vz with distributed-memory MPI vzeta.nelement_local = vzeta.nelement_global # L is the box length in units of vthermal_species - vzeta.L = get(scan_input, "vzeta_L", 8.0*sqrt(species.ion[1].initial_temperature)) + vzeta.L = get(scan_input, "vzeta_L", 8.0*sqrt(composition.ion[1].initial_temperature)) # determine the boundary condition # only supported option at present is "zero" and "periodic" vzeta.bc = get(scan_input, "vzeta_bc", "none") @@ -540,9 +449,9 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) is_1V = (vperp.ngrid == vperp.nelement_global == 1 && vzeta.ngrid == vzeta.nelement_global == 1 && vr.ngrid == vr.nelement_global == 1) - ion_num_diss_param_dict = get(scan_input, "ion_numerical_dissipation", Dict{String,Any}()) - electron_num_diss_param_dict = get(scan_input, "electron_numerical_dissipation", Dict{String,Any}()) - neutral_num_diss_param_dict = get(scan_input, "neutral_numerical_dissipation", Dict{String,Any}()) + ion_num_diss_param_dict = get(scan_input, "ion_numerical_dissipation", OptionsDict()) + electron_num_diss_param_dict = get(scan_input, "electron_numerical_dissipation", OptionsDict()) + neutral_num_diss_param_dict = get(scan_input, "neutral_numerical_dissipation", OptionsDict()) num_diss_params = setup_numerical_dissipation(ion_num_diss_param_dict, electron_num_diss_param_dict, neutral_num_diss_param_dict, is_1V) @@ -627,89 +536,6 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) vzeta_immutable = grid_input("vzeta", vzeta.ngrid, vzeta.nelement_global, vzeta.nelement_local, 1, 0, vzeta.L, vzeta.discretization, vzeta.fd_option, vzeta.cheb_option, vzeta.bc, vzeta_advection_immutable, MPI.COMM_NULL, vzeta.element_spacing_option) - species_ion_immutable = Array{species_parameters,1}(undef,n_ion_species) - species_neutral_immutable = Array{species_parameters,1}(undef,n_neutral_species) - - for is ∈ 1:n_ion_species - species_type = "ion" - # species_type = "electron" - z_IC = initial_condition_input(species.ion[is].z_IC.initialization_option, - species.ion[is].z_IC.width, species.ion[is].z_IC.wavenumber, - species.ion[is].z_IC.density_amplitude, species.ion[is].z_IC.density_phase, - species.ion[is].z_IC.upar_amplitude, species.ion[is].z_IC.upar_phase, - species.ion[is].z_IC.temperature_amplitude, species.ion[is].z_IC.temperature_phase, - species.ion[is].z_IC.monomial_degree, 0.0, 0.0, 0.0, 0.0) - r_IC = initial_condition_input(species.ion[is].r_IC.initialization_option, - species.ion[is].r_IC.width, species.ion[is].r_IC.wavenumber, - species.ion[is].r_IC.density_amplitude, species.ion[is].r_IC.density_phase, - species.ion[is].r_IC.upar_amplitude, species.ion[is].r_IC.upar_phase, - species.ion[is].r_IC.temperature_amplitude, species.ion[is].r_IC.temperature_phase, - species.ion[is].r_IC.monomial_degree, 0.0, 0.0, 0.0, 0.0) - vpa_IC = initial_condition_input(species.ion[is].vpa_IC.initialization_option, - species.ion[is].vpa_IC.width, species.ion[is].vpa_IC.wavenumber, - species.ion[is].vpa_IC.density_amplitude, species.ion[is].vpa_IC.density_phase, - species.ion[is].vpa_IC.upar_amplitude, species.ion[is].vpa_IC.upar_phase, - species.ion[is].vpa_IC.temperature_amplitude, - species.ion[is].vpa_IC.temperature_phase, species.ion[is].vpa_IC.monomial_degree, - get(scan_input, "vpa_IC_v0$is", 0.5*sqrt(vperp.L^2 + (0.5*vpa.L)^2)), - get(scan_input, "vpa_IC_vth0$is", 0.1*sqrt(vperp.L^2 + (0.5*vpa.L)^2)), - get(scan_input, "vpa_IC_vpa0$is", 0.25*0.5*abs(vpa.L)), - get(scan_input, "vpa_IC_vperp0$is", 0.5*abs(vperp.L))) - species_ion_immutable[is] = species_parameters(species_type, species.ion[is].initial_temperature, - species.ion[is].initial_density, z_IC, r_IC, vpa_IC) - end - if n_neutral_species > 0 - for is ∈ 1:n_neutral_species - species_type = "neutral" - z_IC = initial_condition_input(species.neutral[is].z_IC.initialization_option, - species.neutral[is].z_IC.width, species.neutral[is].z_IC.wavenumber, - species.neutral[is].z_IC.density_amplitude, species.neutral[is].z_IC.density_phase, - species.neutral[is].z_IC.upar_amplitude, species.neutral[is].z_IC.upar_phase, - species.neutral[is].z_IC.temperature_amplitude, species.neutral[is].z_IC.temperature_phase, - species.neutral[is].z_IC.monomial_degree, 0.0, 0.0, 0.0, 0.0) - r_IC = initial_condition_input(species.neutral[is].r_IC.initialization_option, - species.neutral[is].r_IC.width, species.neutral[is].r_IC.wavenumber, - species.neutral[is].r_IC.density_amplitude, species.neutral[is].r_IC.density_phase, - species.neutral[is].r_IC.upar_amplitude, species.neutral[is].r_IC.upar_phase, - species.neutral[is].r_IC.temperature_amplitude, species.neutral[is].r_IC.temperature_phase, - species.neutral[is].r_IC.monomial_degree, 0.0, 0.0, 0.0, 0.0) - vpa_IC = initial_condition_input(species.neutral[is].vpa_IC.initialization_option, - species.neutral[is].vpa_IC.width, species.neutral[is].vpa_IC.wavenumber, - species.neutral[is].vpa_IC.density_amplitude, species.neutral[is].vpa_IC.density_phase, - species.neutral[is].vpa_IC.upar_amplitude, species.neutral[is].vpa_IC.upar_phase, - species.neutral[is].vpa_IC.temperature_amplitude, - species.neutral[is].vpa_IC.temperature_phase, species.neutral[is].vpa_IC.monomial_degree, - get(scan_input, "vpa_IC_v0$is", 0.5*sqrt(vperp.L^2 + (0.5*vpa.L)^2)), - get(scan_input, "vpa_IC_vth0$is", 0.1*sqrt(vperp.L^2 + (0.5*vpa.L)^2)), - get(scan_input, "vpa_IC_vpa0$is", 0.25*0.5*abs(vpa.L)), - get(scan_input, "vpa_IC_vperp0$is", 0.5*abs(vperp.L))) - species_neutral_immutable[is] = species_parameters(species_type, species.neutral[is].initial_temperature, - species.neutral[is].initial_density, z_IC, r_IC, vpa_IC) - end - end - z_IC = initial_condition_input(species.electron.z_IC.initialization_option, - species.electron.z_IC.width, species.electron.z_IC.wavenumber, - species.electron.z_IC.density_amplitude, species.electron.z_IC.density_phase, - species.electron.z_IC.upar_amplitude, species.electron.z_IC.upar_phase, - species.electron.z_IC.temperature_amplitude, species.electron.z_IC.temperature_phase, - species.electron.z_IC.monomial_degree, 0.0, 0.0, 0.0, 0.0) - r_IC = initial_condition_input(species.electron.r_IC.initialization_option, - species.electron.r_IC.width, species.electron.r_IC.wavenumber, - species.electron.r_IC.density_amplitude, species.electron.r_IC.density_phase, - species.electron.r_IC.upar_amplitude, species.electron.r_IC.upar_phase, - species.electron.r_IC.temperature_amplitude, species.electron.r_IC.temperature_phase, - species.electron.r_IC.monomial_degree, 0.0, 0.0, 0.0, 0.0) - vpa_IC = initial_condition_input(species.electron.vpa_IC.initialization_option, - species.electron.vpa_IC.width, species.electron.vpa_IC.wavenumber, - species.electron.vpa_IC.density_amplitude, species.electron.vpa_IC.density_phase, - species.electron.vpa_IC.upar_amplitude, species.electron.vpa_IC.upar_phase, - species.electron.vpa_IC.temperature_amplitude, - species.electron.vpa_IC.temperature_phase, - species.electron.vpa_IC.monomial_degree, 0.0, 0.0, 0.0, 0.0) - species_electron_immutable = species_parameters("electron", species.electron.initial_temperature, - species.electron.initial_density, z_IC, r_IC, vpa_IC) - species_immutable = (ion = species_ion_immutable, electron = species_electron_immutable, neutral = species_neutral_immutable) - force_Er_zero = get(scan_input, "force_Er_zero_at_wall", false) drive_immutable = drive_input(drive.force_phi, drive.amplitude, drive.frequency, force_Er_zero) @@ -796,6 +622,8 @@ function mk_input(scan_input=Dict(); save_inputs_to_txt=false, ignore_MPI=true) error("Mirror terms not yet implemented for moment-kinetic modes") end + species_immutable = (ion = composition.ion, neutral = composition.neutral) + # check input (and initialized coordinate structs) to catch errors/unsupported options check_input(io, output_dir, timestepping_section["nstep"], timestepping_section["dt"], r, z, vpa, vperp, composition, species_immutable, evolve_moments, @@ -817,7 +645,7 @@ end """ """ -function load_defaults(n_ion_species, n_neutral_species, electron_physics) +function load_defaults() ############## options related to the equations being solved ############### evolve_density = false evolve_parallel_flow = false @@ -1134,120 +962,6 @@ function load_defaults(n_ion_species, n_neutral_species, electron_physics) vzeta = grid_input_mutable("vzeta", ngrid_vzeta, nelement_vzeta, nelement_vzeta, L_vzeta, discretization_option_vzeta, finite_difference_option_vzeta, cheb_option_vzeta, boundary_option_vzeta, advection_vzeta, element_spacing_option_vzeta) - ############################################################################# - # define default values and create corresponding mutable structs holding - # information about the composition of the species and their initial conditions - if electron_physics ∈ (boltzmann_electron_response, boltzmann_electron_response_with_simple_sheath) - n_species = n_ion_species + n_neutral_species - else - n_species = n_ion_species + n_neutral_species + 1 - end - use_test_neutral_wall_pdf = false - # electron temperature over reference temperature - T_e = 1.0 - # temperature at the entrance to the wall in terms of the electron temperature - T_wall = 1.0 - # wall potential at z = 0 - phi_wall = 0.0 - # ratio of the neutral particle mass to the ion particle mass - mn_over_mi = 1.0 - # ratio of the electron particle mass to the ion particle mass - value set later using - # reference_params - me_over_mi = NaN - # The ion flux reaching the wall that is recycled as neutrals is reduced by - # `recycling_fraction` to account for ions absorbed by the wall. - recycling_fraction = 1.0 - gyrokinetic_ions = false - composition = species_composition(n_species, n_ion_species, n_neutral_species, - electron_physics, use_test_neutral_wall_pdf, T_e, T_wall, phi_wall, - mn_over_mi, me_over_mi, recycling_fraction, gyrokinetic_ions, allocate_float(n_species)) - - species_ion = Array{species_parameters_mutable,1}(undef,n_ion_species) - species_neutral = Array{species_parameters_mutable,1}(undef,n_neutral_species) - - # initial temperature for each species defaults to Tₑ - initial_temperature = 1.0 - # initial density for each species defaults to Nₑ - initial_density = 1.0 - # initialization inputs for z part of distribution function - # supported options are "gaussian", "sinusoid" and "monomial" - z_initialization_option = "sinusoid" - # inputs for "gaussian" initial condition - # width of the Gaussian in z - z_width = 0.125 - # inputs for "sinusoid" initial condition - # z_wavenumber should be an integer - z_wavenumber = 1 - z_density_amplitude = 0.1 - z_density_phase = 0.0 - z_upar_amplitude = 0.0 - z_upar_phase = 0.0 - z_temperature_amplitude = 0.0 - z_temperature_phase = 0.0 - # inputs for "monomial" initial condition - z_monomial_degree = 2 - z_initial_conditions = initial_condition_input_mutable(z_initialization_option, - z_width, z_wavenumber, z_density_amplitude, z_density_phase, z_upar_amplitude, - z_upar_phase, z_temperature_amplitude, z_temperature_phase, z_monomial_degree) - # initialization inputs for r part of distribution function - # supported options are "gaussian", "sinusoid" and "monomial" - r_initialization_option = "sinusoid" - # inputs for "gaussian" initial condition - # width of the Gaussian in r - r_width = 0.125 - # inputs for "sinusoid" initial condition - # r_wavenumber should be an integer - r_wavenumber = 1 - r_density_amplitude = 0.0 - r_density_phase = 0.0 - r_upar_amplitude = 0.0 - r_upar_phase = 0.0 - r_temperature_amplitude = 0.0 - r_temperature_phase = 0.0 - # inputs for "monomial" initial condition - r_monomial_degree = 2 - r_initial_conditions = initial_condition_input_mutable(r_initialization_option, - r_width, r_wavenumber, r_density_amplitude, r_density_phase, r_upar_amplitude, - r_upar_phase, r_temperature_amplitude, r_temperature_phase, r_monomial_degree) - # initialization inputs for vpa part of distribution function - # supported options are "gaussian", "sinusoid" and "monomial" - # inputs for 'gaussian' initial condition - vpa_initialization_option = "gaussian" - # if initializing a Maxwellian, vpa_width = 1.0 for each species - # any temperature-dependence will be self-consistently treated using initial_temperature - vpa_width = 1.0 - # inputs for "sinusoid" initial condition - vpa_wavenumber = 1 - vpa_density_amplitude = 1.0 - vpa_density_phase = 0.0 - vpa_upar_amplitude = 0.0 - vpa_upar_phase = 0.0 - vpa_temperature_amplitude = 0.0 - vpa_temperature_phase = 0.0 - # inputs for "monomial" initial condition - vpa_monomial_degree = 2 - vpa_initial_conditions = initial_condition_input_mutable(vpa_initialization_option, - vpa_width, vpa_wavenumber, vpa_density_amplitude, vpa_density_phase, - vpa_upar_amplitude, vpa_upar_phase, vpa_temperature_amplitude, - vpa_temperature_phase, vpa_monomial_degree) - - # fill in entries in species struct corresponding to ion species - for is ∈ 1:n_ion_species - species_ion[is] = species_parameters_mutable("ion", initial_temperature, initial_density, - deepcopy(z_initial_conditions), deepcopy(r_initial_conditions), - deepcopy(vpa_initial_conditions)) - end - # if there are neutrals, fill in corresponding entries in species struct - if n_neutral_species > 0 - for is ∈ 1:n_neutral_species - species_neutral[is] = species_parameters_mutable("neutral", initial_temperature, - initial_density, deepcopy(z_initial_conditions), - deepcopy(r_initial_conditions), deepcopy(vpa_initial_conditions)) - end - end - species_electron = species_parameters_mutable("electron", T_e, 1.0, deepcopy(z_initial_conditions), - deepcopy(r_initial_conditions), deepcopy(vpa_initial_conditions)) - species = (ion = species_ion, electron = species_electron, neutral = species_neutral) # if drive_phi = true, include external electrostatic potential of form # phi(z,t=0)*drive_amplitude*sinpi(time*drive_frequency) @@ -1256,7 +970,7 @@ function load_defaults(n_ion_species, n_neutral_species, electron_physics) drive_frequency = 1.0 drive = drive_input_mutable(drive_phi, drive_amplitude, drive_frequency) - return z, r, vpa, vperp, gyrophase, vz, vr, vzeta, species, composition, drive, evolve_moments + return z, r, vpa, vperp, gyrophase, vz, vr, vzeta, drive, evolve_moments end """ @@ -1440,13 +1154,4 @@ function check_input_initialization(composition, species, io) end end -""" - function get_default_rhostar(reference_params) - -Calculate the normalised ion gyroradius at reference parameters -""" -function get_default_rhostar(reference_params) - return reference_params.cref / reference_params.Omegaref / reference_params.Lref -end - end diff --git a/moment_kinetics/src/parameter_scans.jl b/moment_kinetics/src/parameter_scans.jl index 62fbc0af9..4cd896e0e 100644 --- a/moment_kinetics/src/parameter_scans.jl +++ b/moment_kinetics/src/parameter_scans.jl @@ -4,10 +4,10 @@ export get_scan_inputs, generate_scan_input_files using ..command_line_options: get_options using ..moment_kinetics_input: read_input_file +using ..input_structs: options_to_TOML using Glob using OrderedCollections: OrderedDict -using TOML """ get_scan_inputs(scan_inputs::AbstractDict) @@ -184,7 +184,7 @@ function generate_scan_input_files(scan_input::AbstractDict, dirname::AbstractSt # The run name will be created from the name of the input file, so do not need # to save "run_name" in the file. pop!(input, "run_name") - TOML.print(io, input) + options_to_TOML(io, input) end end diff --git a/moment_kinetics/src/species_input.jl b/moment_kinetics/src/species_input.jl new file mode 100644 index 000000000..35d8755e0 --- /dev/null +++ b/moment_kinetics/src/species_input.jl @@ -0,0 +1,207 @@ +""" +Module for handling i/o for species specific input parameters +which are hosted in the composition and species structs for passing to functions +""" +module species_input + +export get_species_input + +using ..type_definitions: mk_float, mk_int +using ..input_structs: set_defaults_and_check_section! +using ..input_structs: species_composition, ion_species_parameters, neutral_species_parameters +using ..input_structs: spatial_initial_condition_input, velocity_initial_condition_input +using ..input_structs: boltzmann_electron_response, boltzmann_electron_response_with_simple_sheath +using ..reference_parameters: setup_reference_parameters + +function get_species_input(toml_input) + + reference_params = setup_reference_parameters(toml_input) + + # read general composition parameters + composition_section = set_defaults_and_check_section!(toml_input, "composition", + # n_ion_species is the number of evolved ion species + n_ion_species = 1, + # n_neutral_species is the number of evolved neutral species + n_neutral_species = 1, + # * if electron_physics=boltzmann_electron_response, then the electron density is + # fixed to be N_e*(eϕ/T_e) + # * if electron_physics=boltzmann_electron_response_with_simple_sheath, then the + # electron density is fixed to be N_e*(eϕ/T_e) and N_e is calculated w.r.t a + # reference value using J_||e + J_||i = 0 at z = 0 + electron_physics = boltzmann_electron_response, + # initial Tₑ = 1 + T_e = 1.0, + # wall temperature T_wall = Tw/Te + T_wall = 1.0, + # phi_wall at z = -L/2 + phi_wall = 0.0, + # ratio of the neutral particle mass to the ion mass + mn_over_mi = 1.0, + # ratio of the electron particle mass to the ion mass + me_over_mi = reference_params.me / reference_params.mref, + # if false use true Knudsen cosine for neutral wall bc + use_test_neutral_wall_pdf = false, + # The ion flux reaching the wall that is recycled as neutrals is reduced by + # `recycling_fraction` to account for ions absorbed by the wall. + recycling_fraction = 1.0, + # gyrokinetic_ions = True -> use gyroaveraged fields at fixed guiding centre and moments of the pdf computed at fixed r + # gyrokinetic_ions = False -> use drift kinetic approximation + gyrokinetic_ions = false) + + nspec_ion = composition_section["n_ion_species"] + nspec_neutral = composition_section["n_neutral_species"] + nspec_tot = nspec_ion + nspec_neutral + + # read individual species parameters + ion_spec_params_list = Array{ion_species_parameters,1}(undef,nspec_ion) + neutral_spec_params_list = Array{neutral_species_parameters,1}(undef,nspec_neutral) + for is in 1:nspec_ion + spec_section = set_defaults_and_check_section!(toml_input, "ion_species_$is", + # [ion_species_1], [ion_species_2], etc + # mass of ion species + mass = 1.0, + # charge number + zeds = 1.0, + # initial density + initial_density = 1.0, + # initial temperature + initial_temperature = 1.0) + + z_IC_section = set_defaults_and_check_section!(toml_input, "z_IC_ion_species_$is", + # [ion_z_IC_species_1], [ion_z_IC_species_2], etc + initialization_option = "gaussian", + width = 0.125, + wavenumber = 1, + density_amplitude = 0.001, + density_phase = 0.0, + upar_amplitude = 0.0, + upar_phase = 0.0, + temperature_amplitude = 0.0, + temperature_phase = 0.0, + monomial_degree = 2) + z_IC_input = Dict(Symbol(k)=>v for (k,v) in z_IC_section) + z_IC = spatial_initial_condition_input(; z_IC_input...) + + r_IC_section = set_defaults_and_check_section!(toml_input, "r_IC_ion_species_$is", + # [ion_r_IC_species_1], [ion_r_IC_species_2], etc + initialization_option = "gaussian", + width = 0.125, + wavenumber = 1, + density_amplitude = 0.001, + density_phase = 0.0, + upar_amplitude = 0.0, + upar_phase = 0.0, + temperature_amplitude = 0.0, + temperature_phase = 0.0, + monomial_degree = 2) + r_IC_input= Dict(Symbol(k)=>v for (k,v) in r_IC_section) + r_IC = spatial_initial_condition_input(; r_IC_input...) + + vpa_IC_section = set_defaults_and_check_section!(toml_input, "vpa_IC_ion_species_$is", + # [ion_vpa_IC_species_1], [ion_vpa_IC_species_2], etc + initialization_option = "gaussian", + width = 1.0, + wavenumber = 1, + density_amplitude = 1.0, + density_phase = 0.0, + upar_amplitude = 0.0, + upar_phase = 0.0, + temperature_amplitude = 0.0, + temperature_phase = 0.0, + monomial_degree = 2, + # need to read resolutions before setting defaults here + v0 = 1.0, + vth0 = 1.0, + vpa0 = 1.0, + vperp0 = 1.0) + vpa_IC_input= Dict(Symbol(k)=>v for (k,v) in vpa_IC_section) + vpa_IC = velocity_initial_condition_input(; vpa_IC_input...) + + IC_input = Dict("z_IC" => z_IC, "r_IC" => r_IC, "vpa_IC" => vpa_IC) + type_input = Dict("type" => "ion") + spec_section = merge(spec_section, IC_input, type_input) + spec_input = Dict(Symbol(k)=>v for (k,v) in spec_section) + ion_spec_params_list[is] = ion_species_parameters(; spec_input...) + end + for isn in 1:nspec_neutral + spec_section = set_defaults_and_check_section!(toml_input, "neutral_species_$isn", + # [neutral_species_1], [neutral_species_2], etc + # mass of neutral species + mass = 1.0, + # initial density + initial_density = 1.0, + # initial temperature + initial_temperature = 1.0) + + z_IC_section = set_defaults_and_check_section!(toml_input, "z_IC_neutral_species_$isn", + # [neutral_z_IC_species_1], [neutral_z_IC_species_2], etc + initialization_option = "gaussian", + width = 0.125, + wavenumber = 1, + density_amplitude = 0.001, + density_phase = 0.0, + upar_amplitude = 0.0, + upar_phase = 0.0, + temperature_amplitude = 0.0, + temperature_phase = 0.0, + monomial_degree = 2) + z_IC_input = Dict(Symbol(k)=>v for (k,v) in z_IC_section) + z_IC = spatial_initial_condition_input(; z_IC_input...) + + r_IC_section = set_defaults_and_check_section!(toml_input, "r_IC_neutral_species_$isn", + # [neutral_r_IC_species_1], [neutral_r_IC_species_2], etc + initialization_option = "gaussian", + width = 0.125, + wavenumber = 1, + density_amplitude = 0.001, + density_phase = 0.0, + upar_amplitude = 0.0, + upar_phase = 0.0, + temperature_amplitude = 0.0, + temperature_phase = 0.0, + monomial_degree = 2) + r_IC_input= Dict(Symbol(k)=>v for (k,v) in r_IC_section) + r_IC = spatial_initial_condition_input(; r_IC_input...) + + vpa_IC_section = set_defaults_and_check_section!(toml_input, "vz_IC_neutral_species_$isn", + # [neutral_vpa_IC_species_1], [neutral_vpa_IC_species_2], etc + initialization_option = "gaussian", + width = 1.0, + wavenumber = 1, + density_amplitude = 1.0, + density_phase = 0.0, + upar_amplitude = 0.0, + upar_phase = 0.0, + temperature_amplitude = 0.0, + temperature_phase = 0.0, + monomial_degree = 2, + # need to read resolutions before setting defaults here + v0 = 1.0, + vth0 = 1.0, + vpa0 = 1.0, + vperp0 = 1.0) + vpa_IC_input= Dict(Symbol(k)=>v for (k,v) in vpa_IC_section) + vpa_IC = velocity_initial_condition_input(; vpa_IC_input...) + + IC_input = Dict("z_IC" => z_IC, "r_IC" => r_IC, "vpa_IC" => vpa_IC) + type_input = Dict("type" => "neutral") + spec_section = merge(spec_section, IC_input, type_input) + spec_input = Dict(Symbol(k)=>v for (k,v) in spec_section) + neutral_spec_params_list[isn] = neutral_species_parameters(; spec_input...) + end + # construct composition dict + species_dict = Dict("n_species" => nspec_tot, "ion" => ion_spec_params_list, "neutral" => neutral_spec_params_list) + composition_section = merge(composition_section,species_dict) + input = Dict(Symbol(k)=>v for (k,v) in composition_section) + # construct composition struct + composition = species_composition(; input...) + + ## checks and errors + if !(0.0 <= composition.recycling_fraction <= 1.0) + error("recycling_fraction must be between 0 and 1. Got $recycling_fraction.") + end + + return composition +end + +end diff --git a/moment_kinetics/src/type_definitions.jl b/moment_kinetics/src/type_definitions.jl index d0a6f6943..e53fea73d 100644 --- a/moment_kinetics/src/type_definitions.jl +++ b/moment_kinetics/src/type_definitions.jl @@ -4,6 +4,7 @@ module type_definitions export mk_float export mk_int +export OptionsDict """ """ @@ -13,4 +14,8 @@ const mk_float = Float64 """ const mk_int = Int64 +""" +""" +const OptionsDict = Dict{String,Any} + end diff --git a/moment_kinetics/test/Krook_collisions_tests.jl b/moment_kinetics/test/Krook_collisions_tests.jl index 9bb7197bf..806bad279 100644 --- a/moment_kinetics/test/Krook_collisions_tests.jl +++ b/moment_kinetics/test/Krook_collisions_tests.jl @@ -7,14 +7,14 @@ include("setup.jl") using Base.Filesystem: tempname using moment_kinetics.coordinates: define_coordinate -using moment_kinetics.input_structs: grid_input, advection_input +using moment_kinetics.input_structs: grid_input, advection_input, merge_dict_with_kwargs! using moment_kinetics.load_data: open_readonly_output_file, load_coordinate_data, load_species_data, load_fields_data, load_ion_moments_data, load_pdf_data, load_neutral_particle_moments_data, load_neutral_pdf_data, load_time_data, load_species_data using moment_kinetics.interpolation: interpolate_to_grid_z, interpolate_to_grid_vpa -using moment_kinetics.type_definitions: mk_float +using moment_kinetics.type_definitions: mk_float, OptionsDict # Useful parameters const z_L = 1.0 # always 1 in normalized units? @@ -85,37 +85,38 @@ const expected = 0.024284888662941113 0.010011392733734206 0.008423252360063494 0.019281192435730943 0.036719507768509525 0.041644492169994836 0.03692283098105331 0.03638215764882269 0.04191389118981368 0.04071460358290303 0.024284888662941134]) # default inputs for tests -test_input_full_f = Dict("n_ion_species" => 1, - "n_neutral_species" => 1, - "boltzmann_electron_response" => true, +test_input_full_f = Dict("composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0, + "T_wall" => 1.0), + "ion_species_1" => OptionsDict("initial_density" => 0.5, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.5, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.5, + "temperature_phase" => mk_float(π)), + "neutral_species_1" => OptionsDict("initial_density" => 0.5, + "initial_temperature" => 1.0), + "z_IC_neutral_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.5, + "density_phase" => mk_float(π), + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.5, + "temperature_phase" => 0.0), "run_name" => "full_f", "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => true, - "krook_collisions" => Dict{String,Any}("use_krook" => true,"frequency_option" => "reference_parameters"), - "T_e" => 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.5, - "z_IC_density_phase1" => 0.0, - "z_IC_upar_amplitude1" => 0.0, - "z_IC_upar_phase1" => 0.0, - "z_IC_temperature_amplitude1" => 0.5, - "z_IC_temperature_phase1" => mk_float(π), - "z_IC_option2" => "sinusoid", - "z_IC_density_amplitude2" => 0.5, - "z_IC_density_phase2" => mk_float(π), - "z_IC_upar_amplitude2" => 0.0, - "z_IC_upar_phase2" => 0.0, - "z_IC_temperature_amplitude2" => 0.5, - "z_IC_temperature_phase2" => 0.0, + "krook_collisions" => OptionsDict("use_krook" => true,"frequency_option" => "reference_parameters"), "charge_exchange_frequency" => 2*π*0.1, "ionization_frequency" => 0.0, - "timestepping" => Dict{String,Any}("nstep" => 100, + "timestepping" => OptionsDict("nstep" => 100, "dt" => 0.001, "nwrite" => 100, "nwrite_dfns" => 100, @@ -166,10 +167,10 @@ function run_test(test_input, rtol, atol; args...) # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) # Convert keyword arguments to a unique name - name = test_input["run_name"] + name = input["run_name"] if length(args) > 0 name = string(name, "_", (string(k, "-", v, "_") for (k, v) in args)...) @@ -180,12 +181,8 @@ function run_test(test_input, rtol, atol; args...) # Provide some progress info println(" - testing ", name) - # Convert dict from symbol keys to String keys - modified_inputs = Dict(String(k) => v for (k, v) in args) - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = name # Suppress console output while running diff --git a/moment_kinetics/test/braginskii_electrons_imex_tests.jl b/moment_kinetics/test/braginskii_electrons_imex_tests.jl index f784e0cf2..4bf902b8c 100644 --- a/moment_kinetics/test/braginskii_electrons_imex_tests.jl +++ b/moment_kinetics/test/braginskii_electrons_imex_tests.jl @@ -10,57 +10,58 @@ using Base.Filesystem: tempname using MPI using moment_kinetics.coordinates: define_coordinate -using moment_kinetics.input_structs: grid_input, advection_input +using moment_kinetics.input_structs: grid_input, advection_input, merge_dict_with_kwargs! using moment_kinetics.interpolation: interpolate_to_grid_z using moment_kinetics.load_data: get_run_info_no_setup, close_run_info, get_variable +using moment_kinetics.type_definitions: OptionsDict # default inputs for tests -test_input = Dict("n_ion_species" => 1, - "n_neutral_species" => 1, - "electron_physics" => "braginskii_fluid", +test_input = OptionsDict( "composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "braginskii_fluid", + "T_e" => 0.2), "run_name" => "braginskii-electrons-imex", "evolve_moments_density" => true, "evolve_moments_parallel_flow" => true, "evolve_moments_parallel_pressure" => true, "evolve_moments_conservation" => true, - "T_e" => 0.2, + "ion_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.1, + "density_phase" => 0.0, + "upar_amplitude" => 1.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.1, + "temperature_phase" => 1.0), + "vpa_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "neutral_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_neutral_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), "nu_ei" => 1.0e3, - "initial_density1" => 1.0, - "initial_temperature1" => 1.0, - "z_IC_option1" => "sinusoid", - "z_IC_density_amplitude1" => 0.1, - "z_IC_density_phase1" => 0.0, - "z_IC_upar_amplitude1" => 1.0, - "z_IC_upar_phase1" => 0.0, - "z_IC_temperature_amplitude1" => 0.1, - "z_IC_temperature_phase1" => 1.0, - "vpa_IC_option1" => "gaussian", - "vpa_IC_density_amplitude1" => 1.0, - "vpa_IC_density_phase1" => 0.0, - "vpa_IC_upar_amplitude1" => 0.0, - "vpa_IC_upar_phase1" => 0.0, - "vpa_IC_temperature_amplitude1" => 0.0, - "vpa_IC_temperature_phase1" => 0.0, - "initial_density2" => 1.0, - "initial_temperature2" => 1.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_option2" => "gaussian", - "vpa_IC_density_amplitude2" => 1.0, - "vpa_IC_density_phase2" => 0.0, - "vpa_IC_upar_amplitude2" => 0.0, - "vpa_IC_upar_phase2" => 0.0, - "vpa_IC_temperature_amplitude2" => 0.0, - "vpa_IC_temperature_phase2" => 0.0, "charge_exchange_frequency" => 0.75, "ionization_frequency" => 0.5, "constant_ionization_rate" => false, - "timestepping" => Dict{String,Any}("type" => "KennedyCarpenterARK324", + "timestepping" => OptionsDict("type" => "KennedyCarpenterARK324", "implicit_ion_advance" => false, "implicit_vpa_advection" => false, "nstep" => 10000, @@ -69,7 +70,7 @@ test_input = Dict("n_ion_species" => 1, "rtol" => 1.0e-7, "nwrite" => 10000, "high_precision_error_sum" => true), - "nonlinear_solver" => Dict{String,Any}("nonlinear_max_iterations" => 100), + "nonlinear_solver" => OptionsDict("nonlinear_max_iterations" => 100), "r_ngrid" => 1, "r_nelement" => 1, "z_ngrid" => 17, @@ -86,9 +87,9 @@ test_input = Dict("n_ion_species" => 1, "vz_L" => 12.0, "vz_bc" => "zero", "vz_discretization" => "chebyshev_pseudospectral", - "ion_numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0, + "ion_numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0, "vpa_dissipation_coefficient" => 1e0), - "neutral_numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0, + "neutral_numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0, "vz_dissipation_coefficient" => 1e-1)) if global_size[] > 2 && global_size[] % 2 == 0 @@ -106,10 +107,10 @@ function run_test(test_input, expected_p, expected_q, expected_vt; rtol=1.e-6, # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) # Convert keyword arguments to a unique name - name = test_input["run_name"] + name = input["run_name"] if length(args) > 0 name = string(name, "_", (string(k, "-", v, "_") for (k, v) in args)...) @@ -120,12 +121,8 @@ function run_test(test_input, expected_p, expected_q, expected_vt; rtol=1.e-6, # Provide some progress info println(" - testing ", name) - # Convert dict from symbol keys to String keys - modified_inputs = Dict(String(k) => v for (k, v) in args) - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = name # Suppress console output while running diff --git a/moment_kinetics/test/fokker_planck_time_evolution_tests.jl b/moment_kinetics/test/fokker_planck_time_evolution_tests.jl index 4ce363165..544a5fafa 100644 --- a/moment_kinetics/test/fokker_planck_time_evolution_tests.jl +++ b/moment_kinetics/test/fokker_planck_time_evolution_tests.jl @@ -5,12 +5,12 @@ using Base.Filesystem: tempname using MPI using moment_kinetics.coordinates: define_coordinate -using moment_kinetics.input_structs: grid_input, advection_input +using moment_kinetics.input_structs: grid_input, advection_input, merge_dict_with_kwargs! using moment_kinetics.load_data: open_readonly_output_file, load_coordinate_data, load_species_data, load_fields_data, load_ion_moments_data, load_pdf_data, load_time_data, load_species_data -using moment_kinetics.type_definitions: mk_float +using moment_kinetics.type_definitions: mk_float, OptionsDict const analytical_rtol = 3.e-2 const regression_rtol = 2.e-8 @@ -225,11 +225,19 @@ end # default inputs for tests test_input_gauss_legendre = Dict("run_name" => "gausslegendre_pseudospectral", "base_directory" => test_output_directory, - "n_ion_species" => 1, - "n_neutral_species" => 0, - "T_wall" => 1.0, - "T_e" => 1.0, - "initial_temperature2" => 1.0, + "composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 0, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0), + "ion_species_1" => OptionsDict("initial_density" => 0.5, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), "vpa_ngrid" => 3, "vpa_L" => 6.0, "vpa_nelement" => 6, @@ -239,34 +247,14 @@ test_input_gauss_legendre = Dict("run_name" => "gausslegendre_pseudospectral", "vperp_nelement" => 3, "vperp_L" => 3.0, "vperp_discretization" => "gausslegendre_pseudospectral", - #"split_operators" => false, "ionization_frequency" => 0.0, "charge_exchange_frequency" => 0.0, - "constant_ionization_rate" => false, - "electron_physics" => "boltzmann_electron_response", - "fokker_planck_collisions" => Dict{String,Any}("use_fokker_planck" => true, "nuii" => 1.0, "frequency_option" => "manual"), - "z_IC_upar_amplitude1" => 0.0, - "z_IC_density_amplitude1" => 0.0, - "z_IC_upar_amplitude2" => 0.0, - "z_IC_temperature_phase1" => 0.0, - "z_IC_temperature_amplitude1" => 0.0, + "fokker_planck_collisions" => OptionsDict("use_fokker_planck" => true, "nuii" => 1.0, "frequency_option" => "manual"), "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => false, - "z_IC_option1" => "sinusoid", "evolve_moments_parallel_flow" => false, - "z_IC_density_phase2" => 0.0, "z_discretization" => "chebyshev_pseudospectral", - "z_IC_upar_phase2" => 0.0, "evolve_moments_density" => false, - "z_IC_temperature_amplitude2" => 0.0, - "initial_density1" => 0.5, - "z_IC_upar_phase1" => 0.0, - "initial_density2" => 0.5, - "z_IC_density_phase1" => 0.0, - "z_IC_option2" => "sinusoid", - "z_IC_density_amplitude2" => 0.001, - "initial_temperature1" => 1.0, - "z_IC_temperature_phase2" => 0.0, "z_ngrid" => 1, "z_nelement_local" => 1, "z_nelement" => 1, @@ -276,14 +264,14 @@ test_input_gauss_legendre = Dict("run_name" => "gausslegendre_pseudospectral", "r_nelement" => 1, "r_nelement_local" => 1, "r_bc" => "periodic", - "timestepping" => Dict{String,Any}("dt" => 0.01, + "timestepping" => OptionsDict("dt" => 0.01, "nstep" => 5000, "nwrite" => 5000, "nwrite_dfns" => 5000 )) """ -Run a sound-wave test for a single set of parameters +Run a test for a single set of parameters """ # Note 'name' should not be shared by any two tests in this file function run_test(test_input, expected, rtol, atol, upar_rtol=nothing; args...) @@ -292,14 +280,14 @@ function run_test(test_input, expected, rtol, atol, upar_rtol=nothing; args...) # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) if upar_rtol === nothing upar_rtol = rtol end # Convert keyword arguments to a unique name - name = test_input["run_name"] + name = input["run_name"] if length(args) > 0 name = string(name, "_", (string(k, "-", v, "_") for (k, v) in args)...) @@ -310,12 +298,8 @@ function run_test(test_input, expected, rtol, atol, upar_rtol=nothing; args...) # Provide some progress info println(" - testing ", name) - # Convert dict from symbol keys to String keys - modified_inputs = Dict(String(k) => v for (k, v) in args) - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = name # Suppress console output while running quietoutput() do diff --git a/moment_kinetics/test/gyroaverage_tests.jl b/moment_kinetics/test/gyroaverage_tests.jl index 21c43f0b7..c4f2e5a2a 100644 --- a/moment_kinetics/test/gyroaverage_tests.jl +++ b/moment_kinetics/test/gyroaverage_tests.jl @@ -16,7 +16,8 @@ using moment_kinetics.looping using moment_kinetics.array_allocation: allocate_float, allocate_shared_float using moment_kinetics.gyroaverages: gyroaverage_pdf! using moment_kinetics.gyroaverages: gyroaverage_field!, init_gyro_operators -using moment_kinetics.type_definitions: mk_float, mk_int +using moment_kinetics.type_definitions: mk_float, mk_int, OptionsDict +using moment_kinetics.species_input: get_species_input print_test_results = false @@ -144,7 +145,7 @@ function gyroaverage_test(absolute_error; rhostar=0.1, pitch=0.5, ngrid=5, kr=2, # create test geometry option = "constant-helical" inputdict = Dict("geometry" => Dict("option" => option, "rhostar" => rhostar, "pitch" => pitch)) - geometry_in = setup_geometry_input(inputdict, 0.1) + geometry_in = setup_geometry_input(inputdict) geometry = init_magnetic_geometry(geometry_in,z,r) # create test composition @@ -229,30 +230,9 @@ function gyroaverage_test(absolute_error; rhostar=0.1, pitch=0.5, ngrid=5, kr=2, end function create_test_composition() - electron_physics = boltzmann_electron_response - n_ion_species = 1 - n_neutral_species = 0 - n_species = n_ion_species + n_neutral_species - use_test_neutral_wall_pdf = false - # electron temperature over reference temperature - T_e = 1.0 - # temperature at the entrance to the wall in terms of the electron temperature - T_wall = 1.0 - # wall potential at z = 0 - phi_wall = 0.0 - # constant to test nonzero Er - #Er_constant = 0.0 - # ratio of the neutral particle mass to the ion particle mass - mn_over_mi = 1.0 - # ratio of the electron particle mass to the ion particle mass - me_over_mi = 1.0/1836.0 - # The ion flux reaching the wall that is recycled as neutrals is reduced by - # `recycling_fraction` to account for ions absorbed by the wall. - recycling_fraction = 1.0 - gyrokinetic_ions = true - return composition = species_composition(n_species, n_ion_species, n_neutral_species, - electron_physics, use_test_neutral_wall_pdf, T_e, T_wall, phi_wall, #Er_constant, - mn_over_mi, me_over_mi, recycling_fraction, gyrokinetic_ions, allocate_float(n_species)) + input_dict = OptionsDict("composition" => OptionsDict("n_ion_species" => 1, "n_neutral_species" => 0, "gyrokinetic_ions" => true ) ) + #println(input_dict) + return get_species_input(input_dict) end function fill_test_arrays!(phi,gphi,vperp,z,r,geometry,composition,kz,kr,phasez,phaser) diff --git a/moment_kinetics/test/harrisonthompson.jl b/moment_kinetics/test/harrisonthompson.jl index 06206a263..0945f72e2 100644 --- a/moment_kinetics/test/harrisonthompson.jl +++ b/moment_kinetics/test/harrisonthompson.jl @@ -11,6 +11,8 @@ using SpecialFunctions: dawson using moment_kinetics.load_data: open_readonly_output_file using moment_kinetics.load_data: load_fields_data, load_time_data using moment_kinetics.load_data: load_species_data, load_coordinate_data +using moment_kinetics.input_structs: merge_dict_with_kwargs! +using moment_kinetics.type_definitions: OptionsDict ionization_frequency = 0.688 @@ -61,36 +63,36 @@ function findphi(z, R_ion) end # default inputs for tests -test_input_finite_difference = Dict("n_ion_species" => 1, - "n_neutral_species" => 0, - "boltzmann_electron_response" => true, +test_input_finite_difference = Dict("composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 0, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0, + "T_wall" => 1.0), + "ion_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), "run_name" => "finite_difference", "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" => 1.0, - "initial_temperature1" => 1.0, - "z_IC_option1" => "gaussian", - "z_IC_density_amplitude1" => 0.0, - "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, - "vpa_IC_option1" => "gaussian", - "vpa_IC_density_amplitude1" => 1.0, - "vpa_IC_density_phase1" => 0.0, - "vpa_IC_upar_amplitude1" => 0.0, - "vpa_IC_upar_phase1" => 0.0, - "vpa_IC_temperature_amplitude1" => 0.0, - "vpa_IC_temperature_phase1" => 0.0, "charge_exchange_frequency" => 0.0, "ionization_frequency" => 0.0, "constant_ionization_rate" => true, - "timestepping" => Dict{String,Any}("nstep" => 9000, + "timestepping" => OptionsDict("nstep" => 9000, "dt" => 0.0005, "nwrite" => 9000, "split_operators" => false), @@ -156,10 +158,10 @@ function run_test(test_input, analytic_rtol, analytic_atol, expected_phi, # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) # Convert keyword arguments to a unique name - name = test_input["run_name"] + name = input["run_name"] if length(args) > 0 name = string(name, "_", (string(k, "-", v, "_") for (k, v) in args)...) @@ -170,12 +172,8 @@ function run_test(test_input, analytic_rtol, analytic_atol, expected_phi, # Provide some progress info println(" - testing ", name) - # Convert dict from symbol keys to String keys - modified_inputs = Dict(String(k) => v for (k, v) in args) - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = name # Suppress console output while running diff --git a/moment_kinetics/test/nonlinear_solver_tests.jl b/moment_kinetics/test/nonlinear_solver_tests.jl index 23d62acf9..b37dc0187 100644 --- a/moment_kinetics/test/nonlinear_solver_tests.jl +++ b/moment_kinetics/test/nonlinear_solver_tests.jl @@ -9,7 +9,7 @@ using moment_kinetics.input_structs: advection_input using moment_kinetics.looping using moment_kinetics.looping: setup_loop_ranges! using moment_kinetics.nonlinear_solvers -using moment_kinetics.type_definitions: mk_float, mk_int +using moment_kinetics.type_definitions: mk_float, mk_int, OptionsDict using MPI @@ -113,8 +113,8 @@ function linear_test() end nl_solver_params = setup_nonlinear_solve( - Dict{String,Any}("nonlinear_solver" => - Dict{String,Any}("rtol" => 0.0, + OptionsDict("nonlinear_solver" => + OptionsDict("rtol" => 0.0, "atol" => atol, "linear_restart" => restart, "linear_max_restarts" => max_restarts)), @@ -245,8 +245,8 @@ function nonlinear_test() end nl_solver_params = setup_nonlinear_solve( - Dict{String,Any}("nonlinear_solver" => - Dict{String,Any}("rtol" => 0.0, + OptionsDict("nonlinear_solver" => + OptionsDict("rtol" => 0.0, "atol" => atol, "linear_restart" => restart, "linear_max_restarts" => max_restarts, diff --git a/moment_kinetics/test/nonlinear_sound_wave_inputs_and_expected_data.jl b/moment_kinetics/test/nonlinear_sound_wave_inputs_and_expected_data.jl index d76a644f9..031591e51 100644 --- a/moment_kinetics/test/nonlinear_sound_wave_inputs_and_expected_data.jl +++ b/moment_kinetics/test/nonlinear_sound_wave_inputs_and_expected_data.jl @@ -82,36 +82,36 @@ const expected = 0.024285034070612672 0.01001177872485688 0.00842420216637052 0.019283695804388705 0.03672486160719087 0.04165072188572364 0.0369234055803037 0.036374533667106045 0.041904838760501203 0.040712367539469434 0.02428503407061266]) # default inputs for tests -test_input_finite_difference = Dict("n_ion_species" => 1, - "n_neutral_species" => 1, - "boltzmann_electron_response" => true, +test_input_finite_difference = Dict("composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0), + "ion_species_1" => OptionsDict("initial_density" => 0.5, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.5, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.5, + "temperature_phase" => mk_float(π)), + "neutral_species_1" => OptionsDict("initial_density" => 0.5, + "initial_temperature" => 1.0), + "z_IC_neutral_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.5, + "density_phase" => mk_float(π), + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.5, + "temperature_phase" => 0.0), "run_name" => "finite_difference", "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => true, - "T_e" => 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.5, - "z_IC_density_phase1" => 0.0, - "z_IC_upar_amplitude1" => 0.0, - "z_IC_upar_phase1" => 0.0, - "z_IC_temperature_amplitude1" => 0.5, - "z_IC_temperature_phase1" => mk_float(π), - "z_IC_option2" => "sinusoid", - "z_IC_density_amplitude2" => 0.5, - "z_IC_density_phase2" => mk_float(π), - "z_IC_upar_amplitude2" => 0.0, - "z_IC_upar_phase2" => 0.0, - "z_IC_temperature_amplitude2" => 0.5, - "z_IC_temperature_phase2" => 0.0, "charge_exchange_frequency" => 2*π*0.1, "ionization_frequency" => 0.0, - "timestepping" => Dict{String,Any}("nstep" => 100, + "timestepping" => OptionsDict("nstep" => 100, "dt" => 0.001, "nwrite" => 100, "nwrite_dfns" => 100, diff --git a/moment_kinetics/test/nonlinear_sound_wave_tests.jl b/moment_kinetics/test/nonlinear_sound_wave_tests.jl index 590047000..7da52ab70 100644 --- a/moment_kinetics/test/nonlinear_sound_wave_tests.jl +++ b/moment_kinetics/test/nonlinear_sound_wave_tests.jl @@ -5,11 +5,11 @@ include("setup.jl") using Base.Filesystem: tempname using moment_kinetics.coordinates: define_coordinate -using moment_kinetics.input_structs: grid_input, advection_input +using moment_kinetics.input_structs: grid_input, advection_input, merge_dict_with_kwargs! using moment_kinetics.interpolation: interpolate_to_grid_z, interpolate_to_grid_vpa using moment_kinetics.load_data: get_run_info_no_setup, close_run_info, postproc_load_variable -using moment_kinetics.type_definitions: mk_float +using moment_kinetics.type_definitions: mk_float, OptionsDict const analytical_rtol = 3.e-2 const regression_rtol = 2.e-8 @@ -26,14 +26,14 @@ function run_test(test_input, rtol, atol, upar_rtol=nothing; args...) # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) if upar_rtol === nothing upar_rtol = rtol end # Convert keyword arguments to a unique name - name = test_input["run_name"] + name = input["run_name"] if length(args) > 0 name = string(name, "_", (string(k, "-", v, "_") for (k, v) in args)...) @@ -44,12 +44,8 @@ function run_test(test_input, rtol, atol, upar_rtol=nothing; args...) # Provide some progress info println(" - testing ", name) - # Convert dict from symbol keys to String keys - modified_inputs = Dict(String(k) => v for (k, v) in args) - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = name # Suppress console output while running diff --git a/moment_kinetics/test/recycling_fraction_tests.jl b/moment_kinetics/test/recycling_fraction_tests.jl index fed259261..23a65fd19 100644 --- a/moment_kinetics/test/recycling_fraction_tests.jl +++ b/moment_kinetics/test/recycling_fraction_tests.jl @@ -10,59 +10,60 @@ using Base.Filesystem: tempname using MPI using moment_kinetics.coordinates: define_coordinate -using moment_kinetics.input_structs: grid_input, advection_input +using moment_kinetics.input_structs: grid_input, advection_input, merge_dict_with_kwargs! using moment_kinetics.interpolation: interpolate_to_grid_z using moment_kinetics.load_data: get_run_info_no_setup, close_run_info, postproc_load_variable +using moment_kinetics.type_definitions: OptionsDict # default inputs for tests -test_input = Dict("n_ion_species" => 1, - "n_neutral_species" => 1, - "boltzmann_electron_response" => true, +test_input = Dict("composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 0.2, + "T_wall" => 0.1, + "recycling_fraction" => 0.5), + "ion_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.0, + "density_phase" => 0.0, + "upar_amplitude" => 1.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "neutral_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => -1.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), "run_name" => "full-f", "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => false, - "recycling_fraction" => 0.5, - "T_e" => 0.2, - "T_wall" => 0.1, - "initial_density1" => 1.0, - "initial_temperature1" => 1.0, - "z_IC_option1" => "gaussian", - "z_IC_density_amplitude1" => 0.0, - "z_IC_density_phase1" => 0.0, - "z_IC_upar_amplitude1" => 1.0, - "z_IC_upar_phase1" => 0.0, - "z_IC_temperature_amplitude1" => 0.0, - "z_IC_temperature_phase1" => 0.0, - "vpa_IC_option1" => "gaussian", - "vpa_IC_density_amplitude1" => 1.0, - "vpa_IC_density_phase1" => 0.0, - "vpa_IC_upar_amplitude1" => 0.0, - "vpa_IC_upar_phase1" => 0.0, - "vpa_IC_temperature_amplitude1" => 0.0, - "vpa_IC_temperature_phase1" => 0.0, - "initial_density2" => 1.0, - "initial_temperature2" => 1.0, - "z_IC_option2" => "gaussian", - "z_IC_density_amplitude2" => 0.001, - "z_IC_density_phase2" => 0.0, - "z_IC_upar_amplitude2" => -1.0, - "z_IC_upar_phase2" => 0.0, - "z_IC_temperature_amplitude2" => 0.0, - "z_IC_temperature_phase2" => 0.0, - "vpa_IC_option2" => "gaussian", - "vpa_IC_density_amplitude2" => 1.0, - "vpa_IC_density_phase2" => 0.0, - "vpa_IC_upar_amplitude2" => 0.0, - "vpa_IC_upar_phase2" => 0.0, - "vpa_IC_temperature_amplitude2" => 0.0, - "vpa_IC_temperature_phase2" => 0.0, "charge_exchange_frequency" => 0.75, "ionization_frequency" => 0.5, "constant_ionization_rate" => false, - "timestepping" => Dict{String,Any}("nstep" => 1000, + "timestepping" => OptionsDict("nstep" => 1000, "dt" => 1.0e-4, "nwrite" => 1000, "split_operators" => false), @@ -107,8 +108,8 @@ test_input_split3 = merge(test_input_split2, "vpa_nelement" => 31, "vz_nelement" => 31, "evolve_moments_parallel_pressure" => true, - "ion_numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0, "vpa_dissipation_coefficient" => 1e-2), - "neutral_numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0, "vz_dissipation_coefficient" => 1e-2))) + "ion_numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0, "vpa_dissipation_coefficient" => 1e-2), + "neutral_numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0, "vz_dissipation_coefficient" => 1e-2))) test_input_split3["timestepping"] = merge(test_input_split3["timestepping"], Dict("dt" => 1.0e-5, "write_error_diagnostics" => true, @@ -116,7 +117,7 @@ test_input_split3["timestepping"] = merge(test_input_split3["timestepping"], # default inputs for adaptive timestepping tests test_input_adaptive = merge(test_input, - Dict{String,Any}("run_name" => "adaptive full-f", + OptionsDict("run_name" => "adaptive full-f", "z_ngrid" => 5, "z_nelement" => 16, "vpa_ngrid" => 6, @@ -130,7 +131,7 @@ test_input_adaptive = merge(test_input, # though the difference should be negligible compared to the # discretization error of the simulation). test_input_adaptive["timestepping"] = merge(test_input_adaptive["timestepping"], - Dict{String,Any}("type" => "Fekete4(3)", + OptionsDict("type" => "Fekete4(3)", "nstep" => 5000, "dt" => 1.0e-5, "minimum_dt" => 1.0e-5, @@ -147,18 +148,18 @@ test_input_adaptive_split2 = merge(test_input_adaptive_split1, Dict("run_name" => "adaptive split2", "evolve_moments_parallel_flow" => true)) test_input_adaptive_split2["timestepping"] = merge(test_input_adaptive_split2["timestepping"], - Dict{String,Any}("step_update_prefactor" => 0.4)) + OptionsDict("step_update_prefactor" => 0.4)) test_input_adaptive_split3 = merge(test_input_adaptive_split2, Dict("run_name" => "adaptive split3", "evolve_moments_parallel_pressure" => true, - "numerical_dissipation" => Dict{String,Any}("force_minimum_pdf_value" => 0.0, + "numerical_dissipation" => OptionsDict("force_minimum_pdf_value" => 0.0, "vpa_dissipation_coefficient" => 1e-2))) # The initial conditions seem to make the split3 case hard to advance without any # failures. In a real simulation, would just set the minimum_dt higher to try to get # through this without crashing. For this test, want the timestep to adapt (not just sit # at minimum_dt), so just set a very small timestep. test_input_adaptive_split3["timestepping"] = merge(test_input_adaptive_split3["timestepping"], - Dict{String,Any}("dt" => 1.0e-7, + OptionsDict("dt" => 1.0e-7, "rtol" => 2.0e-4, "atol" => 2.0e-10, "minimum_dt" => 1.0e-7, @@ -173,10 +174,10 @@ function run_test(test_input, expected_phi; rtol=4.e-14, atol=1.e-15, args...) # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) # Convert keyword arguments to a unique name - name = test_input["run_name"] + name = input["run_name"] if length(args) > 0 name = string(name, "_", (string(k, "-", v, "_") for (k, v) in args)...) @@ -187,12 +188,8 @@ function run_test(test_input, expected_phi; rtol=4.e-14, atol=1.e-15, args...) # Provide some progress info println(" - testing ", name) - # Convert dict from symbol keys to String keys - modified_inputs = Dict(String(k) => v for (k, v) in args) - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = name # Suppress console output while running diff --git a/moment_kinetics/test/restart_interpolation_tests.jl b/moment_kinetics/test/restart_interpolation_tests.jl index 9c0a1c99b..ca6a166ba 100644 --- a/moment_kinetics/test/restart_interpolation_tests.jl +++ b/moment_kinetics/test/restart_interpolation_tests.jl @@ -9,7 +9,7 @@ using Base.Filesystem: tempname using moment_kinetics.communication using moment_kinetics.coordinates: define_coordinate using moment_kinetics.file_io: io_has_parallel -using moment_kinetics.input_structs: grid_input, advection_input, hdf5 +using moment_kinetics.input_structs: grid_input, advection_input, hdf5, merge_dict_with_kwargs! using moment_kinetics.load_data: open_readonly_output_file, load_coordinate_data, load_species_data, load_fields_data, load_ion_moments_data, load_pdf_data, @@ -18,7 +18,7 @@ using moment_kinetics.load_data: open_readonly_output_file, load_coordinate_data using moment_kinetics.interpolation: interpolate_to_grid_z, interpolate_to_grid_vpa using moment_kinetics.load_data: get_run_info_no_setup, close_run_info, postproc_load_variable -using moment_kinetics.type_definitions: mk_float +using moment_kinetics.type_definitions: mk_float, OptionsDict include("nonlinear_sound_wave_inputs_and_expected_data.jl") @@ -30,11 +30,11 @@ if global_size[] > 1 && global_size[] % 2 == 0 # Test using distributed-memory base_input["z_nelement_local"] = base_input["z_nelement"] ÷ 2 end -base_input["output"] = Dict{String,Any}("parallel_io" => false) +base_input["output"] = OptionsDict("parallel_io" => false) restart_test_input_chebyshev = merge(deepcopy(base_input), - Dict("run_name" => "restart_chebyshev_pseudospectral", + OptionsDict("run_name" => "restart_chebyshev_pseudospectral", "r_ngrid" => 3, "r_nelement" => 2, "r_discretization" => "chebyshev_pseudospectral", "z_ngrid" => 17, "z_nelement" => 2, @@ -47,18 +47,18 @@ end restart_test_input_chebyshev_split_1_moment = merge(deepcopy(restart_test_input_chebyshev), - Dict("run_name" => "restart_chebyshev_pseudospectral_split_1_moment", + OptionsDict("run_name" => "restart_chebyshev_pseudospectral_split_1_moment", "evolve_moments_density" => true)) restart_test_input_chebyshev_split_2_moments = merge(deepcopy(restart_test_input_chebyshev_split_1_moment), - Dict("run_name" => "restart_chebyshev_pseudospectral_split_2_moments", + OptionsDict("run_name" => "restart_chebyshev_pseudospectral_split_2_moments", "r_ngrid" => 1, "r_nelement" => 1, "evolve_moments_parallel_flow" => true)) restart_test_input_chebyshev_split_3_moments = merge(deepcopy(restart_test_input_chebyshev_split_2_moments), - Dict("run_name" => "restart_chebyshev_pseudospectral_split_3_moments", + OptionsDict("run_name" => "restart_chebyshev_pseudospectral_split_3_moments", "evolve_moments_parallel_pressure" => true, "vpa_L" => 1.5*vpa_L, "vz_L" => 1.5*vpa_L)) @@ -66,13 +66,13 @@ restart_test_input_chebyshev_split_3_moments = Run a sound-wave test for a single set of parameters """ # Note 'name' should not be shared by any two tests in this file -function run_test(test_input, base, message, rtol, atol; tol_3V, kwargs...) - # by passing keyword arguments to run_test, kwargs becomes a Tuple of Pairs which can be used to +function run_test(test_input, base, message, rtol, atol; tol_3V, args...) + # by passing keyword arguments to run_test, args becomes a Tuple of Pairs which can be used to # update the default inputs # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) if tol_3V === nothing atol_3V = atol @@ -82,11 +82,21 @@ function run_test(test_input, base, message, rtol, atol; tol_3V, kwargs...) rtol_3V = tol_3V end - parallel_io = test_input["output"]["parallel_io"] + parallel_io = input["output"]["parallel_io"] # Convert keyword arguments to a unique name - name = test_input["run_name"] - if length(kwargs) > 0 - name = string(name, (string(String(k)[1], v) for (k, v) in kwargs)...) + function stringify_arg(key, value) + if isa(value, AbstractDict) + return string(string(key)[1], (stringify_arg(k, v) for (k, v) in value)...) + else + return string(string(key)[1], value) + end + end + name = input["run_name"] + if length(args) > 0 + name = string(name, "_", (stringify_arg(k, v) for (k, v) in args)...) + + # Remove trailing "_" + name = chop(name) end if parallel_io name *= "parallel-io" @@ -95,17 +105,7 @@ function run_test(test_input, base, message, rtol, atol; tol_3V, kwargs...) # Provide some progress info println(" - testing ", message) - # Convert from Tuple of Pairs with symbol keys to Dict with String keys - modified_inputs = Dict(String(k) => v for (k, v) in kwargs - if String(k) ∉ keys(test_input["timestepping"])) - modified_timestepping_inputs = Dict(String(k) => v for (k, v) in kwargs - if String(k) ∈ keys(test_input["timestepping"])) - - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - input["timestepping"] = merge(test_input["timestepping"], - modified_timestepping_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = name # Suppress console output while running @@ -290,7 +290,7 @@ end function runtests() function do_tests(label, rtol=1.0e-3, nstep=50, include_moment_kinetic=true; - tol_3V=nothing, kwargs...) + tol_3V=nothing, args...) # Only testing Chebyshev discretization because interpolation not yet implemented # for finite-difference @@ -298,14 +298,14 @@ function runtests() base_input_full_f = deepcopy(base_input) base_input_full_f["timestepping"] = merge(base_input["timestepping"], - Dict("nstep" => nstep)) + OptionsDict("nstep" => nstep)) base_input_evolve_density = merge(base_input_full_f, - Dict("evolve_moments_density" => true)) + OptionsDict("evolve_moments_density" => true)) base_input_evolve_upar = merge(base_input_evolve_density, - Dict("evolve_moments_parallel_flow" => true, + OptionsDict("evolve_moments_parallel_flow" => true, "vpa_L" => 1.5*vpa_L, "vz_L" => 1.5*vpa_L)) base_input_evolve_ppar = merge(base_input_evolve_upar, - Dict("evolve_moments_parallel_pressure" => true, + OptionsDict("evolve_moments_parallel_pressure" => true, "vpa_L" => 1.5*vpa_L, "vz_L" => 1.5*vpa_L)) for (base, base_label) ∈ ((base_input_full_f, "full-f"), @@ -332,7 +332,7 @@ function runtests() this_input = deepcopy(restart_test_input_chebyshev) this_input["base_directory"] = test_output_directory this_input["output"]["parallel_io"] = parallel_io - run_test(this_input, base, message, rtol, 1.e-15; tol_3V=tol_3V, kwargs...) + run_test(this_input, base, message, rtol, 1.e-15; tol_3V=tol_3V, args...) end if include_moment_kinetic message = "restart split 1 from $base_label$label" @@ -340,21 +340,21 @@ function runtests() this_input = deepcopy(restart_test_input_chebyshev_split_1_moment) this_input["base_directory"] = test_output_directory this_input["output"]["parallel_io"] = parallel_io - run_test(this_input, base, message, rtol, 1.e-15; tol_3V=tol_3V, kwargs...) + run_test(this_input, base, message, rtol, 1.e-15; tol_3V=tol_3V, args...) end message = "restart split 2 from $base_label$label" @testset "$message" begin this_input = deepcopy(restart_test_input_chebyshev_split_2_moments) this_input["base_directory"] = test_output_directory this_input["output"]["parallel_io"] = parallel_io - run_test(this_input, base, message, rtol, 1.e-15; tol_3V=tol_3V, kwargs...) + run_test(this_input, base, message, rtol, 1.e-15; tol_3V=tol_3V, args...) end message = "restart split 3 from $base_label$label" @testset "$message" begin this_input = deepcopy(restart_test_input_chebyshev_split_3_moments) this_input["base_directory"] = test_output_directory this_input["output"]["parallel_io"] = parallel_io - run_test(this_input, base, message, rtol, 1.e-15; tol_3V=tol_3V, kwargs...) + run_test(this_input, base, message, rtol, 1.e-15; tol_3V=tol_3V, args...) end end @@ -373,11 +373,11 @@ function runtests() # Note: only do 2 steps in 2V/3V mode because it is so slow. Also, linear # interpolation used for ion-neutral coupling in 2V/3V case has low accuracy, so # use looser tolerance for various things. - @long do_tests(", 2V/3V", 1.0e-1, 98, false; tol_3V=0.3, nstep=2, r_ngrid=1, - r_nelement=1, vperp_ngrid=17, vperp_nelement=4, vperp_L=vpa_L, - vpa_ngrid=17, vpa_nelement=8, vzeta_ngrid=17, vzeta_nelement=4, - vzeta_L=vpa_L, vr_ngrid=17, vr_nelement=4, vr_L=vpa_L, vz_ngrid=17, - vz_nelement=8) + @long do_tests(", 2V/3V", 1.0e-1, 98, false; tol_3V=0.3, + timestepping=OptionsDict("nstep" => 2), r_ngrid=1, r_nelement=1, + vperp_ngrid=17, vperp_nelement=4, vperp_L=vpa_L, vpa_ngrid=17, + vpa_nelement=8, vzeta_ngrid=17, vzeta_nelement=4, vzeta_L=vpa_L, + vr_ngrid=17, vr_nelement=4, vr_L=vpa_L, vz_ngrid=17, vz_nelement=8) if io_has_parallel(Val(hdf5)) orig_base_input = deepcopy(base_input) @@ -391,10 +391,11 @@ function runtests() # interpolation used for ion-neutral coupling in 2V/3V case has low accuracy, # so use looser tolerance for various things. @long do_tests(", 2V/3V, parallel I/O", 2.0e-1, 98, false; tol_3V=0.3, - nstep=2, r_ngrid=1, r_nelement=1, vperp_ngrid=17, - vperp_nelement=4, vperp_L=vpa_L, vpa_ngrid=17, vpa_nelement=8, - vzeta_ngrid=17, vzeta_nelement=4, vzeta_L=vpa_L, vr_ngrid=17, - vr_nelement=4, vr_L=vpa_L, vz_ngrid=17, vz_nelement=8) + timestepping=OptionsDict("nstep" => 2), r_ngrid=1, + r_nelement=1, vperp_ngrid=17, vperp_nelement=4, vperp_L=vpa_L, + vpa_ngrid=17, vpa_nelement=8, vzeta_ngrid=17, vzeta_nelement=4, + vzeta_L=vpa_L, vr_ngrid=17, vr_nelement=4, vr_L=vpa_L, + vz_ngrid=17, vz_nelement=8) global base_input = orig_base_input end diff --git a/moment_kinetics/test/sound_wave_tests.jl b/moment_kinetics/test/sound_wave_tests.jl index f72cdf1c7..7da2ab497 100644 --- a/moment_kinetics/test/sound_wave_tests.jl +++ b/moment_kinetics/test/sound_wave_tests.jl @@ -6,13 +6,14 @@ using Base.Filesystem: tempname #using Plots: plot, plot!, gui using moment_kinetics.array_allocation: allocate_float -using moment_kinetics.input_structs: netcdf +using moment_kinetics.input_structs: netcdf, merge_dict_with_kwargs! using moment_kinetics.file_io: io_has_implementation using moment_kinetics.load_data: open_readonly_output_file using moment_kinetics.load_data: load_fields_data, load_time_data using moment_kinetics.load_data: load_species_data, load_coordinate_data using moment_kinetics.analysis: analyze_fields_data using moment_kinetics.analysis: fit_delta_phi_mode +using moment_kinetics.type_definitions: OptionsDict const analytical_rtol = 3.e-2 const regression_rtol = 1.e-14 @@ -24,36 +25,36 @@ const binary_format = (force_optional_dependencies || io_has_implementation(netc "netcdf" : "hdf5" # default inputs for tests -test_input_finite_difference = Dict("n_ion_species" => 1, - "n_neutral_species" => 1, - "boltzmann_electron_response" => true, +test_input_finite_difference = Dict("composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0), + "ion_species_1" => OptionsDict("initial_density" => 0.5, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "neutral_species_1" => OptionsDict("initial_density" => 0.5, + "initial_temperature" => 1.0), + "z_IC_neutral_species_1" => OptionsDict("initialization_option" => "sinusoid", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), "run_name" => "finite_difference", "evolve_moments_density" => false, "evolve_moments_parallel_flow" => false, "evolve_moments_parallel_pressure" => false, "evolve_moments_conservation" => true, - "T_e" => 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" => 2*π*0.1, "ionization_frequency" => 0.0, - "timestepping" => Dict{String,Any}("nstep" => 1500, + "timestepping" => OptionsDict("nstep" => 1500, "dt" => 0.002, "nwrite" => 20, "split_operators" => false), @@ -79,7 +80,7 @@ test_input_finite_difference = Dict("n_ion_species" => 1, "vz_L" => 8.0, "vz_bc" => "periodic", "vz_discretization" => "finite_difference", - "output" => Dict{String,Any}("binary_format" => binary_format) + "output" => OptionsDict("binary_format" => binary_format) ) test_input_finite_difference_split_1_moment = @@ -138,14 +139,21 @@ function run_test(test_input, analytic_frequency, analytic_growth_rate, # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) # Convert keyword arguments to a unique name - name = test_input["run_name"] + function stringify_arg(key, value) + if isa(value, AbstractDict) + return string(string(key)[1], (stringify_arg(k, v) for (k, v) in value)...) + else + return string(string(key)[1], value) + end + end + name = input["run_name"] shortname = name if length(args) > 0 name = string(name, "_", (string(k, "-", v, "_") for (k, v) in args)...) - shortname = string(shortname, "_", (string(string(k)[1], v) for (k, v) in args)...) + shortname = string(shortname, "_", (stringify_arg(k, v) for (k, v) in args)...) # Remove trailing "_" name = chop(name) @@ -154,17 +162,8 @@ function run_test(test_input, analytic_frequency, analytic_growth_rate, # Provide some progress info println(" - testing ", name) - # Convert dict from symbol keys to String keys - modified_inputs = Dict(String(k) => v for (k, v) in args - if String(k) ∉ keys(test_input["timestepping"])) - modified_timestepping_inputs = Dict(String(k) => v for (k, v) in args - if String(k) ∈ keys(test_input["timestepping"])) - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - input["timestepping"] = merge(test_input["timestepping"], - modified_timestepping_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = shortname # Suppress console output while running @@ -269,39 +268,47 @@ function run_test_set_finite_difference() [-0.001068422466592656, -0.001050527721698838, -0.0010288041337549816, -0.0010033394223323698, -0.0009742364063442995, -0.000941612585497573]; - initial_density1=0.9999, initial_density2=0.0001) + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001)) @long run_test(test_input_finite_difference, 2*π*1.4467, -2*π*0.6020, [-0.001068422466592656, -0.001050527721698838, -0.0010288041337549816, -0.0010033394223323698, -0.0009742364063442995, - -0.000941612585497573]; initial_density1=0.9999, - initial_density2=0.0001, charge_exchange_frequency=2*π*2.0) + -0.000941612585497573]; + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001), + charge_exchange_frequency=2*π*2.0) # n_i< 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999)) @long run_test(test_input_finite_difference, 2*π*0.0, -2*π*0.5112, [-9.211308789442441, -9.211290894697548, -9.211269171109604, -9.21124370639818, -9.211214603382192, -9.211181979561346]; - initial_density1=0.0001, initial_density2=0.9999, + ion_species_1 = OptionsDict("initial_density" => 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=0.5 @long run_test(test_input_finite_difference, 2*π*1.2671, -2*π*0.8033, [-0.34705779901310196, -0.34704885164065513, -0.3470379898466833, -0.3470252574909716, -0.3470107059829777, -0.3469943940725544], 30; - T_e=0.5, nstep=1300, charge_exchange_frequency=2*π*0.0) + composition = OptionsDict("T_e" => 0.5), + timestepping = OptionsDict("nstep" => 1300), + charge_exchange_frequency=2*π*0.0) @long run_test(test_input_finite_difference, 2*π*0.0, -2*π*0.2727, [-0.34705779901310196, -0.34704885164065513, -0.3470379898466833, -0.3470252574909716, -0.3470107059829777, -0.3469943940725544]; - T_e=0.5, charge_exchange_frequency=2*π*2.0) + composition = OptionsDict("T_e" => 0.5), + charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=4 @long run_test(test_input_finite_difference, 2*π*1.9919, -2*π*0.2491, [-2.7764623921048157, -2.776390813125241, -2.7763039187734666, -2.7762020599277726, -2.7760856478638214, -2.775955152580435]; - T_e=4.0) + composition = OptionsDict("T_e" => 4.0)) # CX=2*π*2.0 case with T_e=4 is too hard to converge, so skip end @@ -327,38 +334,46 @@ function run_test_set_finite_difference_split_1_moment() run_test(test_input_finite_difference_split_1_moment, 2*π*1.4467, -2*π*0.6020, [-0.0010684224665919893, -0.0010505277216983934, -0.0010288041337547594, -0.0010033394223312585, -0.0009742364063434105, -0.0009416125854969064]; - initial_density1=0.9999, initial_density2=0.0001) + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001)) run_test(test_input_finite_difference_split_1_moment, 2*π*1.4467, -2*π*0.6020, [-0.0010684224665919893, -0.0010505277216983934, -0.0010288041337547594, -0.0010033394223312585, -0.0009742364063434105, -0.0009416125854969064]; - initial_density1=0.9999, initial_density2=0.0001, + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001), charge_exchange_frequency=2*π*2.0) # n_i< 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999)) run_test(test_input_finite_difference_split_1_moment, 2*π*0.0, -2*π*0.5112, [-9.211308789442441, -9.211290894697548, -9.211269171109604, -9.21124370639818, -9.211214603382192, -9.211181979561346]; - initial_density1=0.0001, initial_density2=0.9999, + ion_species_1 = OptionsDict("initial_density" => 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=0.5 run_test(test_input_finite_difference_split_1_moment, 2*π*1.2671, -2*π*0.8033, [-0.34705779901310196, -0.34704885164065513, -0.3470379898466833, -0.3470252574909716, -0.3470107059829777, -0.3469943940725544], 30; - T_e=0.5, nstep=1300, charge_exchange_frequency=2*π*0.0) + composition = OptionsDict("T_e" => 0.5), + timestepping = OptionsDict("nstep" => 1300), + charge_exchange_frequency=2*π*0.0) run_test(test_input_finite_difference_split_1_moment, 2*π*0.0, -2*π*0.2727, [-0.34705779901310196, -0.34704885164065513, -0.3470379898466833, - -0.3470252574909716, -0.3470107059829777, -0.3469943940725544]; T_e=0.5, + -0.3470252574909716, -0.3470107059829777, -0.3469943940725544]; + composition = OptionsDict("T_e" => 0.5), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=4 run_test(test_input_finite_difference_split_1_moment, 2*π*1.9919, -2*π*0.2491, [-2.7764623921048157, -2.776390813125241, -2.7763039187734666, - -2.7762020599277726, -2.7760856478638214, -2.775955152580435]; T_e=4.0) + -2.7762020599277726, -2.7760856478638214, -2.775955152580435]; + composition = OptionsDict("T_e" => 4.0)) # CX=2*π*2.0 case with T_e=4 is too hard to converge, so skip end @@ -384,38 +399,46 @@ function run_test_set_finite_difference_split_2_moments() run_test(test_input_finite_difference_split_2_moments, 2*π*1.4467, -2*π*0.6020, [-0.0010684224665919893, -0.0010505277216983934, -0.0010288041337547594, -0.0010033394223312585, -0.0009742364063434105, -0.0009416125854969064]; - initial_density1=0.9999, initial_density2=0.0001) + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001)) run_test(test_input_finite_difference_split_2_moments, 2*π*1.4467, -2*π*0.6020, [-0.0010684224665919893, -0.0010505277216983934, -0.0010288041337547594, -0.0010033394223312585, -0.0009742364063434105, -0.0009416125854969064]; - initial_density1=0.9999, initial_density2=0.0001, + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001), charge_exchange_frequency=2*π*2.0) # n_i< 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999)) run_test(test_input_finite_difference_split_2_moments, 2*π*0.0, -2*π*0.5112, [-9.211308789442441, -9.211290894697548, -9.211269171109604, -9.21124370639818, -9.211214603382192, -9.211181979561346]; - initial_density1=0.0001, initial_density2=0.9999, + ion_species_1 = OptionsDict("initial_density" => 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=0.5 run_test(test_input_finite_difference_split_2_moments, 2*π*1.2671, -2*π*0.8033, [-0.34706673733456106, -0.3470627566790802, -0.3470579059173919, -0.347052193699157, -0.34704563020982493, -0.3470382271523149], 30; - T_e=0.5, nstep=1300, z_ngrid=150, charge_exchange_frequency=2*π*0.0) + composition = OptionsDict("T_e" => 0.5), + timestepping = OptionsDict("nstep" => 1300), z_ngrid=150, + charge_exchange_frequency=2*π*0.0) run_test(test_input_finite_difference_split_2_moments, 2*π*0.0, -2*π*0.2727, [-0.34705779901310196, -0.34704885164065513, -0.3470379898466833, - -0.3470252574909716, -0.3470107059829777, -0.3469943940725544]; T_e=0.5, + -0.3470252574909716, -0.3470107059829777, -0.3469943940725544]; + composition = OptionsDict("T_e" => 0.5), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=4 run_test(test_input_finite_difference_split_2_moments, 2*π*1.9919, -2*π*0.2491, [-2.7764623921048157, -2.776390813125241, -2.7763039187734666, - -2.7762020599277726, -2.7760856478638214, -2.775955152580435]; T_e=4.0) + -2.7762020599277726, -2.7760856478638214, -2.775955152580435]; + composition = OptionsDict("T_e" => 4.0)) # CX=2*π*2.0 case with T_e=4 is too hard to converge, so skip end @@ -443,12 +466,14 @@ function run_test_set_finite_difference_split_3_moments() -2*π*0.6020, [-0.0010684224665919893, -0.0010505277216983934, -0.0010288041337547594, -0.0010033394223312585, -0.0009742364063434105, -0.0009416125854969064]; - initial_density1=0.9999, initial_density2=0.0001) + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001)) @long run_test(test_input_finite_difference_split_3_moments, 2*π*1.4467, -2*π*0.6020, [-0.0010684224665919893, -0.0010505277216983934, -0.0010288041337547594, -0.0010033394223312585, -0.0009742364063434105, -0.0009416125854969064]; - initial_density1=0.9999, initial_density2=0.0001, + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001), charge_exchange_frequency=2*π*2.0) # n_i< 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999)) @long run_test(test_input_finite_difference_split_3_moments, 2*π*0.0, -2*π*0.5112, [-9.211308789442441, -9.211290894697548, -9.211269171109604, -9.21124370639818, -9.211214603382192, -9.211181979561346]; - initial_density1=0.0001, initial_density2=0.9999, + ion_species_1 = OptionsDict("initial_density" => 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=0.5 @@ -468,17 +495,21 @@ function run_test_set_finite_difference_split_3_moments() -2*π*0.8033, [-0.34705779901310196, -0.34704885164065513, -0.3470379898466833, -0.3470252574909716, -0.3470107059829777, -0.3469943940725544], 30; - T_e=0.5, nstep=1300, charge_exchange_frequency=2*π*0.0) + composition = OptionsDict("T_e" => 0.5), + timestepping = OptionsDict("nstep" => 1300), + charge_exchange_frequency=2*π*0.0) @long run_test(test_input_finite_difference_split_3_moments, 2*π*0.0, -2*π*0.2727, [-0.34705779901310196, -0.34704885164065513, -0.3470379898466833, -0.3470252574909716, -0.3470107059829777, -0.3469943940725544]; - T_e=0.5, charge_exchange_frequency=2*π*2.0) + composition = OptionsDict("T_e" => 0.5), + charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=4 @long run_test(test_input_finite_difference_split_3_moments, 2*π*1.9919, -2*π*0.2491, [-2.7764623921048157, -2.776390813125241, -2.7763039187734666, -2.7762020599277726, - -2.7760856478638214, -2.775955152580435]; T_e=4.0) + -2.7760856478638214, -2.775955152580435]; + composition = OptionsDict("T_e" => 4.0)) # CX=2*π*2.0 case with T_e=4 is too hard to converge, so skip end @@ -504,39 +535,46 @@ function run_test_set_chebyshev() @long run_test(test_input_chebyshev, 2*π*1.4467, -2*π*0.6020, [-0.00010000500033334732, 0.0004653997510461739, 0.0007956127502558478, 0.0008923624901804128, 0.0008994953327500175, 0.0008923624901804128]; - initial_density1=0.9999, initial_density2=0.0001) + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001)) @long run_test(test_input_chebyshev, 2*π*1.4467, -2*π*0.6020, [-0.00010000500033334732, 0.0004653997510461739, 0.0007956127502558478, 0.0008923624901804128, 0.0008994953327500175, 0.0008923624901804128]; - initial_density1=0.9999, initial_density2=0.0001, + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001), charge_exchange_frequency=2*π*2.0) # n_i< 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999)) @long run_test(test_input_chebyshev, 2*π*0.0, -2*π*0.5112, [-9.210340371976182, -9.209774967224805, -9.209444754225593, -9.209348004485669, -9.2093408716431, -9.209348004485669]; - initial_density1=0.0001, initial_density2=0.9999, + ion_species_1 = OptionsDict("initial_density" => 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=0.5 @long run_test(test_input_chebyshev, 2*π*1.2671, -2*π*0.8033, [-0.34657359027997264, -0.34629088790428314, -0.34612578140467837, -0.34607740653471614, -0.34607384011343095, -0.34607740653471614], - 30; T_e=0.5, nstep=1300, charge_exchange_frequency=2*π*0.0) + 30; composition = OptionsDict("T_e" => 0.5), + timestepping = OptionsDict("nstep" => 1300), + charge_exchange_frequency=2*π*0.0) @long run_test(test_input_chebyshev, 2*π*0.0, -2*π*0.2727, [-0.34657359027997264, -0.34629088790428314, -0.34612578140467837, -0.34607740653471614, -0.34607384011343095, -0.34607740653471614]; - T_e=0.5, charge_exchange_frequency=2*π*2.0) + composition = OptionsDict("T_e" => 0.5), + charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=4 @long run_test(test_input_chebyshev, 2*π*1.9919, -2*π*0.2491, [-2.772588722239781, -2.770327103234265, -2.769006251237427, -2.768619252277729, -2.7685907209074476, -2.768619252277729]; - T_e=4.0) + composition = OptionsDict("T_e" => 4.0)) # CX=2*π*2.0 case with T_e=4 is too hard to converge, so skip end @@ -562,40 +600,48 @@ function run_test_set_chebyshev_split_1_moment() @long run_test(test_input_chebyshev_split_1_moment, 2*π*1.4467, -2*π*0.6020, [-0.00010000500033334732, 0.00046539975104573, 0.0007956127502551822, 0.0008923624901797472, 0.0008994953327500175, - 0.0008923624901797472]; initial_density1=0.9999, - initial_density2=0.0001) + 0.0008923624901797472]; + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001)) @long run_test(test_input_chebyshev_split_1_moment, 2*π*1.4467, -2*π*0.6020, [-0.00010000500033334732, 0.00046539975104573, 0.0007956127502551822, 0.0008923624901797472, 0.0008994953327500175, - 0.0008923624901797472]; initial_density1=0.9999, - initial_density2=0.0001, charge_exchange_frequency=2*π*2.0) + 0.0008923624901797472]; + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001), + charge_exchange_frequency=2*π*2.0) # n_i< 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999)) @long run_test(test_input_chebyshev_split_1_moment, 2*π*0.0, -2*π*0.5112, [-9.210340371976182, -9.209774967224805, -9.209444754225593, -9.209348004485669, -9.2093408716431, -9.209348004485669]; - initial_density1=0.0001, initial_density2=0.9999, + ion_species_1 = OptionsDict("initial_density" => 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=0.5 @long run_test(test_input_chebyshev_split_1_moment, 2*π*1.2671, -2*π*0.8033, [-0.34657359027997264, -0.34629088790428314, -0.34612578140467837, -0.34607740653471614, -0.34607384011343095, -0.34607740653471614], - 30; T_e=0.5, nstep=1300, charge_exchange_frequency=2*π*0.0) + 30; composition = OptionsDict("T_e" => 0.5), + timestepping = OptionsDict("nstep" => 1300), + charge_exchange_frequency=2*π*0.0) @long run_test(test_input_chebyshev_split_1_moment, 2*π*0.0, -2*π*0.2727, [-0.34657359027997264, -0.34629088790428314, -0.34612578140467837, -0.34607740653471614, -0.34607384011343095, -0.34607740653471614]; - T_e=0.5, charge_exchange_frequency=2*π*2.0) + composition = OptionsDict("T_e" => 0.5), + charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=4 @long run_test(test_input_chebyshev_split_1_moment, 2*π*1.9919, -2*π*0.2491, [-2.772588722239781, -2.770327103234265, -2.769006251237427, -2.768619252277729, -2.7685907209074476, -2.768619252277729]; - T_e=4.0) + composition = OptionsDict("T_e" => 4.0)) # CX=2*π*2.0 case with T_e=4 is too hard to converge, so skip end @@ -621,41 +667,48 @@ function run_test_set_chebyshev_split_2_moments() @long run_test(test_input_chebyshev_split_2_moments, 2*π*1.4467, -2*π*0.6020, [-0.00010000500033334732, 0.00046539975104573, 0.0007956127502551822, 0.0008923624901797472, 0.0008994953327500175, - 0.0008923624901797472]; initial_density1=0.9999, - initial_density2=0.0001) + 0.0008923624901797472]; + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001)) @long run_test(test_input_chebyshev_split_2_moments, 2*π*1.4467, -2*π*0.6020, [-0.00010000500033334732, 0.00046539975104573, 0.0007956127502551822, 0.0008923624901797472, 0.0008994953327500175, - 0.0008923624901797472]; initial_density1=0.9999, - initial_density2=0.0001, charge_exchange_frequency=2*π*2.0) + 0.0008923624901797472]; + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001), + charge_exchange_frequency=2*π*2.0) # n_i< 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999)) @long run_test(test_input_chebyshev_split_2_moments, 2*π*0.0, -2*π*0.5112, [-9.210340371976182, -9.209774967224805, -9.209444754225593, -9.209348004485669, -9.2093408716431, -9.209348004485669]; - initial_density1=0.0001, initial_density2=0.9999, + ion_species_1 = OptionsDict("initial_density" => 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=0.5 @long run_test(test_input_chebyshev_split_2_moments, 2*π*1.2671, -2*π*0.8033, [-0.34657359027997264, -0.34629088790428314, -0.34612578140467837, -0.34607740653471614, -0.34607384011343095, -0.34607740653471614], - 40; T_e=0.5, nstep=1300, nwrite=10, + 40; composition = OptionsDict("T_e" => 0.5), + timestepping = OptionsDict("nstep" => 1300, "nwrite" => 10), charge_exchange_frequency=2*π*0.0) @long run_test(test_input_chebyshev_split_2_moments, 2*π*0.0, -2*π*0.2727, [-0.34657359027997264, -0.34629088790428314, -0.34612578140467837, -0.34607740653471614, -0.34607384011343095, -0.34607740653471614]; - T_e=0.5, charge_exchange_frequency=2*π*2.0) + composition = OptionsDict("T_e" => 0.5), + charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=4 @long run_test(test_input_chebyshev_split_2_moments, 2*π*1.9919, -2*π*0.2491, [-2.772588722239781, -2.770327103234265, -2.769006251237427, -2.768619252277729, -2.7685907209074476, -2.768619252277729]; - T_e=4.0) + composition = OptionsDict("T_e" => 4.0)) # CX=2*π*2.0 case with T_e=4 is too hard to converge, so skip end @@ -681,40 +734,48 @@ function run_test_set_chebyshev_split_3_moments() @long run_test(test_input_chebyshev_split_3_moments, 2*π*1.4467, -2*π*0.6020, [-0.00010000500033334732, 0.00046539975104573, 0.0007956127502551822, 0.0008923624901797472, 0.0008994953327500175, - 0.0008923624901797472]; initial_density1=0.9999, - initial_density2=0.0001) + 0.0008923624901797472]; + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001)) @long run_test(test_input_chebyshev_split_3_moments, 2*π*1.4467, -2*π*0.6020, [-0.00010000500033334732, 0.00046539975104573, 0.0007956127502551822, 0.0008923624901797472, 0.0008994953327500175, - 0.0008923624901797472]; initial_density1=0.9999, - initial_density2=0.0001, charge_exchange_frequency=2*π*2.0) + 0.0008923624901797472]; + ion_species_1 = OptionsDict("initial_density" => 0.9999), + neutral_species_1 = OptionsDict("initial_density" => 0.0001), + charge_exchange_frequency=2*π*2.0) # n_i< 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999)) @long run_test(test_input_chebyshev_split_3_moments, 2*π*0.0, -2*π*0.5112, [-9.210340371976182, -9.209774967224805, -9.209444754225593, -9.209348004485669, -9.2093408716431, -9.209348004485669]; - initial_density1=0.0001, initial_density2=0.9999, + ion_species_1 = OptionsDict("initial_density" => 0.0001), + neutral_species_1 = OptionsDict("initial_density" => 0.9999), charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=0.5 @long run_test(test_input_chebyshev_split_3_moments, 2*π*1.2671, -2*π*0.8033, [-0.34657359027997264, -0.34629088790428314, -0.34612578140467837, -0.34607740653471614, -0.34607384011343095, -0.34607740653471614], - 80; T_e=0.5, nstep=1300, nwrite=5, charge_exchange_frequency=2*π*0.0) + 80; composition = OptionsDict("T_e" => 0.5), + timestepping = OptionsDict("nstep" => 1300, "nwrite" => 5), + charge_exchange_frequency=2*π*0.0) @long run_test(test_input_chebyshev_split_3_moments, 2*π*0.0, -2*π*0.2727, [-0.34657359027997264, -0.34629088790428314, -0.34612578140467837, -0.34607740653471614, -0.34607384011343095, -0.34607740653471614]; - T_e=0.5, charge_exchange_frequency=2*π*2.0) + composition = OptionsDict("T_e" => 0.5), + charge_exchange_frequency=2*π*2.0) # n_i=n_n T_e=4 @long run_test(test_input_chebyshev_split_3_moments, 2*π*1.9919, -2*π*0.2491, [-2.772588722239781, -2.770327103234265, -2.769006251237427, -2.768619252277729, -2.7685907209074476, -2.768619252277729]; - T_e=4.0) + composition = OptionsDict("T_e" => 4.0)) # CX=2*π*2.0 case with T_e=4 is too hard to converge, so skip end diff --git a/moment_kinetics/test/wall_bc_tests.jl b/moment_kinetics/test/wall_bc_tests.jl index ab09fec48..ccb03adbe 100644 --- a/moment_kinetics/test/wall_bc_tests.jl +++ b/moment_kinetics/test/wall_bc_tests.jl @@ -9,60 +9,61 @@ using Base.Filesystem: tempname using MPI using moment_kinetics.coordinates: define_coordinate -using moment_kinetics.input_structs: grid_input, advection_input +using moment_kinetics.input_structs: grid_input, advection_input, merge_dict_with_kwargs! using moment_kinetics.interpolation: interpolate_to_grid_z using moment_kinetics.load_data: open_readonly_output_file using moment_kinetics.load_data: load_fields_data, load_pdf_data, load_time_data, load_species_data +using moment_kinetics.type_definitions: OptionsDict # default inputs for tests -test_input_finite_difference = Dict("n_ion_species" => 1, - "n_neutral_species" => 1, - "boltzmann_electron_response" => true, +test_input_finite_difference = Dict("composition" => OptionsDict("n_ion_species" => 1, + "n_neutral_species" => 1, + "electron_physics" => "boltzmann_electron_response", + "T_e" => 1.0, + "T_wall" => 1.0), + "ion_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_ion_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "neutral_species_1" => OptionsDict("initial_density" => 1.0, + "initial_temperature" => 1.0), + "z_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 0.001, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), + "vpa_IC_neutral_species_1" => OptionsDict("initialization_option" => "gaussian", + "density_amplitude" => 1.0, + "density_phase" => 0.0, + "upar_amplitude" => 0.0, + "upar_phase" => 0.0, + "temperature_amplitude" => 0.0, + "temperature_phase" => 0.0), "run_name" => "finite_difference", "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" => 1.0, - "initial_temperature1" => 1.0, - "z_IC_option1" => "gaussian", - "z_IC_density_amplitude1" => 0.0, - "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, - "vpa_IC_option1" => "gaussian", - "vpa_IC_density_amplitude1" => 1.0, - "vpa_IC_density_phase1" => 0.0, - "vpa_IC_upar_amplitude1" => 0.0, - "vpa_IC_upar_phase1" => 0.0, - "vpa_IC_temperature_amplitude1" => 0.0, - "vpa_IC_temperature_phase1" => 0.0, - "initial_density2" => 1.0, - "initial_temperature2" => 1.0, - "z_IC_option2" => "gaussian", - "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_option2" => "gaussian", - "vpa_IC_density_amplitude2" => 1.0, - "vpa_IC_density_phase2" => 0.0, - "vpa_IC_upar_amplitude2" => 0.0, - "vpa_IC_upar_phase2" => 0.0, - "vpa_IC_temperature_amplitude2" => 0.0, - "vpa_IC_temperature_phase2" => 0.0, "charge_exchange_frequency" => 2.0, "ionization_frequency" => 2.0, "constant_ionization_rate" => false, - "timestepping" => Dict{String,Any}("nstep" => 10000, + "timestepping" => OptionsDict("nstep" => 10000, "dt" => 1.0e-5, "nwrite" => 100, "split_operators" => false), @@ -142,10 +143,10 @@ function run_test(test_input, expected_phi, tolerance; args...) # Make a copy to make sure nothing modifies the input Dicts defined in this test # script. - test_input = deepcopy(test_input) + input = deepcopy(test_input) # Convert keyword arguments to a unique name - name = test_input["run_name"] * ", with element spacing: " * test_input["z_element_spacing_option"] + name = input["run_name"] * ", with element spacing: " * input["z_element_spacing_option"] if length(args) > 0 name = string(name, "_", (string(k, "-", v, "_") for (k, v) in args)...) @@ -156,12 +157,8 @@ function run_test(test_input, expected_phi, tolerance; args...) # Provide some progress info println(" - testing ", name) - # Convert dict from symbol keys to String keys - modified_inputs = Dict(String(k) => v for (k, v) in args) - # Update default inputs with values to be changed - input = merge(test_input, modified_inputs) - + merge_dict_with_kwargs!(input; args...) input["run_name"] = name # Suppress console output while running diff --git a/plots_post_processing/plots_post_processing/src/plot_MMS_sequence.jl b/plots_post_processing/plots_post_processing/src/plot_MMS_sequence.jl index 92d780b27..17ba9c02b 100644 --- a/plots_post_processing/plots_post_processing/src/plot_MMS_sequence.jl +++ b/plots_post_processing/plots_post_processing/src/plot_MMS_sequence.jl @@ -17,7 +17,7 @@ using ..post_processing_input: pp using ..plots_post_processing: compare_ion_pdf_symbolic_test, compare_fields_symbolic_test using ..plots_post_processing: compare_moments_symbolic_test, compare_neutral_pdf_symbolic_test using ..plots_post_processing: allocate_global_zr_neutral_moments, allocate_global_zr_ion_moments -using ..plots_post_processing: allocate_global_zr_fields, get_composition +using ..plots_post_processing: allocate_global_zr_fields using ..plots_post_processing: get_coords_nelement, get_coords_ngrid using moment_kinetics.array_allocation: allocate_float using moment_kinetics.type_definitions: mk_float, mk_int @@ -29,9 +29,10 @@ using moment_kinetics.load_data: load_block_data, load_coordinate_data, load_inp using moment_kinetics.load_data: read_distributed_zr_data!, construct_global_zr_coords using moment_kinetics.velocity_moments: integrate_over_vspace using moment_kinetics.manufactured_solns: manufactured_solutions, manufactured_electric_fields -using moment_kinetics.moment_kinetics_input: mk_input, read_input_file, get_default_rhostar +using moment_kinetics.moment_kinetics_input: mk_input, read_input_file using moment_kinetics.input_structs: geometry_input using moment_kinetics.reference_parameters +using moment_kinetics.species_input: get_species_input import Base: get @@ -240,14 +241,8 @@ function get_MMS_error_data(path_list,scan_type,scan_name) else Lr_in = 1.0 end - composition = get_composition(scan_input) - - reference_params = setup_reference_parameters(scan_input) - option = get(scan_input, "geometry_option", "constant-helical") #"1D-mirror" - pitch = get(scan_input, "pitch", 1.0) - rhostar = get(scan_input, "rhostar", get_default_rhostar(reference_params)) - DeltaB = get(scan_input, "DeltaB", 1.0) - geo_in = geometry_input(rhostar,option,pitch,DeltaB) + composition = get_species_input(scan_input) + geo_in = setup_geometry_input(scan_input) manufactured_solns_list = manufactured_solutions(manufactured_solns_input,Lr_in,z.L,r_bc,z_bc,geo_in,composition,species,r.n,vperp.n) dfni_func = manufactured_solns_list.dfni_func diff --git a/plots_post_processing/plots_post_processing/src/plots_post_processing.jl b/plots_post_processing/plots_post_processing/src/plots_post_processing.jl index 00b8c7558..82c6726db 100644 --- a/plots_post_processing/plots_post_processing/src/plots_post_processing.jl +++ b/plots_post_processing/plots_post_processing/src/plots_post_processing.jl @@ -59,14 +59,15 @@ using moment_kinetics.velocity_moments: integrate_over_vspace using moment_kinetics.manufactured_solns: manufactured_solutions, manufactured_electric_fields, manufactured_geometry -using moment_kinetics.moment_kinetics_input: mk_input, get, get_default_rhostar +using moment_kinetics.moment_kinetics_input: mk_input, get using moment_kinetics.input_structs: geometry_input, grid_input, species_composition -using moment_kinetics.input_structs: electron_physics_type, boltzmann_electron_response, +using moment_kinetics.input_structs: boltzmann_electron_response, #electron_physics_type, boltzmann_electron_response_with_simple_sheath +using moment_kinetics.species_input: get_species_input using moment_kinetics.reference_parameters using moment_kinetics.geo: init_magnetic_geometry using .post_processing_input: pp -using .shared_utils: calculate_and_write_frequencies, get_geometry, get_composition +using .shared_utils: calculate_and_write_frequencies, get_geometry using TOML import Base: get @@ -679,7 +680,7 @@ function analyze_and_plot_data(prefix...; run_index=nothing) geometry = get_tuple_of_return_values(get_geometry, scan_input, z, r) composition = - get_tuple_of_return_values(get_composition, scan_input) + get_tuple_of_return_values(get_species_input, scan_input) # initialise the post-processing input options nwrite_movie, itime_min, itime_max, nwrite_movie_pdfs, itime_min_pdfs, itime_max_pdfs, diff --git a/util/precompile_makie_plots.jl b/util/precompile_makie_plots.jl index 80a0dcb1e..132556e93 100644 --- a/util/precompile_makie_plots.jl +++ b/util/precompile_makie_plots.jl @@ -1,4 +1,5 @@ using moment_kinetics +using moment_kinetics.type_definitions: OptionsDict using makie_post_processing # Create a temporary directory for test output @@ -8,7 +9,6 @@ mkpath(test_output_directory) input_dict = Dict("run_name"=>run_name, "base_directory" => test_output_directory, - "dt" => 0.0, "r_ngrid" => 5, "r_nelement" => 1, "r_bc" => "periodic", @@ -42,7 +42,7 @@ input_dict = Dict("run_name"=>run_name, "vz_bc" => "periodic", "vz_L" => 4.0, "vz_discretization" => "chebyshev_pseudospectral", - "timestepping" => Dict{String,Any}("nstep" => 1)) + "timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11)) run_moment_kinetics(input_dict) diff --git a/util/precompile_plots_plots.jl b/util/precompile_plots_plots.jl index a67d85103..e299919fc 100644 --- a/util/precompile_plots_plots.jl +++ b/util/precompile_plots_plots.jl @@ -1,4 +1,5 @@ using moment_kinetics +using moment_kinetics.type_definitions: OptionsDict using plots_post_processing # Create a temporary directory for test output @@ -8,7 +9,6 @@ mkpath(test_output_directory) input_dict = Dict("run_name"=>run_name, "base_directory" => test_output_directory, - "dt" => 0.0, "r_ngrid" => 5, "r_nelement" => 1, "r_bc" => "periodic", @@ -42,7 +42,7 @@ input_dict = Dict("run_name"=>run_name, "vz_bc" => "periodic", "vz_L" => 4.0, "vz_discretization" => "chebyshev_pseudospectral", - "timestepping" => Dict{String,Any}("nstep" => 1)) + "timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11)) run_moment_kinetics(input_dict) diff --git a/util/precompile_run.jl b/util/precompile_run.jl index d4e16965e..41f6b1d57 100644 --- a/util/precompile_run.jl +++ b/util/precompile_run.jl @@ -3,6 +3,7 @@ using Pkg Pkg.activate(".") using moment_kinetics +using moment_kinetics.type_definitions: OptionsDict # Create a temporary directory for test output test_output_directory = tempname() @@ -10,7 +11,6 @@ mkpath(test_output_directory) base_input = Dict("run_name" => "precompilation", "base_directory" => test_output_directory, - "dt" => 0.0, "r_ngrid" => 5, "r_nelement" => 3, "r_bc" => "periodic", @@ -44,7 +44,7 @@ base_input = Dict("run_name" => "precompilation", "vz_bc" => "zero", "vz_L" => 8.0, "vz_discretization" => "finite_difference", - "timestepping" => Dict{String,Any}("nstep" => 1)) + "timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11)) cheb_input = merge(base_input, Dict("r_discretization" => "chebyshev_pseudospectral", "z_discretization" => "chebyshev_pseudospectral", "vperp_discretization" => "chebyshev_pseudospectral", @@ -66,22 +66,22 @@ for input ∈ [base_input, cheb_input, wall_bc_input, wall_bc_cheb_input] push!(inputs_list, x) end -collisions_input1 = merge(wall_bc_cheb_input, Dict("n_neutral_species" => 0, - "krook_collisions" => Dict{String,Any}("use_krook" => true), - "fokker_planck_collisions" => Dict{String,Any}("use_fokker_planck" => true, "self_collisions" => true, "slowing_down_test" => true), +collisions_input1 = merge(wall_bc_cheb_input, Dict( "composition" => OptionsDict("n_neutral_species" => 0), + "krook_collisions" => OptionsDict("use_krook" => true), + "fokker_planck_collisions" => OptionsDict("use_fokker_planck" => true, "self_collisions" => true, "slowing_down_test" => true), "vperp_discretization" => "gausslegendre_pseudospectral", "vpa_discretization" => "gausslegendre_pseudospectral", )) -collisions_input2 = merge(wall_bc_cheb_input, Dict("n_neutral_species" => 0, - "krook_collisions" => Dict{String,Any}("use_krook" => true), - "fokker_planck_collisions" => Dict{String,Any}("use_fokker_planck" => true, "self_collisions" => true, "slowing_down_test" => true), +collisions_input2 = merge(wall_bc_cheb_input, Dict("composition" => OptionsDict("n_neutral_species" => 0), + "krook_collisions" => OptionsDict("use_krook" => true), + "fokker_planck_collisions" => OptionsDict("use_fokker_planck" => true, "self_collisions" => true, "slowing_down_test" => true), "vperp_discretization" => "gausslegendre_pseudospectral", "vpa_discretization" => "gausslegendre_pseudospectral", "vperp_bc" => "zero-impose-regularity", )) # add an additional input for every geometry option available in addition to the default -geo_input1 = merge(wall_bc_cheb_input, Dict("n_neutral_species" => 0, - "geometry" => Dict{String,Any}("option" => "1D-mirror", "DeltaB" => 0.5, "pitch" => 0.5, "rhostar" => 1.0))) +geo_input1 = merge(wall_bc_cheb_input, Dict("composition" => OptionsDict("n_neutral_species" => 0), + "geometry" => OptionsDict("option" => "1D-mirror", "DeltaB" => 0.5, "pitch" => 0.5, "rhostar" => 1.0))) kinetic_electron_input = merge(cheb_input, Dict("evolve_moments_density" => true, "evolve_moments_parallel_flow" => true, @@ -94,8 +94,8 @@ kinetic_electron_input = merge(cheb_input, Dict("evolve_moments_density" => true "vzeta_nelement" => 1, "vr_ngrid" => 1, "vr_nelement" => 1, - "electron_physics" => "kinetic_electrons", - "electron_timestepping" => Dict{String,Any}("nstep" => 1, + "composition" => OptionsDict("electron_physics" => "kinetic_electrons"), + "electron_timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11, "initialization_residual_value" => 1.0e10, "converged_residual_value" => 1.0e10, diff --git a/util/precompile_run_kinetic-electrons.jl b/util/precompile_run_kinetic-electrons.jl index b605fcf16..212d9f9bf 100644 --- a/util/precompile_run_kinetic-electrons.jl +++ b/util/precompile_run_kinetic-electrons.jl @@ -3,6 +3,7 @@ using Pkg Pkg.activate(".") using moment_kinetics +using moment_kinetics.type_definitions: OptionsDict # Create a temporary directory for test output test_output_directory = tempname() @@ -10,11 +11,10 @@ mkpath(test_output_directory) input = Dict("run_name" => "precompilation", "base_directory" => test_output_directory, - "dt" => 0.0, "evolve_moments_density" => true, "evolve_moments_parallel_flow" => true, "evolve_moments_parallel_pressure" => true, - "electron_physics" => "kinetic_electrons", + "composition" => OptionsDict("electron_physics" => "kinetic_electrons"), "r_ngrid" => 1, "r_nelement" => 1, "r_bc" => "periodic", @@ -48,9 +48,9 @@ input = Dict("run_name" => "precompilation", "vz_bc" => "zero", "vz_L" => 8.0, "vz_discretization" => "chebyshev_pseudospectral", - "timestepping" => Dict{String,Any}("nstep" => 1, + "timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11), - "electron_timestepping" => Dict{String,Any}("nstep" => 1, + "electron_timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11, "initialization_residual_value" => 1.0e10, "converged_residual_value" => 1.0e10, diff --git a/util/precompile_run_long.jl b/util/precompile_run_long.jl index fb80de9d6..441935757 100644 --- a/util/precompile_run_long.jl +++ b/util/precompile_run_long.jl @@ -6,6 +6,7 @@ using Pkg Pkg.activate(".") using moment_kinetics +using moment_kinetics.type_definitions: OptionsDict # Create a temporary directory for test output test_output_directory = tempname() @@ -13,7 +14,6 @@ mkpath(test_output_directory) base_input = Dict("run_name"=>"precompilation", "base_directory" => test_output_directory, - "dt" => 0.0, "z_ngrid" => 5, "z_nelement" => 1, "z_bc" => "periodic", @@ -22,13 +22,13 @@ base_input = Dict("run_name"=>"precompilation", "vpa_nelement" => 1, "vpa_bc" => "periodic", "vpa_discretization" => "finite_difference", - "timestepping" => Dict{String,Any}("nstep" => 1)) + "timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11)) cheb_input = merge(base_input, Dict("z_discretization" => "chebyshev_pseudospectral", "vpa_discretization" => "chebyshev_pseudospectral")) wall_bc_input = merge(base_input, Dict("z_bc" => "wall")) wall_bc_cheb_input = merge(cheb_input, Dict("z_bc" => "wall")) -inputs_list = Vector{Dict{String, Any}}(undef, 0) +inputs_list = Vector{OptionsDict}(undef, 0) for input ∈ [base_input, cheb_input, wall_bc_input, wall_bc_cheb_input] push!(inputs_list, input) x = merge(input, Dict("evolve_moments_density" => true, "ionization_frequency" => 0.0)) diff --git a/util/precompile_run_long_debug1.jl b/util/precompile_run_long_debug1.jl index 3340e140a..dbc009bfa 100644 --- a/util/precompile_run_long_debug1.jl +++ b/util/precompile_run_long_debug1.jl @@ -6,6 +6,7 @@ using Pkg Pkg.activate(".") using moment_kinetics +using moment_kinetics.type_definitions: OptionsDict # Create a temporary directory for test output test_output_directory = tempname() @@ -13,7 +14,6 @@ mkpath(test_output_directory) base_input = Dict("run_name"=>"precompilation", "base_directory" => test_output_directory, - "dt" => 0.0, "z_ngrid" => 5, "z_nelement" => 1, "z_bc" => "periodic", @@ -22,13 +22,13 @@ base_input = Dict("run_name"=>"precompilation", "vpa_nelement" => 1, "vpa_bc" => "periodic", "vpa_discretization" => "finite_difference", - "timestepping" => Dict{String,Any}("nstep" => 1)) + "timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11)) cheb_input = merge(base_input, Dict("z_discretization" => "chebyshev_pseudospectral", "vpa_discretization" => "chebyshev_pseudospectral")) wall_bc_input = merge(base_input, Dict("z_bc" => "wall")) wall_bc_cheb_input = merge(cheb_input, Dict("z_bc" => "wall")) -inputs_list = Vector{Dict{String, Any}}(undef, 0) +inputs_list = Vector{OptionsDict}(undef, 0) for input ∈ [base_input, cheb_input, wall_bc_input, wall_bc_cheb_input] push!(inputs_list, input) x = merge(input, Dict("evolve_moments_density" => true, "ionization_frequency" => 0.0)) diff --git a/util/precompile_run_short.jl b/util/precompile_run_short.jl index fb2ac5109..458cf803f 100644 --- a/util/precompile_run_short.jl +++ b/util/precompile_run_short.jl @@ -3,6 +3,7 @@ using Pkg Pkg.activate(".") using moment_kinetics +using moment_kinetics.type_definitions: OptionsDict # Create a temporary directory for test output test_output_directory = tempname() @@ -10,7 +11,7 @@ mkpath(test_output_directory) input_dict = Dict("run_name"=>"precompilation", "base_directory" => test_output_directory, - "timestepping" => Dict{String,Any}("nstep" => 1)) + "timestepping" => OptionsDict("nstep" => 1, "dt" => 2.0e-11)) to = TimerOutput() run_moment_kinetics(to, input_dict)