-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functions to calculate themal radiation flux (#145)
* Add `radiation.jl` * Add test for `radiation.jl` * Add a fractal topography model for test * Update radiation.jl * Update radiation.jl * Update radiation.jl * Update blackbody_radiation.jl Add test for local TPM and thermal radiation calculation * Update src/radiation.jl Co-authored-by: Yuto Horikawa <hyrodium@gmail.com> * Update blackbody_radiation.jl Add a comment * Update src/radiation.jl Co-Authored-By: Yuto Horikawa <hyrodium@gmail.com> * Update blackbody_radiation.jl Just add a comment. * Update radiation.jl `L` denotes radiation [W/m²]. * Update radiation.jl Just correct some comments. * Update blackbody_radiation.jl Added the value tests of the thermal radiation. * Rename `test/blackbody_radiation.jl` to `test/thermal_radiation.jl` * Change function names - blackbody_radiation -> blackbody_radiance - thermal_radiation -> thermal_radiance * Change file names src/radiation.jl -> src/thermal_radiation.jl * Update thermal_radiation.jl Add a test of blackbody radiation * Update AsteroidThermoPhysicalModels.jl * Update thermal_radiation.jl * Update thermal_radiation.jl --------- Co-authored-by: Yuto Horikawa <hyrodium@gmail.com>
- Loading branch information
1 parent
31798ed
commit 2d0a7e9
Showing
6 changed files
with
7,784 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
""" | ||
blackbody_radiance(λ, T) -> L_λ | ||
Accroding to Planck's law, calculate the spectral intensity of blackbody radiation | ||
at wavelength `λ` and temperature `T`. | ||
# Arguments | ||
- `λ` : Wavelength [m] | ||
- `T` : Temperature [K] | ||
# Return | ||
- `L_λ` : Spectral radiance [W/m²/m/steradian] | ||
cf. https://github.com/JuliaAstro/Planck.jl/blob/main/src/Planck.jl | ||
""" | ||
blackbody_radiance(λ, T) = 2 * h * c₀^2 / λ^5 / expm1(h * c₀ / (λ * k_B * T)) | ||
|
||
""" | ||
blackbody_radiance(T) -> L | ||
According to Stefan-Boltzmann law, calculate the total radiance of blackbody radiation | ||
at temperature `T`, integrated over all wavelength. | ||
# Arguments | ||
- `T` : Temperature [K] | ||
# Return | ||
- `L` : Radiance [W/m²/steradian] | ||
""" | ||
blackbody_radiance(T) = σ_SB * T^4 ## TODO: テストを追加する | ||
|
||
|
||
""" | ||
thermal_radiance(shape, emissivities, temperatures, obs) -> L | ||
Calculate the radiance from the temperature distribution based on a shape model. | ||
# Arguments | ||
- `shape` : Shape model of an asteroid | ||
- `emissivities` : Emissivity of each facet of the shape model [-] | ||
- `temperatures` : Temperature of each facet of the shape model [K] | ||
- `obs` : Position vector of the observer in the same coordinate system as `shape` [m] | ||
# Return | ||
- `L` : Radiance [W/m²] | ||
""" | ||
function thermal_radiance(shape::ShapeModel, emissivities::AbstractVector{<:Real}, temperatures::AbstractVector{<:Real}, obs::StaticVector{3, <:Real}) | ||
if length(temperatures) != length(shape.faces) | ||
throw(ArgumentError("Length of `temperatures` must be equal to the number of faces of the shape model.")) | ||
end | ||
|
||
L = 0.0 # Radiance [W/m²] | ||
for i in eachindex(shape.faces) | ||
c = shape.face_centers[i] | ||
n̂ = shape.face_normals[i] | ||
a = shape.face_areas[i] | ||
|
||
ε = emissivities[i] | ||
T = temperatures[i] | ||
|
||
## Direction and distance from the facet center to the observer | ||
d̂ = normalize(obs - c) | ||
d = norm(obs - c) | ||
|
||
cosθ = n̂ ⋅ d̂ | ||
cosθ < 0 && continue # Ignore the facet if the observer is below the horizon. | ||
|
||
## TODO: Ray-trace for each facet | ||
|
||
## TODO: Consider the solid angle of the facet. | ||
## The coefficient may change from π to 2π or 4π. | ||
L += ε * σ_SB * T^4 * a * cosθ / (π * d^2) | ||
end | ||
return L | ||
end |
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
Oops, something went wrong.