Skip to content

Commit

Permalink
Rewrote temperature functions in elixir to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
amrueda committed Dec 19, 2024
1 parent 22bf32f commit f6ad4f7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/tree_2d_dgsem/elixir_mhdmultiion_collisions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ function initial_condition_slow_down(x, t, equations::IdealGlmMhdMultiIonEquatio
end

# Temperature of ion 1
function temperature1(cons, equations::IdealGlmMhdMultiIonEquations2D)
prim = cons2prim(cons, equations)
rho, _, _, _, p = Trixi.get_component(1, prim, equations)
function temperature1(u, equations::IdealGlmMhdMultiIonEquations2D)
rho_1, _ = Trixi.get_component(1, u, equations)
p = pressure(u, equations)

return p / rho / equations.gas_constants[1]
return p[1] / rho_1 / equations.gas_constants[1]
end

# Temperature of ion 2
function temperature2(cons, equations::IdealGlmMhdMultiIonEquations2D)
prim = cons2prim(cons, equations)
rho, _, _, _, p = Trixi.get_component(2, prim, equations)
function temperature2(u, equations::IdealGlmMhdMultiIonEquations2D)
rho_2, _ = Trixi.get_component(2, u, equations)
p = pressure(u, equations)

return p / rho / equations.gas_constants[2]
return p[2] / rho_2 / equations.gas_constants[2]
end

initial_condition = initial_condition_slow_down
Expand Down

0 comments on commit f6ad4f7

Please sign in to comment.