Skip to content
Snippets Groups Projects

Refactor GRHD project

Merged Florian Atteneder requested to merge fa/grhd into main
1 file
+ 21
3
Compare changes
  • Side-by-side
  • Inline
+ 21
3
@@ -132,12 +132,30 @@ end
end
# @with_signature function maxspeed(equation::Equation)
# @accepts vr
# @accepts α, βru, γrr
# γuurr = 1/γrr
# vru = γuurr * vr
# max_v = abs(α*vru - βru)
# @returns max_v
# end
@with_signature function maxspeed(equation::Equation)
@accepts vr
@accepts α, βru, γrr
@accepts vr, ρ, ϵ
@accepts α, γrr
@unpack eos = equation
cs2 = eos(SquareSpeedOfSound, Density, ρ, InternalEnergy, ϵ)
cs = sqrt(abs(cs2))
γuurr = 1/γrr
vru = γuurr * vr
max_v = abs(α*vru - βru)
v2 = vru*vr
A = α
λ0 = A*vru
W = 1/sqrt(1-v2)
λp = A/(1-v2)*(vru*(1-cs2)+cs/W*sqrt((1-v2*cs2)*γuurr-vru^2*(1-cs2)))
λm = A/(1-v2)*(vru*(1-cs2)-cs/W*sqrt((1-v2*cs2)*γuurr-vru^2*(1-cs2)))
max_v = absmax(λm, λ0, λp)
# TODO Can't use this method with bondi accretion test, need to use old version ...
@returns max_v
end
Loading