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

Preparation for adding electrons #207

Merged
merged 42 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
56295a4
Filter out size-1 dimensions from combinations to check in debug tests
johnomotani Mar 15, 2024
32f94d6
Rename 'charged' to 'ion'
johnomotani Apr 26, 2024
4908feb
Separate dissipation parameters for ions, electrons, neutrals (#192)
LucasMontoya4 Mar 28, 2024
9a31241
Fix duplicated calculations in steady state residual check
johnomotani Apr 21, 2024
69271f5
Try-catch in calculate_steady_state_residual() post-proc function
johnomotani Apr 21, 2024
9f22caf
Throw error when assign_endpoint!() fails
johnomotani Apr 26, 2024
f20cb83
Move boundary conditions out of initial_conditions to separate module
johnomotani Apr 26, 2024
8208c54
Include begin_*_region() calls in derivative functions
johnomotani Feb 7, 2024
65675cd
Set debug flags in ldiv!() method for MPIDebugSharedArray
johnomotani Apr 1, 2024
dc11be8
Let value in setindex!() method for DebugMPISharedArray be any Number
johnomotani Apr 7, 2024
c96a360
Save run_id in io_input
johnomotani Feb 17, 2024
5cf7b18
Split I/O for ions and neutrals into separate functions
johnomotani Feb 16, 2024
8aeefda
Write out most recent version of constraints coefficients as diagnostic
johnomotani Mar 11, 2024
d715d63
Refactor krook_collisions, ready for adding collisions for electrons
johnomotani Apr 26, 2024
f0ceee4
Setup fields, advection_structs, scratch_dummy outside setup_time_adv…
johnomotani Apr 27, 2024
f549a3c
Function for setup of time_info struct
johnomotani Apr 27, 2024
57ba127
Add shared-memory scratch arrays to coordinate structs
johnomotani Apr 27, 2024
7443b00
Restore writing of ion distribution function to ascii output files
johnomotani Apr 27, 2024
88e3854
Allow saving/loading when some coordinates are not present
johnomotani Apr 27, 2024
0f7c6d6
Refactor reloading functions
johnomotani Feb 19, 2024
f7eb2e6
Refactor restart - move functionality to functions in utils module
johnomotani Apr 27, 2024
825e438
Fix typo in external_sources docs
johnomotani Mar 25, 2024
8def366
Fix source moments to be compatible with source_type="energy_source"
johnomotani Mar 25, 2024
0f0e41c
Fix typo in docs for source term in neutral moment-kinetic equation
johnomotani Mar 27, 2024
da7ff57
Add 'git' module in setup for Marconi
johnomotani Apr 9, 2024
313d39c
Support selection by `it` for the time variable in title of animations
johnomotani Feb 24, 2024
b68ada7
Fix formatting of docstrings for plot_vs_* and animate_vs_* functions
johnomotani Mar 11, 2024
7fcf37f
Allow passing a `label` kwarg to 1d animation functions
johnomotani Mar 11, 2024
19a0bfc
Make plots of coefficients for moment constraints
johnomotani Mar 11, 2024
538d1df
Fix lookup of dfn vars from makie_post_processing input
johnomotani Mar 23, 2024
45b3aff
Support `it` argument for CFL animations in `timestep_diagnostics()`
johnomotani Mar 25, 2024
442b3ae
Simplify arguments to define_dynamic_dfn_variables!()
johnomotani Apr 27, 2024
421b638
Move moments and pdf structs to moment_kinetics_structs
johnomotani Apr 27, 2024
35fa061
Reload *_constraints_*_coefficient, to avoid using uninitialized values
johnomotani Apr 7, 2024
0fee79f
Type check on coords argument of write_single_value!()
johnomotani Apr 27, 2024
46fb53c
Simplify imports in load_data
johnomotani Apr 27, 2024
7971ba5
Add missing 'return' for extended_moments in load_ion_moments_data()
johnomotani Apr 27, 2024
0c25142
Simplify getting 'per step' values from 'cumulative'
johnomotani Apr 27, 2024
16d46ab
deepcopy() inputs in tests to ensure they are not accidentally modified
johnomotani Apr 27, 2024
f8b629b
Add comments about using ignore_MPI=true argument in tests
johnomotani Apr 27, 2024
780ce0b
Allow `nstep = 0`
johnomotani Apr 2, 2024
7d3a3f7
Fix ascii I/O for the ion distribution function
johnomotani Apr 28, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ makie_postproc.so
plots_postproc.so
precompile-temp
post_processing_input.toml
.DS_Store
4 changes: 2 additions & 2 deletions docs/src/external_sources_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ S_n &= A_n(r,z) \frac{1}{(\pi)^{3/2} (2 T_{\mathrm{source},n} / m_n)^{3/2}} \exp
or in 1V simulations that do not include $v_\perp$, $v_\zeta$, $v_r$ dimensions
```math
\begin{align}
S_i &= A_i(r,z) \frac{1}{sqrt{\pi} \sqrt{2 T_{\mathrm{source},i} / m_i}} \exp\left( -\frac{v_\perp^2}{T_{\mathrm{source},i}} \right) \\
S_n &= A_n(r,z) \frac{1}{sqrt{\pi} \sqrt{2 T_{\mathrm{source},n} / m_n}} \exp\left( -\frac{v_z^2}{T_{\mathrm{source},n}} \right)
S_i &= A_i(r,z) \frac{1}{\sqrt{\pi} \sqrt{2 T_{\mathrm{source},i} / m_i}} \exp\left( -\frac{v_\perp^2}{T_{\mathrm{source},i}} \right) \\
S_n &= A_n(r,z) \frac{1}{\sqrt{\pi} \sqrt{2 T_{\mathrm{source},n} / m_n}} \exp\left( -\frac{v_z^2}{T_{\mathrm{source},n}} \right)
\end{align}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/moment_kinetic_equations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ and for neutrals where several of the ionization terms cancel
& \qquad-\frac{w_{\|,n}}{2}\frac{1}{p_{\|,n}}\left(-\frac{\partial q_{\|,n}}{\partial z}
- R_{in}\left(n_{i}p_{\|,n} - n_{n}p_{\|,i}
- n_{n}n_{i}\left(u_{n} - u_{i}\right)^{2}\right)
+ \int dv_\parallel S_{n} + u_{n}^2\int dv_\parallel v_\parallel^2 S_{n}
+ \int dv_\parallel v_\parallel^2 S_{n} + u_{n}^2\int dv_\parallel S_{n}
+ v_{\mathrm{th},n}w_{\|,n}\frac{\partial p_{\|,n}}{\partial z}\right) \\
& \qquad\left. + \frac{w_{\parallel,n}}{2}\frac{1}{n_{n}}\int dv_\parallel S_{n}
+ \frac{w_{\|,n}^{2}}{2}\frac{v_{\mathrm{th},n}}{n_{n}}\frac{\partial n_{n}}{\partial z}\right]\frac{\partial g_{n}}{\partial w_{\|,n}} \\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ vperp_discretization = "gausslegendre_pseudospectral"
#vzeta_bc = "periodic"
#vzeta_discretization = "chebyshev_pseudospectral"

#[numerical_dissipation]
#[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 0.0
#vperp_dissipation_coefficient = 0.0
#z_dissipation_coefficient = 0.1
Expand Down
2 changes: 1 addition & 1 deletion examples/geometry/1D-mirror.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ vz_L = 18.0
vz_bc = "both_zero"
vz_discretization = "chebyshev_pseudospectral"

[numerical_dissipation]
[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
force_minimum_pdf_value = 0.0
Expand Down
16 changes: 10 additions & 6 deletions examples/gk-ions/2D-periodic-gk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,19 @@ vz_L = 18.0
vz_bc = "both_zero"
vz_discretization = "chebyshev_pseudospectral"

[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
#r_disspipation_coefficient = 1.0e-3
#force_minimum_pdf_value = 0.0

[geometry]
#option="1D-mirror"
DeltaB=0.0
option="constant-helical"
pitch=0.1
rhostar= 0.1

[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
#r_disspipation_coefficient = 1.0e-3
#force_minimum_pdf_value = 0.0

[neutral_numerical_dissipation]
moment_dissipation_coefficient = 0.0001
vz_dissipation_coefficient = 0.01
2 changes: 1 addition & 1 deletion examples/numerical-dissipation/num-diss-relaxation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ nwrite = 2000
nwrite_dfns = 2000
split_operators = false

[numerical_dissipation]
[ion_numerical_dissipation]
vpa_dissipation_coefficient = 0.1
vperp_dissipation_coefficient = 0.1
z_dissipation_coefficient = -1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ z_width = 0.125
source_strength = 2.0
source_T = 2.0

[numerical_dissipation]
[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
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ z_width = 0.125
source_strength = 2.0
source_T = 2.0

[numerical_dissipation]
[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
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ z_width = 0.125
source_strength = 2.0
source_T = 2.0

[numerical_dissipation]
[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
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ z_width = 0.125
source_strength = 2.0
source_T = 2.0

[numerical_dissipation]
[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
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ source_strength = 2.0
source_T = 2.0

[numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-1
#vpa_dissipation_coefficient = 1.0e-2
#vpa_dissipation_coefficient = 1.0e-3
#vz_dissipation_coefficient = 1.0e-1
#vz_dissipation_coefficient = 1.0e-2
#vz_dissipation_coefficient = 1.0e-3
force_minimum_pdf_value = 0.0
6 changes: 5 additions & 1 deletion examples/wall-bc/wall-bc_cheb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ dt = 1.0e-5
nwrite = 1000
split_operators = false

[numerical_dissipation]
[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1
force_minimum_pdf_value = 0.0

[neutral_numerical_dissipation]
#vz_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1
force_minimum_pdf_value = 0.0
6 changes: 5 additions & 1 deletion examples/wall-bc/wall-bc_cheb_split1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ dt = 1.0e-5
nwrite = 1000
split_operators = false

[numerical_dissipation]
[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1
force_minimum_pdf_value = 0.0

[neutral_numerical_dissipation]
#vz_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1
force_minimum_pdf_value = 0.0
6 changes: 5 additions & 1 deletion examples/wall-bc/wall-bc_cheb_split2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ dt = 1.0e-5
nwrite = 1000
split_operators = false

[numerical_dissipation]
[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1
force_minimum_pdf_value = 0.0

[neutral_numerical_dissipation]
#vz_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1
force_minimum_pdf_value = 0.0
6 changes: 5 additions & 1 deletion examples/wall-bc/wall-bc_cheb_split3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ dt = 1.0e-5
nwrite = 1000
split_operators = false

[numerical_dissipation]
[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1
force_minimum_pdf_value = 0.0

[neutral_numerical_dissipation]
#vz_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1
force_minimum_pdf_value = 0.0
2 changes: 1 addition & 1 deletion examples/wall-bc/wall-bc_no-neutrals.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ z_width = 0.125
source_strength = 8.0
source_T = 1.0

[numerical_dissipation]
[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-1
#vpa_dissipation_coefficient = 1.0e-2
#vpa_dissipation_coefficient = 1.0e-3
Expand Down
2 changes: 1 addition & 1 deletion examples/wall-bc/wall-bc_no-neutrals_split1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ z_width = 0.125
source_strength = 8.0
source_T = 1.0

[numerical_dissipation]
[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-1
#vpa_dissipation_coefficient = 1.0e-2
#vpa_dissipation_coefficient = 1.0e-3
Expand Down
2 changes: 1 addition & 1 deletion examples/wall-bc/wall-bc_no-neutrals_split2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ z_width = 0.125
source_strength = 8.0
source_T = 1.0

[numerical_dissipation]
[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-1
#vpa_dissipation_coefficient = 1.0e-2
#vpa_dissipation_coefficient = 1.0e-3
Expand Down
2 changes: 1 addition & 1 deletion examples/wall-bc/wall-bc_no-neutrals_split3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ z_width = 0.125
source_strength = 8.0
source_T = 1.0

[numerical_dissipation]
[ion_numerical_dissipation]
#vpa_dissipation_coefficient = 1.0e-1
#vpa_dissipation_coefficient = 1.0e-2
#vpa_dissipation_coefficient = 1.0e-3
Expand Down
8 changes: 7 additions & 1 deletion examples/wall-bc/wall-bc_volumerecycle.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ active = true
source_type = "recycling"
recycling_controller_fraction = 0.25

[numerical_dissipation]
[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
frequency_option = "reference_parameters"
8 changes: 7 additions & 1 deletion examples/wall-bc/wall-bc_volumerecycle_split1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ active = true
source_type = "recycling"
recycling_controller_fraction = 0.25

[numerical_dissipation]
[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
frequency_option = "reference_parameters"
8 changes: 7 additions & 1 deletion examples/wall-bc/wall-bc_volumerecycle_split2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ active = true
source_type = "recycling"
recycling_controller_fraction = 0.25

[numerical_dissipation]
[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
frequency_option = "reference_parameters"
8 changes: 7 additions & 1 deletion examples/wall-bc/wall-bc_volumerecycle_split3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ active = true
source_type = "recycling"
recycling_controller_fraction = 0.25

[numerical_dissipation]
[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
frequency_option = "reference_parameters"
2 changes: 1 addition & 1 deletion machines/marconi/julia.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module purge
module load env-skl profile/base profile/advanced
module load gnu/7.3.0 openmpi/3.1.4--gnu--7.3.0 intel/pe-xe-2018--binary python/3.9.4
module load gnu/7.3.0 openmpi/3.1.4--gnu--7.3.0 intel/pe-xe-2018--binary python/3.9.4 git/2.17
# Needed because Julia's Cairo library complains about libz<1.2.9
module load zlib/1.2.11--intel--pe-xe-2018--binary

Expand Down
Loading
Loading