Skip to content

Commit deafa1b

Browse files
committed
Add met_det function to compute the determinant of the Kerr metric and implement ϕ_BL transformation function
1 parent 6681c13 commit deafa1b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/metrics/Kerr/Kerr.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,8 @@ Kerr metric in Boyer Lindquist (BL) coordinates.
119119
_, r, θ, _ = coordinates
120120
return metric_dd(metric, r, θ)
121121
end
122+
123+
124+
function met_det(metric::Kerr{T}, r, θ) where {T}
125+
return -sin(θ)^2 * (r^2 + metric.spin^2 * cos(θ)^2)^2
126+
end

src/schemes/RayTrace.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,24 @@ function ϕ_kerr_schild(metric::Kerr{T}, rBL, ϕBL) where {T}
202202
return ans
203203
end
204204

205+
function ϕ_BL(metric::Kerr{T}, rKS, ϕKS) where {T}
206+
a = metric.spin
207+
temp = sqrt(1 - a^2)
208+
rp = 1 + temp
209+
rm = 1 - temp
210+
num = rKS - rp + eps()
211+
den = rKS - rm + eps()
212+
213+
term1 = -a / (2temp) * log(abs(num / den))
214+
term2 = atan(a, rKS)
215+
ans = ϕKS + term1 + term2
216+
if isinf(ans)
217+
@warn "ϕ_BL is inf at rs=$rKS. This usually happens if the ray intersects the horizon."
218+
return ϕKS + term2
219+
end
220+
return ans
221+
end
222+
205223

206224
"""
207225
Transforms from Boyer-Lindquist to Kerr-Schild coordinates

0 commit comments

Comments
 (0)