diff --git a/test/order_verification/ovs_ions.jl b/test/order_verification/ovs_ions.jl index 45bf4645..052d033f 100644 --- a/test/order_verification/ovs_ions.jl +++ b/test/order_verification/ovs_ions.jl @@ -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 @@ -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) @@ -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) @@ -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[] diff --git a/test/unit_tests/test_conservation_laws.jl b/test/unit_tests/test_conservation_laws.jl index 14b7ac35..d6e06891 100644 --- a/test/unit_tests/test_conservation_laws.jl +++ b/test/unit_tests/test_conservation_laws.jl @@ -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