diff --git a/src/equations/compressible_euler_multicomponent_abstract_2d.jl b/src/equations/compressible_euler_multicomponent_abstract_2d.jl index 46971dd27aa..1b80367ea10 100644 --- a/src/equations/compressible_euler_multicomponent_abstract_2d.jl +++ b/src/equations/compressible_euler_multicomponent_abstract_2d.jl @@ -454,6 +454,36 @@ end λ_max = max(abs(v_ll), abs(v_rr)) + max(c_ll, c_rr) end +@inline function max_abs_speed_naive(u_ll, u_rr, normal_direction::AbstractVector, + equations::AbstractCompressibleEulerMulticomponentEquations{2}) + + rho_v1_ll, rho_v2_ll = u_ll + rho_v1_rr, rho_v2_rr = u_rr + + # Get the density and gas gamma + rho_ll = density(u_ll, equations) + rho_rr = density(u_rr, equations) + gamma_ll = totalgamma(u_ll, equations) + gamma_rr = totalgamma(u_rr, equations) + + # Calculate normal velocities and sound speed + v1_ll = rho_v1_ll / rho_ll + v2_ll = rho_v2_ll / rho_ll + v1_rr = rho_v1_rr / rho_rr + v2_rr = rho_v2_rr / rho_rr + + v_ll = (v1_ll * normal_direction[1] + v2_ll * normal_direction[2]) + v_rr = (v1_rr * normal_direction[1] + v2_rr * normal_direction[2]) + + # Compute the sound speeds on the left and right + p_ll = pressure(u_ll, equations) + c_ll = sqrt(gamma_ll * p_ll / rho_ll) + p_rr = pressure(u_rr, equations) + c_rr = sqrt(gamma_rr * p_rr / rho_rr) + + λ_max = max(abs(v_ll), abs(v_rr)) + max(c_ll, c_rr) +end + @inline function max_abs_speeds(u, equations::AbstractCompressibleEulerMulticomponentEquations{2}) rho_v1, rho_v2 = u