Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Kinetic electrons #237

Merged
merged 414 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
414 commits
Select commit Hold shift + click to select a range
a233eeb
Remove unnecessary uses of @views in boundary_conditions.jl
johnomotani Mar 15, 2024
95adbfe
Respect ignore_MPI arg when initializing scratch_shared/scratch_shared2
johnomotani Mar 15, 2024
c3d5c52
Filter out size-1 dimensions from combinations to check in debug tests
johnomotani Mar 15, 2024
6a86f05
Tests must use ignore_MPI=true when loading or defining coordinates
johnomotani Mar 15, 2024
2738d41
Fix restarting when not using kinetic electrons
johnomotani Mar 15, 2024
79e7cf8
Template the type of shared_scratch in coordinate struct
johnomotani Mar 15, 2024
637cddf
Merge remote-tracking branch 'origin/rk45' into electrons-jto-debug
johnomotani Mar 22, 2024
431d0c7
Fix / tidy up initialization of electrons after merge
johnomotani Mar 23, 2024
0ab74bc
Remove commented-out electron initialization code
johnomotani Mar 23, 2024
60b7129
Fix lookup of dfn vars from makie_post_processing input
johnomotani Mar 23, 2024
4089b82
Add select_slice() and select_slice_of_variable() for electron pdf
johnomotani Mar 23, 2024
cbe3e64
Allow passing *.initial_electron.* output files to `get_run_info()`
johnomotani Mar 25, 2024
2422cc4
Timestep and CFL diagnostics for electrons
johnomotani Mar 23, 2024
aaf8e83
Support `it` argument for CFL animations in `timestep_diagnostics()`
johnomotani Mar 25, 2024
87b3f52
Fix "Make vz resolution consistent with vpa in wall+sheath-bc_kinetic…
johnomotani Mar 23, 2024
c9a6aac
Fix typos in `neutral_1V` in `load_data`
johnomotani Mar 23, 2024
3fe5068
Split update of t_params out of adaptive_timestep_update!()
johnomotani Mar 24, 2024
a01d475
Move local_error_norm() to runge_kutta module
johnomotani Mar 25, 2024
5827a42
Define local_error_norm() for 4d array
johnomotani Mar 25, 2024
4ef5c50
Use Runge-Kutta timestepping for electrons
johnomotani Mar 23, 2024
2702ab2
Don't use upwinded derivative in electron_energy_equation!()
johnomotani Mar 27, 2024
13db8b1
Pass all moments to electron_energy_equation!() explicitly as arguments
johnomotani Mar 24, 2024
68fba4a
Remove checks for NaN in electron pdf and ppar
johnomotani Mar 24, 2024
5cb4f24
Plot electron timestep diagnostics for kinetic electron simulations
johnomotani Mar 25, 2024
bbf3cb7
Make copies of `test_input` Dicts in tests
johnomotani Mar 24, 2024
fc6293f
Fix typo in external_sources docs
johnomotani Mar 25, 2024
fd6ec3d
Only use ppar from fvec_in in electron KE when evolving ppar
johnomotani Mar 25, 2024
3dcfc6a
Relabel 'residual' to 'pdf_out' in add_contribution_from_pdf_term!()
johnomotani Mar 25, 2024
115194f
Separate dissipation parameters for ions, electrons, neutrals (#192)
LucasMontoya4 Mar 28, 2024
54dd837
Fix source moments to be compatible with source_type="energy_source"
johnomotani Mar 25, 2024
d68cd4d
Fix typo in docs for source term in neutral moment-kinetic equation
johnomotani Mar 27, 2024
14c0f2d
Implement external sources for electrons in the same way as for ions
johnomotani Mar 25, 2024
fcc6ea8
Simplify post-processing of 'per-step' from 'cumulative' variable
johnomotani Mar 25, 2024
6088934
Fix per-step values when post-processing restarted simulation
johnomotani Mar 25, 2024
d04c6d8
Better error messages when `iv0` cannot be found
johnomotani Mar 26, 2024
8d691d2
2-step initialization of electron pdf
johnomotani Mar 27, 2024
f5bf19f
Finish removing upwinded derivative in electron energy equation
johnomotani Mar 28, 2024
e776675
Simplify arguments to calculate_electron_qpar!()
johnomotani Mar 28, 2024
f991c7e
Simplify arguments to update_electron_pdf!()
johnomotani Mar 28, 2024
59ee104
Include update of electron distribution function in ion/neutral time …
johnomotani Mar 28, 2024
f52d545
Add electron quantities to standard post-processing
johnomotani Mar 28, 2024
a0989f8
Merge branch 'electrons-jto-debug' into electrons-jto-debug-adaptive-…
johnomotani Mar 28, 2024
79f613c
Add electron_ppar to error check used for adaptive timestep control
johnomotani Mar 28, 2024
75c911b
Better info print for electron timestep diagnostics post-processing
johnomotani Mar 28, 2024
882c414
step_counter[] for electrons tracks global number of pseudo-timesteps
johnomotani Mar 28, 2024
04628d4
Distinguish electrons/ions in adaptive timestep diagnostic print
johnomotani Mar 28, 2024
0ae774b
Fix post-proc calculation of 'electron_temperature'
johnomotani Mar 28, 2024
7303db9
Increase dissipation, use adaptive timestepping in wall+sheath-bc_kin…
johnomotani Mar 28, 2024
c69b350
More example input files for kinetic electrons
johnomotani Mar 28, 2024
ee8f7fd
Fix call to calculate_electron_qpar!() when not restarting
johnomotani Mar 28, 2024
864bd0b
Distributed-MPI support for in kinetic electrons
johnomotani Mar 28, 2024
55f1ef6
Merge branch 'improve-debug-distributed-mpi' into electrons-jto-debug
johnomotani Mar 31, 2024
4d135fd
Merge branch 'rk45' into 'electrons-jto-debug'
johnomotani Apr 6, 2024
5f0ee51
Initialize several arrays to avoid errors from debug checks
johnomotani Mar 31, 2024
41d5e98
Fix shared-memory usage in electron_adaptive_timestep_update!()
johnomotani Mar 31, 2024
a27706e
Initialise electron moments and pdf before they are used
johnomotani Mar 31, 2024
dc16805
Better status prints from kinetic electrons with distributed MPI
johnomotani Mar 31, 2024
fea1499
Set debug flags in ldiv!() method for MPIDebugSharedArray
johnomotani Apr 1, 2024
fdbeafc
Allow `nstep = 0`
johnomotani Apr 2, 2024
7a5aa6a
Set electrons t_params.next_output_time[] when not doing initial output
johnomotani Apr 2, 2024
79303fd
Do bounds checks in electron boundary condition
johnomotani Apr 2, 2024
f22dec2
Set `restart_had_kinetic_electrons` on all processes
johnomotani Apr 2, 2024
d5488a0
Move `using Quadmath` from moment_kinetics_input to time_advance
johnomotani Apr 2, 2024
a5c3242
Check that t_params.dt[] does not become NaN
johnomotani Apr 6, 2024
052e8de
Only activate electron sources when electrons are Brakinskii or kinetic
johnomotani Apr 6, 2024
fb74655
Set region type in external_electron_source_controller() function
johnomotani Apr 6, 2024
591c2a3
Debug tests for kinetic electrons
johnomotani Apr 6, 2024
e8f60a2
Add input option to skip possibly restarting for kinetic electron init
johnomotani Apr 6, 2024
7b623a6
Shared-mem fix for dfns_output_times for electrons
johnomotani Apr 6, 2024
c01cb4d
Let value in setindex!() method for DebugMPISharedArray be any Number
johnomotani Apr 7, 2024
d2d58eb
Reload dSdt when restarting
johnomotani Apr 7, 2024
8fab804
Reload *_constraints_*_coefficient, to avoid using uninitialized values
johnomotani Apr 7, 2024
a9b0f25
Zero-initialize moments.electron.temp
johnomotani Apr 7, 2024
a129274
Fix region type when updating electron_ppar
johnomotani Apr 7, 2024
e79a1e3
When ion timestep fails, reset electron pdf to its value before the step
johnomotani Apr 7, 2024
51e5f91
Fix communication of delta_phi when calculating phi from Epar
johnomotani Apr 8, 2024
15b0222
Make kinetic-electron debug test have 'failed' timesteps
johnomotani Apr 8, 2024
ec20a22
Remove debug write-out of 'dt' in runge_kutta
johnomotani Apr 8, 2024
35b3be8
Make coordinate arguments to define_io_coordinates!() optional
johnomotani Apr 8, 2024
9ad08ba
Add option for 'debug I/O' for electrons
johnomotani Apr 8, 2024
0ae14c1
Add 'git' module in setup for Marconi
johnomotani Apr 9, 2024
7bb15d6
Update post-processing to work with 'electron_debug' files
johnomotani Apr 9, 2024
03a660e
Print 'ion step' debug message
johnomotani Apr 10, 2024
ff230a8
Move rk_update_variable!() for ppar later in loop
johnomotani Apr 15, 2024
6ab1402
Increment t_params.step_counter[] on iteration where electrons converge
johnomotani Apr 15, 2024
ebf7014
Create output_dir at the earliest possible point
johnomotani Apr 15, 2024
1463468
Save/load FFTW wisdom from rank-0
johnomotani Apr 15, 2024
bbfa307
Support "Save/load FFTW wisdom from rank-0" in electron functions
johnomotani Apr 15, 2024
b8ce72b
Fix output time logic
johnomotani Apr 12, 2024
560b4c6
Speed up debug I/O
johnomotani Apr 16, 2024
0936b5a
Fix duplicated calculations in steady state residual check
johnomotani Apr 21, 2024
bac49f2
Enforce sheath-edge bc on electron qpar when using Braginskii electrons
johnomotani Apr 17, 2024
5baf19a
Try-catch in calculate_steady_state_residual() post-proc function
johnomotani Apr 21, 2024
8b474e1
Fix restarting using fixed (non-adaptive) timestep
johnomotani Apr 21, 2024
e93276e
Fix synchronization when not using MPI in mk_input()
johnomotani Apr 21, 2024
ec176c1
Fix 'braginskii_fluid' electron option
johnomotani Apr 21, 2024
1473a7a
Utility function to get an enum value from a String
johnomotani Apr 22, 2024
8d4610c
Tidy up electron_physics handling when restarting
johnomotani Apr 22, 2024
1781f1a
Reset dt when restarting braginskii_fluid from other electron physics
johnomotani Apr 22, 2024
ef9b1c5
Merge branch 'rk45' into electrons-jto-debug
johnomotani Apr 23, 2024
d45d137
Merge branch 'fftw-plan-consistency' into electrons-jto-debug
johnomotani Apr 23, 2024
a0b941e
Remove unnecessary arguments in load_data
johnomotani Apr 23, 2024
47b646f
Don't recalculate electron pdf after failed ion timestep
johnomotani Apr 23, 2024
04940b6
Merge branch 'rk45' into electrons-jto-debug
johnomotani Apr 25, 2024
ec354e8
Fix merge of Krook collisions - update ee and ei collision setup
johnomotani Apr 25, 2024
7b4d8f9
Fix pressure flooring in update_electron_vth_temperature!()
johnomotani Apr 26, 2024
30fcfe9
Fix wall+sheath-bc_kinetic.toml
johnomotani Apr 26, 2024
30a3d5f
Fix coordinate loading from NetCDF files
johnomotani Apr 26, 2024
9be23e7
Fix formatting in assign_endpoint!()
johnomotani Apr 26, 2024
04e6984
Merge branch 'pre-electron-updates' into electrons-jto-debug
johnomotani Apr 27, 2024
233a61d
Merge branch 'imex' into HEAD
johnomotani Jun 12, 2024
7f93278
Better error message for negative timestep from step to output
johnomotani May 30, 2024
25bba75
Support fixed-step-count output for kinetic electrons
johnomotani May 31, 2024
5a7d193
Separate `scratch_electron` struct for electron pseudo-timestepping
johnomotani May 30, 2024
881a748
Fix merge of 'imex' and 'electrons'
johnomotani May 30, 2024
11dd922
Fix electron dt when restarting from a run without kinetic electrons
johnomotani May 29, 2024
d8cfa26
New method to apply boundary conditions with constraints to electron pdf
johnomotani May 29, 2024
3d3b87a
Add kinetic electron case to precompilation runs inputs
johnomotani May 31, 2024
3167e0d
Always reset ion timestep when electron model changes
johnomotani May 31, 2024
5e91466
Do not overwrite boundary values when calculating phi from Epar
johnomotani Jun 1, 2024
d91c356
Don't set `next_output_time[]` for electrons when not doing electron I/O
johnomotani Jun 1, 2024
e6afaec
Refactor adaptive timestep I/O times
johnomotani Jun 1, 2024
d19089e
Update electrons for refactored adaptive timestep I/O times
johnomotani Jun 1, 2024
d14be83
Do not adjust adaptive electron timestep for I/O times after init
johnomotani Jun 1, 2024
fc10735
Make plots for electron dudz, dpdz and dqdz
johnomotani Jun 1, 2024
eec97d3
Bounds checks in kinetic electron boundary condition
johnomotani Jun 2, 2024
c5baa99
Fix parallelisation of electron I/O
johnomotani Jun 2, 2024
af87dca
Reload phi when restarting
johnomotani Jun 2, 2024
d806cca
Reduce initial temperature for kinetic electron simulation
johnomotani Jun 2, 2024
ed8a353
Decrease T_e in boltzmann run to restart kinetic electrons from
johnomotani Jun 2, 2024
c486a28
Fix from merge of electrons and imex for timestep diagnostics
johnomotani Jun 3, 2024
0c454f1
Electron time advance applies boundary conditions in timestep error
johnomotani Jun 6, 2024
6348968
Wall plots for electron pdf
johnomotani Jun 3, 2024
bfd86c1
Fix restarting of electron initialisation
johnomotani Jun 3, 2024
05648ae
Fix factors of me_over_mi in electron external source term
johnomotani Jun 4, 2024
229660e
No ion implicit options in electron timestepping input
johnomotani Jun 4, 2024
3b9a54a
Ensure parallel_friction is always initialised
johnomotani May 6, 2024
5116852
Use correct RK-stage-updated variables for electron qpar bc
johnomotani May 7, 2024
16a570a
Fix Braginskii electron restart from Boltzmann
johnomotani Jun 5, 2024
57c2411
Implicit solve for Braginskii electron conduction, when using an IMEX…
johnomotani May 5, 2024
3ff6111
Example input file using IMEX solver
johnomotani May 7, 2024
282c3ae
Allow periodic boundary conditions for Braginskii electrons
johnomotani Jun 6, 2024
ea239d8
Example with Braginskii electrons in periodic domain
johnomotani Jun 6, 2024
12bd861
Function to load electron moments data
johnomotani Jun 4, 2024
ee39217
Test case with Braginskii electrons
johnomotani May 8, 2024
7c8b2e0
Do not do kinetic electron solve for lower-order RK solution
johnomotani Jun 7, 2024
8359bb7
If electron solve takes too many iterations, trigger timestep failure
johnomotani Jun 7, 2024
ebd7a4b
Fix local error norm for electron distribution function
johnomotani Jun 7, 2024
a13e215
Comment out check for qpar_updated[] in calculate_electron_qpar!()
johnomotani Jun 7, 2024
67c459e
Update moments.electron.dens and moments.electron.upar
johnomotani Jun 7, 2024
3cfc8d5
Reset electron pdf before resetting moments when timestep fails
johnomotani Jun 7, 2024
df01251
Decrease max_electron_pdf_iterations to 1000
johnomotani Jun 7, 2024
97fdfd4
Use max_increase_factor_near_last_fail in kinetic electron example input
johnomotani Jun 7, 2024
864eb2e
Fix post-processing for failure caused by kinetic electrons diagnostic
johnomotani Jun 7, 2024
b226299
Save whole `io_input` into I/O structs and info-Tuples
johnomotani Jun 11, 2024
251c9e6
Write output from scratch_pdf, instead of pdf_struct and moments_struct
johnomotani Jun 11, 2024
301fc6b
Allow output of Enum values by converting them to Strings
johnomotani Jun 11, 2024
0708a21
Use set_defaults_and_check_section!() to read [output] settings
johnomotani Jun 11, 2024
c9fe382
If an 'io variable' is `nothing`, just skip it
johnomotani Jun 11, 2024
e62bff8
Option to write out info for error and/or steady state diagnostics
johnomotani Jun 11, 2024
2a60c24
Save size of the last timestep before each output
johnomotani Jun 11, 2024
10d5397
Post-process diagnostics for timestep error and steady state residual
johnomotani Jun 11, 2024
6bbe188
Allow z-periodic boundary conditions for kinetic electrons
johnomotani Jun 12, 2024
7a4452b
Example kinetic electron simulation in 1D periodic box
johnomotani Jun 12, 2024
6802613
Example periodic inputs for Boltzmann and non-IMEX Braginskii
johnomotani Jun 19, 2024
d2e0d24
Delay overwriting of scratch_electron[1]
johnomotani Jun 13, 2024
9c7d28d
Treat initial_electron restarts separately in get_run_info_no_setup()
johnomotani Jun 15, 2024
9f828fd
Functions to get or modify an attribute's value in an HDF5 or NetCDF …
johnomotani Jun 20, 2024
58df6ef
Record whether pdf_electron converged in *.initial_electron.h5
johnomotani Jun 20, 2024
08c626b
Fix region in distributed_dot_s_r_z_vperp_vpa()
johnomotani Jun 20, 2024
850fe09
Move creation of scratch_dummy back into setup_time_advance!()
johnomotani Jun 20, 2024
31636db
Functions in nonlinear_solvers for kinetic electron implicit solve
johnomotani Jun 20, 2024
b199e6d
Implicit solve for kinetic electron distribution function and ppar
johnomotani Jun 20, 2024
0a91f1f
Example input file for implicit kinetic electron solve in periodic box
johnomotani Jun 20, 2024
8ffa6dc
Initialise kinetic electron pdf using implicit solve
johnomotani Jun 20, 2024
75e6c96
Apply bc and constraints to f_new in implicit electron solve
johnomotani Jun 21, 2024
51916c8
Calculate electron moment derivatives at start of electron implicit s…
johnomotani Jun 21, 2024
4a99612
Apply bcs and constraints to residual in implicit electron solve
johnomotani Jun 21, 2024
9b1f9f2
Merge branch 'master' into imex-merge-master
johnomotani Jun 29, 2024
23e7b69
stage maxwell diffusion operator first draft. Works for neutrals and …
LucasMontoya4 Jun 23, 2024
a9d2a2a
Fix reference collision frequency for Maxwell diffusion
johnomotani Jun 26, 2024
6700a0d
Fix "energy" option for external_sources
johnomotani Jun 26, 2024
4f5f581
Disable neutral 'Maxwell diffusion' when using "reference_parameters"
johnomotani Jun 26, 2024
009e738
Fix v-space bc for Maxwell-diffusion
johnomotani Jun 29, 2024
c7eed6e
Attempted fix - use scratch3 instead of scratch in second_derivative!()
johnomotani Jun 29, 2024
664c390
Fix nspecies when loading ion or neutral distribution functions
johnomotani Jun 29, 2024
8aa7e1e
Hacky conversion to Mousseau's 'collision operator'
johnomotani Jun 29, 2024
aefc278
Implicit solve option for Maxwell diffusion
johnomotani Jun 29, 2024
6b581a6
In nonlinear solve, always do at least one Newton iteration
johnomotani Jun 29, 2024
66f46fb
Merge remote-tracking branch 'origin/electrons-jto-debug-improve-bc' …
johnomotani Jul 1, 2024
7b2c84a
Fix merge of Maxwell diffusion and kinetic electrons
johnomotani Jul 1, 2024
6c228d7
Simplify ion sheath entrance boundary condition
johnomotani Jul 7, 2024
a2bb5d8
Modify constraint enforcement in ion sheath entrance bc
johnomotani Jul 7, 2024
fb09eb5
Fix external source, source_type="energy"
johnomotani Jul 7, 2024
4f00132
Fix initialize_electrons!() when not evolving kinetic electrons
johnomotani Jul 7, 2024
b81e522
Move collision_frequency_ei, collision_frequency_ee to electron_momen…
johnomotani Jul 7, 2024
d068802
Diagnostics for total energy and total energy flux
johnomotani Jul 7, 2024
339213e
Ensure correct error estimate can be calculated when writing after a …
johnomotani Jul 7, 2024
c8486db
When using t_params.write_after_fixed_step_count, stop after nstep steps
johnomotani Jul 7, 2024
81d1e21
Set bcs on loworder pdfs using highorder moments
johnomotani Jul 7, 2024
d8c5b79
Ignore error from first/last non-zero point on ion bc
johnomotani Jul 7, 2024
39814a3
Plot CFL limits on a log scale
johnomotani Jul 8, 2024
df396b6
Set number of BLAS threads to 1 to avoid oversubcribing processors
johnomotani Jul 12, 2024
4eb97f9
Fix Jacobian-vector product for updated error tolerances
johnomotani Jul 16, 2024
adee5d7
Fix "Fix post-processing for failure caused by kinetic electrons diag…
johnomotani Jul 16, 2024
ac7f0a3
Normalise grid to initial_temperature while initialising f_neutral
johnomotani Jul 16, 2024
c277d2a
Fix neutral wall plots for case when vz is not identical to vpa
johnomotani Jul 17, 2024
615b25e
Allow different vpa and vz grids in 1V simulations
johnomotani Jul 18, 2024
139e8b7
Handle error when loading data in plots_for_variable()
johnomotani Jul 19, 2024
9ddc035
Store time or pseudo-time in t_params structs
johnomotani Jul 19, 2024
4130235
Use electron_cumulative_pseudotime to postprocess electron_average_su…
johnomotani Jul 19, 2024
fec2bef
Use correct advection structs for electron solves
johnomotani Jul 22, 2024
1eb2ff4
Correction to setting of apply_bc_constraints for IMEX schemes
johnomotani Jul 22, 2024
77e058c
Use moments_output_counter/dfns_output_counter consistently
johnomotani Jul 23, 2024
a146f25
Implicit solve for electron_ppar as part of electron pseudo-timestepping
johnomotani Jul 22, 2024
5223297
Fix titles in comparison plot animations
johnomotani Jul 23, 2024
80ad00a
Fix post-processing electron moment gradients when `ir` is an integer
johnomotani Jul 23, 2024
c0d14b0
Use `calculate_electron_moment_derivatives!()` in `update_electron_pd…
johnomotani Jul 23, 2024
bf8fe31
Allow keyboard interrupt to actually stop `makie_post_process()`
johnomotani Jul 26, 2024
8734517
Fix output counters when simulation is stopped with `stopnow`
johnomotani Jul 26, 2024
d37226e
Rename vmax->vcut in electron sheath entrance boundary condition
johnomotani Jul 27, 2024
0651621
Apply moment corrections to 'reflected' part of electron f at sheath
johnomotani Jul 28, 2024
aa2654e
Impose reversed f before constraint corrections in electron sheath bc
johnomotani Jul 28, 2024
4fd0701
Use fixed, small tolerance for Newton iteration in electron sheath bc
johnomotani Jul 29, 2024
dec970c
Don't measure electron sheath bc Newton tolerance relative to u_over_vt
johnomotani Jul 29, 2024
1596e81
Diagnostic for number of electron steps per ion step
johnomotani Jul 29, 2024
3b67b6d
Avoid array copy when broadcasting in calculate_phi_from_Epar!()
johnomotani Jul 29, 2024
ec82cd9
Limit 'sim time' for each electron solve, not number of iterations
johnomotani Jul 30, 2024
18b42f1
Option to use electron temperature equation in kinetic electron sims
johnomotani Jul 30, 2024
eebe4fc
Update example kinetic electron input file
johnomotani Jul 25, 2024
309cd96
Revert "Implicit solve option for Maxwell diffusion"
johnomotani Jul 31, 2024
7c5f926
Revert "Hacky conversion to Mousseau's 'collision operator'"
johnomotani Jul 31, 2024
dd643a1
Add scratch8 and scratch9 buffers to `coordinate` struct
johnomotani Jul 31, 2024
da8088c
Limit electron timestep when using `ion_dt` for implicit electron_ppar
johnomotani Jul 31, 2024
47d8389
Remove redundant computation of `moments.electron.dqpar_dz`
johnomotani Jul 31, 2024
4b7537d
Merge branch 'master' into electrons
johnomotani Jul 31, 2024
2fd62a3
Update some test expected outputs
johnomotani Jul 31, 2024
f55623c
Update examples CI job to handle kinetic electron inputs
johnomotani Jul 31, 2024
4bd1daa
Remove debug print statements
johnomotani Aug 1, 2024
705642b
Skip Braginskii-IMEX test on macOS because MINPACK.jl is broken
johnomotani Aug 1, 2024
b7e2b6d
Remove incorrect, unused line from parallel_delta_x_calc_r_z_vperp_vpa()
johnomotani Aug 1, 2024
9f460cb
Fix Braginskii electrons test to work with distributed MPI
johnomotani Aug 1, 2024
7684680
Fix loading of diagnostic variables when not using parallel_io
johnomotani Aug 1, 2024
5502571
Fix kinetic electron options in precompile run
johnomotani Aug 2, 2024
2d2156e
Fix recycling_fraction debug test for new neutral initialisation
johnomotani Aug 2, 2024
df1c97f
Compile system image to speed up 'debug_checks' CI job
johnomotani Aug 2, 2024
1816d44
Fix loading of electron moment variables from 'distributed' output files
johnomotani Aug 7, 2024
7ffae2c
Install `Symbolics` in 'debug checks' CI job
johnomotani Aug 7, 2024
a9c7c59
Include kinetic electron tests when running all debug checks
johnomotani Aug 7, 2024
94010a8
Merge branch 'master' into electrons
johnomotani Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
91 changes: 91 additions & 0 deletions examples/kinetic-electrons/periodic_split3_boltzmann.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#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
nu_ei = 1000.0
r_ngrid = 1
r_nelement = 1
z_ngrid = 17
z_nelement = 16
#z_nelement_local = 16
z_bc = "periodic"
z_discretization = "chebyshev_pseudospectral"
vpa_ngrid = 6
vpa_nelement = 31
vpa_L = 12.0
vpa_bc = "zero"
vpa_discretization = "chebyshev_pseudospectral"
vz_ngrid = 6
vz_nelement = 31
vz_L = 12.0
vz_bc = "zero"
vz_discretization = "chebyshev_pseudospectral"

[timestepping]
type = "Fekete4(3)"
nstep = 1000000
dt = 1.0e-6
minimum_dt = 1.0e-7
rtol = 1.0e-7
nwrite = 10000
nwrite_dfns = 100000
steady_state_residual = true
converged_residual_value = 1.0e-3

[nonlinear_solver]
nonlinear_max_iterations = 100
#rtol = 1.0e-9
#atol = 1.0e-12

[ion_numerical_dissipation]
vpa_dissipation_coefficient = 1.0e0
force_minimum_pdf_value = 0.0

[neutral_numerical_dissipation]
vz_dissipation_coefficient = 1.0e-1
force_minimum_pdf_value = 0.0

[krook_collisions]
use_krook = true
110 changes: 110 additions & 0 deletions examples/kinetic-electrons/periodic_split3_braginskii-IMEX.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#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
nu_ei = 1000.0
r_ngrid = 1
r_nelement = 1
z_ngrid = 17
z_nelement = 16
#z_nelement_local = 16
z_bc = "periodic"
z_discretization = "chebyshev_pseudospectral"
vpa_ngrid = 6
vpa_nelement = 31
vpa_L = 12.0
vpa_bc = "zero"
vpa_discretization = "chebyshev_pseudospectral"
vz_ngrid = 6
vz_nelement = 31
vz_L = 12.0
vz_bc = "zero"
vz_discretization = "chebyshev_pseudospectral"

[timestepping]
type = "KennedyCarpenterARK324"
implicit_ion_advance = false
implicit_vpa_advection = false
implicit_braginskii_conduction = true
nstep = 1000000
dt = 1.0e-6
minimum_dt = 1.0e-7
rtol = 1.0e-7
nwrite = 10000
nwrite_dfns = 100000
steady_state_residual = true
converged_residual_value = 1.0e-3
#[timestepping]
#type = "KennedyCarpenterARK324"
#implicit_ion_advance = false
#implicit_vpa_advection = false
#implicit_braginskii_conduction = true
#nstep = 1000000
#dt = 1.0e-6
#minimum_dt = 1.0e-7
#rtol = 1.0e-7
#nwrite = 100
#nwrite_dfns = 100
#steady_state_residual = true
#converged_residual_value = 1.0e-3
#write_after_fixed_step_count = true
#write_error_diagnostics = true
#write_steady_state_diagnostics = true

[nonlinear_solver]
nonlinear_max_iterations = 100
#rtol = 1.0e-9
#atol = 1.0e-12

[ion_numerical_dissipation]
vpa_dissipation_coefficient = 1.0e0
force_minimum_pdf_value = 0.0

[neutral_numerical_dissipation]
vz_dissipation_coefficient = 1.0e-1
force_minimum_pdf_value = 0.0

[krook_collisions]
use_krook = true
104 changes: 104 additions & 0 deletions examples/kinetic-electrons/periodic_split3_braginskii.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#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
nu_ei = 1000.0
r_ngrid = 1
r_nelement = 1
z_ngrid = 17
z_nelement = 16
#z_nelement_local = 16
z_bc = "periodic"
z_discretization = "chebyshev_pseudospectral"
vpa_ngrid = 6
vpa_nelement = 31
vpa_L = 12.0
vpa_bc = "zero"
vpa_discretization = "chebyshev_pseudospectral"
vz_ngrid = 6
vz_nelement = 31
vz_L = 12.0
vz_bc = "zero"
vz_discretization = "chebyshev_pseudospectral"

[timestepping]
type = "Fekete4(3)"
nstep = 1000000
dt = 1.0e-6
minimum_dt = 1.0e-9
rtol = 1.0e-7
nwrite = 10000
nwrite_dfns = 100000
steady_state_residual = true
converged_residual_value = 1.0e-3
#[timestepping]
#type = "Fekete4(3)"
#nstep = 1000000
#dt = 1.0e-6
#minimum_dt = 1.0e-9
#rtol = 1.0e-7
#nwrite = 1000
#nwrite_dfns = 1000
#steady_state_residual = true
#converged_residual_value = 1.0e-3
#write_after_fixed_step_count = true
#write_error_diagnostics = true
#write_steady_state_diagnostics = true

[nonlinear_solver]
nonlinear_max_iterations = 100
#rtol = 1.0e-9
#atol = 1.0e-12

[ion_numerical_dissipation]
vpa_dissipation_coefficient = 1.0e0
force_minimum_pdf_value = 0.0

[neutral_numerical_dissipation]
vz_dissipation_coefficient = 1.0e-1
force_minimum_pdf_value = 0.0

[krook_collisions]
use_krook = true
Loading
Loading