From e759f79a8c798284acf3aeb030c83a55aa053cdc Mon Sep 17 00:00:00 2001 From: Alexander Fleming Date: Tue, 2 Jan 2024 08:20:48 +0100 Subject: [PATCH] Billig Formulae. --- src/billig.jl | 2 +- src/normal_shocks.jl | 9 +++++++-- test/runtests.jl | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/billig.jl b/src/billig.jl index b42f546..23c2b55 100644 --- a/src/billig.jl +++ b/src/billig.jl @@ -72,7 +72,7 @@ The shock wave parametrization developed by *Billig* parametrizes the shock wave """ function shock_tangent(α, M_inf, R_b) n = shock_normal(α, M_inf, R_b) - return [n[2], 1] + return [n[2], -n[1]] end end # module \ No newline at end of file diff --git a/src/normal_shocks.jl b/src/normal_shocks.jl index 7d3a2d5..ea51413 100644 --- a/src/normal_shocks.jl +++ b/src/normal_shocks.jl @@ -56,6 +56,10 @@ function shock_tangent_mach_ratio(M, n̂; gas::CaloricallyPerfectGas=DRY_AIR) return sqrt(shock_temperature_ratio(M, n̂; gas=gas)) end +@inline function shock_normal_momentum_ratio(M, n̂; gas::CaloricallyPerfectGas=DRY_AIR) + return shock_density_ratio(M, n̂; gas=gas) * shock_normal_velocity_ratio(M, n̂; gas=gas) +end + """ **Equation 4.11** from Anderson&Anderson @@ -73,6 +77,7 @@ The outward (away from body) normal is ``n̂``. function conserved_state_behind(state_L::ConservedState, n̂, t̂; gas::CaloricallyPerfectGas=DRY_AIR) @assert t̂ ⋅ n̂ == 0. "tangent and normal vectors should be normal." M_L = state_L.ρv / (state_L.ρ * speed_of_sound(gas, state_L)) - mach_t_ratio = shock_tangent_mach_ratio(M_L, n̂; gas=gas) - M_R_n = (M_L⋅n̂) * shock_normal_mach_ratio(M_L, n̂; gas=gas) + ρv_n_L = (state_L.ρv ⋅ n̂) * shock_normal_momentum_ratio(M_L, n̂; gas=gas) + ρv_t_L = (state_L.ρv ⋅ n̂) * shock_density_ratio(M_L, n̂; gas=gas) + end \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 255593a..42c2b1e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,12 +2,12 @@ using LinearAlgebra using ShockwaveProperties using Test -@testset "ShockwaveProperties.jl" begin +@testset verbose=true "ShockwaveProperties.jl" begin @testset "BilligShockParametrization" begin using .BilligShockParametrization @testset "Shockwave Normals" begin y = -10:0.1:10 - for R_b ∈ 1.0:0.25:4.0, M ∈ 1.5:0.5:5.0 + for R_b ∈ 1.0:0.5:4.0, M ∈ 2.0:1.0:5.0 vals = mapreduce(hcat, y) do α shock_normal(α, M, R_b) ⋅ shock_tangent(α, M, R_b) end