-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: rename GeometricThinDisc to ThinDisc + disc refactor
Put each disc in its own file and directory, so it's easy to see what belongs to what. Removed the inclination argument from ThinDisc, since with PrecessingDisc and the like, it would be better to add general modifiers.
- Loading branch information
Showing
25 changed files
with
224 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
struct DatumPlane{T} <: AbstractAccretionDisc{T} | ||
height::T | ||
end | ||
optical_property(::Type{<:DatumPlane}) = OpticallyThin() | ||
|
||
function distance_to_disc(d::DatumPlane{T}, x4; gtol) where {T} | ||
h = @inbounds let r = x4[2], θ = x4[3], ϕ = x4[4] | ||
r * cos(θ) | ||
end | ||
abs(h) - d.height - (gtol * x4[2]) | ||
end | ||
|
||
function datumplane(disc::AbstractThickAccretionDisc, r::T) where {T} | ||
h = r_cross_section(disc, r) | ||
DatumPlane(h) | ||
end | ||
function datumplane(disc::AbstractThickAccretionDisc, x::SVector{4}) | ||
h = cross_section(disc, x) | ||
DatumPlane(h) | ||
end | ||
|
||
export DatumPlane |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
""" | ||
ShakuraSunyaev{T} <: AbstractThickAccretionDisc{T} | ||
ShakuraSunyaev( | ||
m::AbstractMetric; | ||
eddington_ratio = 0.3, | ||
η = nothing, | ||
contra_rotating = false, | ||
) | ||
The classic Shakura & Sunyaev (1973) accretion disc model, with height given by ``2H``, where | ||
```math | ||
H = \\frac{3}{2} \\frac{1}{\\eta} \\left( \\frac{\\dot{M}}{\\dot{M}_\\text{Edd}} \\right) \\left( 1 - \\sqrt{\\frac{r_\\text{isco}}{\\rho}} \\right) | ||
``` | ||
Here ``\\eta`` is the radiative efficiency, which, if unspecified, is determined by the circular orbit energy at the ISCO: | ||
```math | ||
\\eta = 1 - E_\\text{isco} | ||
``` | ||
""" | ||
struct ShakuraSunyaev{T} <: AbstractThickAccretionDisc{T} | ||
Ṁ::T | ||
Ṁedd::T | ||
η::T | ||
risco::T | ||
end | ||
|
||
@fastmath function cross_section(d::ShakuraSunyaev, u) | ||
@inbounds let r = u[2], θ = u[3] | ||
if r < d.risco | ||
return -1.0 | ||
end | ||
ρ = r * sin(θ) | ||
H = (3 / 2) * inv(d.η) * (d.Ṁ / d.Ṁedd) * (1 - sqrt(d.risco / ρ)) | ||
2H | ||
end | ||
end | ||
|
||
function ShakuraSunyaev( | ||
m::AbstractMetric{T}; | ||
eddington_ratio = 0.3, | ||
η = nothing, | ||
contra_rotating = false, | ||
) where {T} | ||
r_isco = isco(m) | ||
radiative_efficiency = if isnothing(η) | ||
1 - CircularOrbits.energy( | ||
m, | ||
SVector{2}(r_isco, π / 2); | ||
contra_rotating = contra_rotating, | ||
) | ||
else | ||
η | ||
end | ||
ShakuraSunyaev(T(eddington_ratio), 1.0, radiative_efficiency, r_isco) | ||
end | ||
|
||
export ShakuraSunyaev |
Oops, something went wrong.