Skip to content

Commit

Permalink
Merge branch 'master' into fokker-planck-vperp-bc-experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhardman committed Sep 5, 2024
2 parents 3c076a8 + cc3a2d9 commit 36fb60e
Show file tree
Hide file tree
Showing 145 changed files with 16,837 additions and 4,386 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/debug_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,23 @@ jobs:
version: '1.10'
arch: x64
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
with:
project: 'moment_kinetics/'
- name: Debug test
run: |
cd moment_kinetics
# Hard code the debug level so that we can run without using the
# `--compiled-modules=no` flag, which breaks Symbolics.jl at the
# moment.
sed -i -e "s/_debug_level = get_options.*/_debug_level = 2/" src/debugging.jl
sed -i -e "s/_debug_level = get_options.*/_debug_level = 2/" moment_kinetics/src/debugging.jl
julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary(); using Pkg; Pkg.precompile()'
touch Project.toml
julia --project -O3 --check-bounds=yes -e 'using Pkg; Pkg.add(["MPI", "MPIPreferences", "PackageCompiler", "Symbolics"]); using MPIPreferences; MPIPreferences.use_system_binary()'
julia --project -O3 --check-bounds=yes -e 'using Pkg; Pkg.develop(path="moment_kinetics/"); Pkg.precompile()'
julia --project -O3 --check-bounds=yes precompile.jl --debug 2
# Need to use openmpi so that the following arguments work:
# * `--mca rmaps_base_oversubscribe 1` allows oversubscription (more processes
# than physical cores).
# * `--mca mpi_yield_when_idle 1` changes a setting to prevent excessively
# terrible performance when oversubscribing.
## Don't use --compiled-modules=no for now, as it currently breaks Symbolics.jl
#mpiexec -np 4 --mca rmaps_base_oversubscribe 1 julia --project --check-bounds=yes --compiled-modules=no debug_test/sound_wave_tests.jl --debug 2
mpiexec -np 4 --mca rmaps_base_oversubscribe 1 julia --project --check-bounds=yes debug_test/runtests.jl --debug 2
#mpiexec -np 4 --mca rmaps_base_oversubscribe 1 julia --project --check-bounds=yes --compiled-modules=no moment_kinetics/debug_test/sound_wave_tests.jl --debug 2
mpiexec -np 4 --mca rmaps_base_oversubscribe 1 julia --project -Jmoment_kinetics.so -O3 --check-bounds=yes moment_kinetics/debug_test/runtests.jl --debug 2
6 changes: 5 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ jobs:
touch Project.toml
julia -O3 --project -e 'import Pkg; Pkg.develop(path="moment_kinetics/"); Pkg.add("NCDatasets"); Pkg.precompile()'
# Reduce nstep for each example to 10 to avoid the CI job taking too long
julia -O3 --project -e 'using moment_kinetics; for (root, dirs, files) in walkdir("examples") for file in files if endswith(file, ".toml") filename = joinpath(root, file); println(filename); input = moment_kinetics.moment_kinetics_input.read_input_file(filename); t_input = get(input, "timestepping", Dict{String,Any}()); t_input["nstep"] = 10; t_input["dt"] = 1.0e-10; pop!(input, "z_nelement_local", ""); pop!(input, "r_nelement_local", ""); run_moment_kinetics(input) end end end'
# Note we skip the example `if (occursin("ARK", get(t_input, "type", "") && Sys.isapple())`
# because the way we use MINPACK.jl (needed for nonlinear solvers
# used for implicit parts of timestep) doesn't currently work on
# macOS.
julia -O3 --project -e 'using moment_kinetics; for (root, dirs, files) in walkdir("examples") for file in files if endswith(file, ".toml") filename = joinpath(root, file); println(filename); input = moment_kinetics.moment_kinetics_input.read_input_file(filename); t_input = get(input, "timestepping", Dict{String,Any}()); if (occursin("ARK", get(t_input, "type", "")) && Sys.isapple()) continue end; t_input["nstep"] = 10; t_input["dt"] = 1.0e-12; input["timestepping"] = t_input; pop!(input, "z_nelement_local", ""); pop!(input, "r_nelement_local", ""); electron_t_input = get(input, "electron_timestepping", Dict{String,Any}()); electron_t_input["initialization_residual_value"] = 1.0e8; electron_t_input["converged_residual_value"] = 1.0e8; input["electron_timestepping"] = electron_t_input; nl_solver_input = get(input, "nonlinear_solver", Dict{String,Any}()); nl_solver_input["rtol"] = 1.0e6; nl_solver_input["atol"] = 1.0e6; input["nonlinear_solver"] = nl_solver_input; run_moment_kinetics(input) end end end'
2 changes: 1 addition & 1 deletion .github/workflows/parallel_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
jobs:
test-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 120
timeout-minutes: 150

steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

This file was deleted.

Loading

0 comments on commit 36fb60e

Please sign in to comment.