Skip to content

Commit

Permalink
Billig Formulae.
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-fleming committed Jan 2, 2024
1 parent 29ecc51 commit e759f79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/billig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions src/normal_shocks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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== 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_Ln̂) * 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
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e759f79

Please sign in to comment.