Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
archermarx committed Feb 29, 2024
1 parent d50fb14 commit 83414e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
25 changes: 9 additions & 16 deletions test/order_verification/ovs_ions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ function solve_ions(ncells, scheme; t_end = 1e-4)
solve_background_neutrals = false,
)

species = [HallThruster.Xenon(0), HallThruster.Xenon(1)]

ionization_reactions = HallThruster._load_reactions(config.ionization_model, species)

z_edge = grid.edges
z_cell = grid.cell_centers

Expand All @@ -115,11 +111,16 @@ function solve_ions(ncells, scheme; t_end = 1e-4)
∇ϕ = ∇ϕ_func.(z_cell)

fluids, fluid_ranges, species, species_range_dict, is_velocity_index = HallThruster.configure_fluids(config)
ionization_reactions = HallThruster._load_reactions(config.ionization_model, species)
index = HallThruster.configure_index(fluids, fluid_ranges)

F = zeros(4, nedges)
UL = zeros(4, nedges)
UR = zeros(4, nedges)
@show is_velocity_index, fluid_ranges

nvars = fluid_ranges[end][end]

F = zeros(nvars, nedges)
UL = zeros(nvars, nedges)
UR = zeros(nvars, nedges)
λ_global = zeros(2)

channel_area = A_ch .* ones(ncells+2)
Expand All @@ -131,7 +132,7 @@ function solve_ions(ncells, scheme; t_end = 1e-4)
dt_iz = zeros(ncells+2)
dt_E = zeros(ncells+2)

U = zeros(4, ncells+2)
U = zeros(nvars, ncells+2)
z_end = z_cell[end]
z_start = z_cell[1]
line(v0, v1, z) = v0 + (v1 - v0) * (z - z_start) / (z_end - z_start)
Expand Down Expand Up @@ -176,14 +177,6 @@ function solve_ions(ncells, scheme; t_end = 1e-4)
t = 0.0
while t < t_end
@views U[:, end] = U[:, end-1]
# HallThruster.update_heavy_species!(dU, U, params, t; apply_boundary_conditions = false)
# for i in eachindex(U)
# U[i] += dt[] * dU[i]
# if isnan(U[i]) || isinf(U[i])
# t = Inf
# end
# end
# t += dt[]
HallThruster.ssprk22_step!(
U, (dU, U, params, t) -> HallThruster.update_heavy_species!(dU, U, params, t; apply_boundary_conditions = false),
params, t, dt[]
Expand Down
2 changes: 1 addition & 1 deletion test/unit_tests/test_conservation_laws.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
index = (ρi = [1], ρiui = [2])
scheme = HallThruster.HyperbolicScheme(identity, HallThruster.no_limiter, false)
config = (;scheme, ncharge = 1)
params = (;index, config)
params = (;index, config, is_velocity_index = [false, true, false])

HallThruster.compute_edge_states!(edge_L, edge_R, U_euler, params)
@test edge_L[:, 1] == euler_state_L
Expand Down

0 comments on commit 83414e6

Please sign in to comment.