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

Ion braginskii fluid #263

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e6676ef
Update naming of update_qpar for ions to be update_ion_qpar, in line …
LucasMontoya4 Sep 18, 2024
53a673c
Add ion_physics flag to determine drift_kinetic, gyrokinetic or bragi…
LucasMontoya4 Sep 18, 2024
6f6df74
Update gyrokinetic flag uses throughout the repo, so that instead of …
LucasMontoya4 Sep 18, 2024
e92dc5c
Some of the Braginskii functionality (unfinished)
LucasMontoya4 Sep 19, 2024
f92f20f
Merge branch 'master' into ion_flags
LucasMontoya4 Sep 19, 2024
a0e2b20
Merge branch 'ion_flags' into ion_braginskii_fluid
LucasMontoya4 Sep 19, 2024
1dbf661
Make initialisation for braginskii ion heat flux be calculated from u…
LucasMontoya4 Sep 19, 2024
77a30c1
Merge branch 'master' into ion_braginskii_fluid
LucasMontoya4 Sep 19, 2024
3b9bc66
Add braginskii heat flux formula by adding an ion dT_dz component in …
LucasMontoya4 Sep 20, 2024
1d8b559
add loop to allow n_neutral_species = 0 and CFL plots to still be mad…
LucasMontoya4 Sep 20, 2024
bb64609
Merge branch 'master' into ion_braginskii_fluid
LucasMontoya4 Sep 20, 2024
77cce1a
Move order of krook_collisions.jl inclusion to allow velocity_moments…
LucasMontoya4 Sep 20, 2024
18cd33e
Add plotting for collisionality (comparing gradient scale lengths to …
LucasMontoya4 Sep 21, 2024
9a1e30a
Add comparison plots functionality for collisionality_plots, and add …
LucasMontoya4 Sep 23, 2024
0e28693
Add comments to boundary condition of braginskii heat flux, and add d…
LucasMontoya4 Sep 23, 2024
5ef19bd
Fix bug during restarts to allow for multiple sources while external_…
LucasMontoya4 Sep 23, 2024
4213c52
Make collisionality_plots plot the last timestep value (which was ori…
LucasMontoya4 Sep 23, 2024
6fc4c76
Merge branch 'master' into ion_braginskii_fluid
LucasMontoya4 Sep 23, 2024
14e510d
Merge branch 'master' into ion_braginskii_fluid
johnomotani Sep 26, 2024
701ab84
Add option of overlaying what the Braginskii heat flux would be for t…
LucasMontoya4 Sep 27, 2024
0e6d395
Add option for super Gaussian with decay of 4th power instead of seco…
LucasMontoya4 Sep 27, 2024
b2b001d
Merge branch 'master' into ion_braginskii_fluid
LucasMontoya4 Sep 27, 2024
9d92ca2
Fix typo when energy source used
LucasMontoya4 Sep 28, 2024
fab3f8a
Don't plot braginskii overlay if the original simulation itself was a…
LucasMontoya4 Sep 30, 2024
8e5ecd9
Add string to braginskii_overlay system to tell you its an overlay, w…
LucasMontoya4 Oct 1, 2024
78bf27e
Merge branch 'ion_braginskii_fluid' of github.com:mabarnes/moment_kin…
LucasMontoya4 Oct 1, 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
2 changes: 1 addition & 1 deletion examples/gk-ions/2D-periodic-gk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ discretization = "chebyshev_pseudospectral"
n_ion_species = 1
n_neutral_species = 0
electron_physics = "boltzmann_electron_response"
gyrokinetic_ions = true
ion_physics = "gyrokinetic_ions"
T_e = 1.0
T_wall = 1.0

Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion moment_kinetics/debug_test/gyroaverage_inputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_input = OptionsDict(
"output" => OptionsDict("run_name" => "gyroaverage"),
"composition" => OptionsDict("n_ion_species" => 1,
"n_neutral_species" => 0,
"gyrokinetic_ions" => true,
"ion_physics" => "gyrokinetic_ions",
"T_e" => 1.0,
"T_wall" => 1.0),
"evolve_moments" => OptionsDict("density" => false,
Expand Down
2 changes: 1 addition & 1 deletion moment_kinetics/src/em_fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function update_phi!(fields, fvec, vperp, z, r, composition, collisions, moments
end

# get gyroaveraged field arrays for distribution function advance
gkions = composition.gyrokinetic_ions
gkions = composition.ion_physics == gyrokinetic_ions
if gkions
gyroaverage_field!(fields.gphi,fields.phi,gyroavs,vperp,z,r,composition)
gyroaverage_field!(fields.gEz,fields.Ez,gyroavs,vperp,z,r,composition)
Expand Down
5 changes: 4 additions & 1 deletion moment_kinetics/src/external_sources.jl
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ function get_source_profile(profile_type, width, relative_minimum, coord)
L = coord.L
return @. (1.0 - relative_minimum) * exp(-(x+0.5*L) / width) + relative_minimum +
(1.0 - relative_minimum) * exp(-(0.5*L-x) / width) + relative_minimum
elseif profile_type == "super_gaussian_4"
x = coord.grid
return @. (1.0 - relative_minimum) * exp(-(x / width)^4) + relative_minimum
else
error("Unrecognised source profile type '$profile_type'.")
end
Expand Down Expand Up @@ -468,7 +471,7 @@ function initialize_external_source_amplitude!(moments, external_source_settings
if moments.evolve_ppar
@loop_r_z ir iz begin
moments.ion.external_source_pressure_amplitude[iz,ir,index] =
(0.5 * ion_source.source_T +
(0.5 * ion_source_settings[index].source_T +
moments.ion.upar[iz,ir]^2 - moments.ion.ppar[iz,ir]) *
ion_source_settings[index].source_strength *
ion_source_settings[index].r_amplitude[ir] *
Expand Down
3 changes: 2 additions & 1 deletion moment_kinetics/src/gyroaverages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using ..type_definitions: mk_float, mk_int
using ..array_allocation: allocate_float, allocate_shared_float
using ..array_allocation: allocate_int, allocate_shared_int
using ..lagrange_polynomials: lagrange_poly
using ..input_structs: gyrokinetic_ions
using ..looping
using ..communication: MPISharedArray, comm_block, _block_synchronize

Expand All @@ -39,7 +40,7 @@ other nonzero boundary conditions for the z and r domains.
"""

function init_gyro_operators(vperp,z,r,gyrophase,geometry,composition;print_info=false)
gkions = composition.gyrokinetic_ions
gkions = composition.ion_physics == gyrokinetic_ions
if !gkions
gyromatrix = allocate_shared_float(1,1,1,1,1,1)
gyroloopsizes = allocate_shared_int(1,1,1,1)
Expand Down
22 changes: 12 additions & 10 deletions moment_kinetics/src/initial_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using ..nonlinear_solvers: nl_solver_info
using ..velocity_moments: integrate_over_vspace, integrate_over_neutral_vspace
using ..velocity_moments: integrate_over_positive_vz, integrate_over_negative_vz
using ..velocity_moments: create_moments_ion, create_moments_electron, create_moments_neutral
using ..velocity_moments: update_qpar!
using ..velocity_moments: update_ion_qpar!
using ..velocity_moments: update_neutral_density!, update_neutral_pz!, update_neutral_pr!, update_neutral_pzeta!
using ..velocity_moments: update_neutral_uz!, update_neutral_ur!, update_neutral_uzeta!, update_neutral_qz!
using ..velocity_moments: update_ppar!, update_upar!, update_density!, update_pperp!, update_vth!, reset_moments_status!
Expand Down Expand Up @@ -141,7 +141,7 @@ function init_pdf_and_moments!(pdf, moments, fields, boundary_distributions, geo
r, composition.n_ion_species,
composition.n_neutral_species,
geometry.input, composition, species,
manufactured_solns_input)
manufactured_solns_input, collisions)
else
n_ion_species = composition.n_ion_species
n_neutral_species = composition.n_neutral_species
Expand Down Expand Up @@ -200,10 +200,11 @@ function init_pdf_and_moments!(pdf, moments, fields, boundary_distributions, geo
vpa, vzeta, vr, vz, vpa_spectral, vz_spectral, species)

begin_s_r_z_region()
# calculate the initial parallel heat flux from the initial un-normalised pdf
update_qpar!(moments.ion.qpar, moments.ion.qpar_updated,
moments.ion.dens, moments.ion.upar, moments.ion.vth,
pdf.ion.norm, vpa, vperp, z, r, composition,
# calculate the initial parallel heat flux from the initial un-normalised pdf. Even if Braginskii fluid is being
# advanced, initialised ion_qpar uses the pdf
update_ion_qpar!(moments.ion.qpar, moments.ion.qpar_updated,
moments.ion.dens, moments.ion.upar, moments.ion.vth, moments.ion.dT_dz,
pdf.ion.norm, vpa, vperp, z, r, composition, drift_kinetic_ions, collisions,
moments.evolve_density, moments.evolve_upar, moments.evolve_ppar)

begin_serial_region()
Expand Down Expand Up @@ -1638,7 +1639,8 @@ function init_electron_pdf_over_density_and_boundary_phi!(pdf, phi, density, upa
end
end

function init_pdf_moments_manufactured_solns!(pdf, moments, vz, vr, vzeta, vpa, vperp, z, r, n_ion_species, n_neutral_species, geometry,composition)
function init_pdf_moments_manufactured_solns!(pdf, moments, vz, vr, vzeta, vpa, vperp, z, r, n_ion_species, n_neutral_species,
geometry, composition, species, manufactured_solns_input, collisions)
manufactured_solns_list = manufactured_solutions(r.L,z.L,r.bc,z.bc,geometry,composition,r.n)
dfni_func = manufactured_solns_list.dfni_func
densi_func = manufactured_solns_list.densi_func
Expand All @@ -1665,10 +1667,10 @@ function init_pdf_moments_manufactured_solns!(pdf, moments, vz, vr, vzeta, vpa,
vpa, vperp, z, r, composition, moments.evolve_density,
moments.evolve_upar)
update_pperp!(moments.ion.pperp, pdf.ion.norm, vpa, vperp, z, r, composition)
update_qpar!(moments.ion.qpar, moments.ion.qpar_updated,
update_ion_qpar!(moments.ion.qpar, moments.ion.qpar_updated,
moments.ion.dens, moments.ion.upar,
moments.ion.vth, pdf.ion.norm, vpa, vperp, z, r,
composition, moments.evolve_density, moments.evolve_upar,
moments.ion.vth, moments.ion.dT_dz, pdf.ion.norm, vpa, vperp, z, r,
composition, drift_kinetic_ions, collisions, moments.evolve_density, moments.evolve_upar,
moments.evolve_ppar)
update_vth!(moments.ion.vth, moments.ion.ppar, moments.ion.pperp, moments.ion.dens, vperp, z, r, composition)

Expand Down
18 changes: 14 additions & 4 deletions moment_kinetics/src/input_structs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ export braginskii_fluid
export kinetic_electrons
export kinetic_electrons_with_temperature_equation

@enum ion_physics_type begin
gyrokinetic_ions
drift_kinetic_ions
braginskii_ions
end
export ion_physics_type
export gyrokinetic_ions
export drift_kinetic_ions
export braginskii_ions
"""
"""
Base.@kwdef struct spatial_initial_condition_input
Expand Down Expand Up @@ -259,6 +268,11 @@ Base.@kwdef struct species_composition
# density is fixed to be Nₑ*(eϕ/T_e) and N_e is calculated using a current
# condition at the wall
electron_physics::electron_physics_type
# ion physics can be drift_kinetic_ions, gyrokinetic_ions and braginskii_ions
# gyrokinetic_ions (originally gyrokinetic_ions = true) -> use gyroaveraged fields at fixed guiding
# centre and moments of the pdf computed at fixed r
# drift_kinetic_ions (originally gyrokinetic_ions = false) -> use drift kinetic approximation
ion_physics::ion_physics_type
# if false -- wall bc uses true Knudsen cosine to specify neutral pdf leaving the wall
# if true -- use a simpler pdf that is easier to integrate
use_test_neutral_wall_pdf::Bool
Expand All @@ -275,10 +289,6 @@ Base.@kwdef struct species_composition
# 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::mk_float
# gyrokinetic_ions is a flag determining if the ion species is gyrokinetic
# 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
# array of structs of parameters for each ion species
ion::Vector{ion_species_parameters}
# array of structs of parameters for each neutral species
Expand Down
119 changes: 107 additions & 12 deletions moment_kinetics/src/load_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ function reload_evolving_fields!(pdf, moments, fields, boundary_distributions,
length(moments.ion.external_source_controller_integral) == 1
moments.ion.external_source_controller_integral .=
load_slice(dynamic, "external_source_controller_integral", time_index)
elseif length(moments.ion.external_source_controller_integral) > 1
elseif size(moments.ion.external_source_controller_integral)[1] > 1 ||
size(moments.ion.external_source_controller_integral)[2] > 1
moments.ion.external_source_controller_integral .=
reload_moment("external_source_controller_integral", dynamic,
time_index, r, z, r_range, z_range, restart_r,
Expand Down Expand Up @@ -4145,6 +4146,88 @@ function get_variable(run_info, variable_name; normalize_advection_speed_shape=t
if variable_name == "temperature"
vth = get_variable(run_info, "thermal_speed"; kwargs...)
variable = vth.^2
elseif variable_name == "dT_dz"
T = get_variable(run_info, "temperature"; kwargs...)
variable = similar(T)
if :iz ∈ keys(kwargs) && kwargs[:iz] !== nothing
error("Cannot take z-derivative when iz!==nothing")
end
if :ir ∈ keys(kwargs) && isa(kwargs[:ir], mk_int)
for it ∈ 1:size(variable, 3)
@views derivative!(variable[:,:,it], T[:,:,it], run_info.z, run_info.z_spectral)
end
else
for it ∈ 1:size(variable, 4), ir ∈ 1:run_info.r.n
@views derivative!(variable[:,:,ir,it], T[:,:,ir,it], run_info.z, run_info.z_spectral)
end
end
Comment on lines +4155 to +4163
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one, and also "dn_dz" and "dupar_dz", need a loop over species (in case there are multiple ion species). That would lead to 4 different cases depending on if is and/or ir is an integer. I think the following would be better, although the use of CartesianIndices is a bit more cryptic than I'd like

for i  CartesianIndices(selectdim(variable, 1, 1))
    @views derivative!(variable[:,i], T[:,i], run_info.z, run_info.z_spectral)
end

@LucasMontoya4 what do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like a pretty nice solution to me! Sorry about that, I was being lazy and avoiding writing multiple species functionality…

elseif variable_name == "dn_dz"
n = get_variable(run_info, "density"; kwargs...)
variable = similar(n)
if :iz ∈ keys(kwargs) && kwargs[:iz] !== nothing
error("Cannot take z-derivative when iz!==nothing")
end
if :ir ∈ keys(kwargs) && isa(kwargs[:ir], mk_int)
for it ∈ 1:size(variable, 3)
@views derivative!(variable[:,:,it], n[:,:,it], run_info.z, run_info.z_spectral)
end
else
for it ∈ 1:size(variable, 4), ir ∈ 1:run_info.r.n
@views derivative!(variable[:,:,ir,it], n[:,:,ir,it], run_info.z, run_info.z_spectral)
end
end
elseif variable_name == "dupar_dz"
upar = get_variable(run_info, "parallel_flow"; kwargs...)
variable = similar(upar)
if :iz ∈ keys(kwargs) && kwargs[:iz] !== nothing
error("Cannot take z-derivative when iz!==nothing")
end
if :ir ∈ keys(kwargs) && isa(kwargs[:ir], mk_int)
for it ∈ 1:size(variable, 3)
@views derivative!(variable[:,:,it], upar[:,:,it], run_info.z, run_info.z_spectral)
end
else
for it ∈ 1:size(variable, 4), ir ∈ 1:run_info.r.n
@views derivative!(variable[:,:,ir,it], upar[:,:,ir,it], run_info.z, run_info.z_spectral)
end
end
elseif variable_name == "mfp"
vth = get_variable(run_info, "thermal_speed"; kwargs...)
nu_ii = get_variable(run_info, "collision_frequency_ii"; kwargs...)
variable = vth ./ nu_ii
elseif variable_name == "L_T"
dT_dz = get_variable(run_info, "dT_dz"; kwargs...)
temp = get_variable(run_info, "temperature"; kwargs...)
# We define gradient lengthscale of T as LT^-1 = dln(T)/dz (ignore negative sign
# tokamak convention as we're only concerned with comparing magnitudes)
variable = abs.(temp .* dT_dz.^(-1))
# flat points in temperature have diverging LT, so ignore those with NaN
# using a hard coded 10.0 tolerance for now
variable[variable .> 10.0] .= NaN
elseif variable_name == "L_n"
dn_dz = get_variable(run_info, "dn_dz"; kwargs...)
n = get_variable(run_info, "density"; kwargs...)
# We define gradient lengthscale of n as Ln^-1 = dln(n)/dz (ignore negative sign
# tokamak convention as we're only concerned with comparing magnitudes)
variable = abs.(n .* dn_dz.^(-1))
# flat points in temperature have diverging Ln, so ignore those with NaN
# using a hard coded 10.0 tolerance for now
variable[variable .> 10.0] .= NaN
elseif variable_name == "L_upar"
dupar_dz = get_variable(run_info, "dupar_dz"; kwargs...)
upar = get_variable(run_info, "parallel_flow"; kwargs...)
# We define gradient lengthscale of upar as Lupar^-1 = dln(upar)/dz (ignore negative sign
# tokamak convention as we're only concerned with comparing magnitudes)
variable = abs.(upar .* dupar_dz.^(-1))
# flat points in temperature have diverging Lupar, so ignore those with NaN
# using a hard coded 10.0 tolerance for now
variable[variable .> 10.0] .= NaN
elseif variable_name == "braginskii_heat_flux"
n = get_variable(run_info, "density"; kwargs...)
vth = get_variable(run_info, "thermal_speed"; kwargs...)
dT_dz = get_variable(run_info, "dT_dz"; kwargs...)
nu_ii = get_variable(run_info, "collision_frequency_ii"; kwargs...)
variable = @. -(1/2) * 5/4 * n * vth^2 * dT_dz / nu_ii
Comment on lines +4226 to +4230
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we introduce a function for the inside of the loop in calculate_ion_qpar_from_braginskii!() we could re-use it here, like

function _calculate_ion_qpar_from_braginskii_inner(density, vth, nu_ii, dT_dz)
    return @. -(1/2) * 5/4 * density[iz,ir] * vth[iz,ir]^2 /nu_ii * dT_dz[iz,ir,1]
end

The @. should mean this function works for either scalar inputs (like in calculate_ion_qpar_from_braginskii!()) or array inputs (like here).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great to me. There are a few other cases of re calculating things in the ‘load_data.jl’ file, so there might be a nicer way to revamp all of that function?

elseif variable_name == "collision_frequency_ii"
n = get_variable(run_info, "density"; kwargs...)
vth = get_variable(run_info, "thermal_speed"; kwargs...)
Expand Down Expand Up @@ -4256,7 +4339,7 @@ function get_variable(run_info, variable_name; normalize_advection_speed_shape=t
n = get_variable(run_info, "density"; kwargs...)

# Note factor of 0.5 in front of qpar because the definition of qpar (see e.g.
# `update_qpar_species!()`) is unconventional (i.e. missing a factor of 0.5).
# `update_ion_qpar_species!()`) is unconventional (i.e. missing a factor of 0.5).
# Factor of 3/2 in front of 1/2*n*vth^2*upar because this in 1V - would be 5/2
# for 2V/3V cases.
variable = @. 0.5*qpar + 0.75*n*vth^2*upar + 0.5*n*upar^3
Expand All @@ -4271,7 +4354,7 @@ function get_variable(run_info, variable_name; normalize_advection_speed_shape=t
n = get_variable(run_info, "density_neutral"; kwargs...)

# Note factor of 0.5 in front of qpar because the definition of qpar (see e.g.
# `update_qpar_species!()`) is unconventional (i.e. missing a factor of 0.5).
# `update_ion_qpar_species!()`) is unconventional (i.e. missing a factor of 0.5).
# Factor of 3/2 in front of 1/2*n*vth^2*upar because this in 1V - would be 5/2
# for 2V/3V cases.
variable = @. 0.5*qpar + 0.75*n*vth^2*upar + 0.5*n*upar^3
Expand Down Expand Up @@ -4343,9 +4426,6 @@ function get_variable(run_info, variable_name; normalize_advection_speed_shape=t
density = get_variable(run_info, "density")
upar = get_variable(run_info, "parallel_flow")
ppar = get_variable(run_info, "parallel_pressure")
density_neutral = get_variable(run_info, "density_neutral")
uz_neutral = get_variable(run_info, "uz_neutral")
pz_neutral = get_variable(run_info, "pz_neutral")
vth = get_variable(run_info, "thermal_speed")
dupar_dz = get_z_derivative(run_info, "parallel_flow")
dppar_dz = get_z_derivative(run_info, "parallel_pressure")
Expand Down Expand Up @@ -4395,6 +4475,15 @@ function get_variable(run_info, variable_name; normalize_advection_speed_shape=t
setup_loop_ranges!(0, 1; s=nspecies, sn=run_info.n_neutral_species, r=nr, z=nz,
vperp=nvperp, vpa=nvpa, vzeta=run_info.vzeta.n,
vr=run_info.vr.n, vz=run_info.vz.n)

# Use neutrals for fvec calculation in moment_kinetic version only when
# n_neutrals != 0
if run_info.n_neutral_species != 0
density_neutral = get_variable(run_info, "density_neutral")
uz_neutral = get_variable(run_info, "uz_neutral")
pz_neutral = get_variable(run_info, "pz_neutral")
end

for it ∈ 1:nt
begin_serial_region()
# Only need some struct with a 'speed' variable
Expand All @@ -4413,12 +4502,18 @@ function get_variable(run_info, variable_name; normalize_advection_speed_shape=t
evolve_density=run_info.evolve_density,
evolve_upar=run_info.evolve_upar,
evolve_ppar=run_info.evolve_ppar)
@views fvec = (density=density[:,:,:,it],
upar=upar[:,:,:,it],
ppar=ppar[:,:,:,it],
density_neutral=density_neutral[:,:,:,it],
uz_neutral=uz_neutral[:,:,:,it],
pz_neutral=pz_neutral[:,:,:,it])
if run_info.n_neutral_species != 0
@views fvec = (density=density[:,:,:,it],
upar=upar[:,:,:,it],
ppar=ppar[:,:,:,it],
density_neutral=density_neutral[:,:,:,it],
uz_neutral=uz_neutral[:,:,:,it],
pz_neutral=pz_neutral[:,:,:,it])
else
@views fvec = (density=density[:,:,:,it],
upar=upar[:,:,:,it],
ppar=ppar[:,:,:,it])
end
@views update_speed_vpa!(advect, fields, fvec, moments, run_info.vpa,
run_info.vperp, run_info.z, run_info.r,
run_info.composition, run_info.collisions,
Expand Down
2 changes: 1 addition & 1 deletion moment_kinetics/src/moment_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module moment_constraints
using ..communication: _block_synchronize
using ..looping
using ..type_definitions: mk_float
using ..velocity_moments: integrate_over_vspace, update_qpar!
using ..velocity_moments: integrate_over_vspace, update_ion_qpar!

export hard_force_moment_constraints!, hard_force_moment_constraints_neutral!

Expand Down
2 changes: 1 addition & 1 deletion moment_kinetics/src/moment_kinetics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ include("nonlinear_solvers.jl")
include("file_io.jl")
include("geo.jl")
include("gyroaverages.jl")
include("krook_collisions.jl")
include("velocity_moments.jl")
include("velocity_grid_transforms.jl")
include("electron_fluid_equations.jl")
Expand All @@ -61,7 +62,6 @@ include("neutral_z_advection.jl")
include("neutral_vz_advection.jl")
include("charge_exchange.jl")
include("ionization.jl")
include("krook_collisions.jl")
include("maxwell_diffusion.jl")
include("continuity.jl")
include("energy_equation.jl")
Expand Down
Loading