@@ -29,9 +29,9 @@ function energy_in(stpm::SingleAsteroidTPM)
2929 for i in eachindex (stpm. shape. faces)
3030 R_vis = stpm. thermo_params. reflectance_vis[i]
3131 R_ir = stpm. thermo_params. reflectance_ir[i]
32- F_sun = stpm. flux[i, 1 ]
33- F_scat = stpm. flux[i, 2 ]
34- F_rad = stpm. flux[i, 3 ]
32+ F_sun = stpm. flux_sun[i ]
33+ F_scat = stpm. flux_scat[i ]
34+ F_rad = stpm. flux_rad[i ]
3535 a = stpm. shape. face_areas[i]
3636
3737 E_in += flux_total (R_vis, R_ir, F_sun, F_scat, F_rad) * a
@@ -82,18 +82,18 @@ function update_flux_sun!(stpm::SingleAsteroidTPM, r̂☉::StaticVector{3}, F☉
8282 for i in eachindex (stpm. shape. faces)
8383 if isilluminated (stpm. shape, r̂☉, i)
8484 n̂ = stpm. shape. face_normals[i]
85- stpm. flux[i, 1 ] = F☉ * (n̂ ⋅ r̂☉)
85+ stpm. flux_sun[i ] = F☉ * (n̂ ⋅ r̂☉)
8686 else
87- stpm. flux[i, 1 ] = 0
87+ stpm. flux_sun[i ] = 0
8888 end
8989 end
9090 else
9191 for i in eachindex (stpm. shape. faces)
9292 n̂ = stpm. shape. face_normals[i]
9393 if n̂ ⋅ r̂☉ > 0
94- stpm. flux[i, 1 ] = F☉ * (n̂ ⋅ r̂☉)
94+ stpm. flux_sun[i ] = F☉ * (n̂ ⋅ r̂☉)
9595 else
96- stpm. flux[i, 1 ] = 0
96+ stpm. flux_sun[i ] = 0
9797 end
9898 end
9999 end
@@ -147,13 +147,13 @@ function update_flux_scat_single!(stpm::SingleAsteroidTPM)
147147 stpm. SELF_HEATING == false && return
148148
149149 for i_face in eachindex (stpm. shape. faces)
150- stpm. flux [i_face, 2 ] = 0.
150+ stpm. flux_scat [i_face] = 0.
151151 for visiblefacet in stpm. shape. visiblefacets[i_face]
152152 j = visiblefacet. id
153153 fᵢⱼ = visiblefacet. f
154154 R_vis = stpm. thermo_params. reflectance_vis[j]
155155
156- stpm. flux [i_face, 2 ] += fᵢⱼ * R_vis * stpm. flux[j, 1 ]
156+ stpm. flux_scat [i_face] += fᵢⱼ * R_vis * stpm. flux_sun[j ]
157157 end
158158 end
159159end
@@ -200,15 +200,15 @@ function update_flux_rad_single!(stpm::SingleAsteroidTPM)
200200 stpm. SELF_HEATING == false && return
201201
202202 for i in eachindex (stpm. shape. faces)
203- stpm. flux[i, 3 ] = 0.
203+ stpm. flux_rad[i ] = 0.
204204 for visiblefacet in stpm. shape. visiblefacets[i]
205205 j = visiblefacet. id
206206 fᵢⱼ = visiblefacet. f
207207 ε = stpm. thermo_params. emissivity[j]
208208 R_ir = stpm. thermo_params. reflectance_ir[j]
209209 Tⱼ = stpm. temperature[begin , j]
210210
211- stpm. flux[i, 3 ] += ε * σ_SB * (1 - R_ir) * fᵢⱼ * Tⱼ^ 4
211+ stpm. flux_rad[i ] += ε * σ_SB * (1 - R_ir) * fᵢⱼ * Tⱼ^ 4
212212 end
213213 end
214214end
@@ -271,7 +271,7 @@ function mutual_shadowing!(btpm::BinaryAsteroidTPM, r☉, rₛ, R₂₁)
271271
272272 # # if △A₁B₁C₁ is NOT facing the sun
273273 if r̂☉ ⋅ n̂₁ < 0
274- btpm. pri. flux[i, 1 ] = 0
274+ btpm. pri. flux_sun[i ] = 0
275275 continue
276276 end
277277
@@ -282,7 +282,7 @@ function mutual_shadowing!(btpm::BinaryAsteroidTPM, r☉, rₛ, R₂₁)
282282
283283 # # In the secondary shadow
284284 if θ₁ < θ_r₂
285- btpm. pri. flux[i, 1 ] = 0
285+ btpm. pri. flux_sun[i ] = 0
286286 continue
287287 # # Out of the secondary shadow
288288 elseif θ₁ > θ_R₂
@@ -305,7 +305,7 @@ function mutual_shadowing!(btpm::BinaryAsteroidTPM, r☉, rₛ, R₂₁)
305305 # # if △A₁B₁C₁ and △A₂B₂C₂ are facing each other
306306 if d₁₂ ⋅ n̂₁ > 0 && d₁₂ ⋅ n̂₂ < 0
307307 if raycast (A₂, B₂, C₂, r̂☉, G₁)
308- btpm. pri. flux[i, 1 ] = 0
308+ btpm. pri. flux_sun[i ] = 0
309309 break
310310 end
311311 end
@@ -331,7 +331,7 @@ function mutual_shadowing!(btpm::BinaryAsteroidTPM, r☉, rₛ, R₂₁)
331331
332332 # # if △A₂B₂C₂ is NOT facing the sun
333333 if r̂☉ ⋅ n̂₂ < 0
334- btpm. sec. flux[j, 1 ] = 0
334+ btpm. sec. flux_sun[j ] = 0
335335 continue
336336 end
337337
@@ -342,7 +342,7 @@ function mutual_shadowing!(btpm::BinaryAsteroidTPM, r☉, rₛ, R₂₁)
342342
343343 # # In the primary shadow
344344 if θ₂ < θ_r₁
345- btpm. sec. flux[j, 1 ] = 0
345+ btpm. sec. flux_sun[j ] = 0
346346 continue
347347 # # Out of the primary shadow
348348 elseif θ₂ > θ_R₁
@@ -358,7 +358,7 @@ function mutual_shadowing!(btpm::BinaryAsteroidTPM, r☉, rₛ, R₂₁)
358358 # # if △A₁B₁C₁ and △A₂B₂C₂ are facing each other
359359 if d₁₂ ⋅ n̂₁ > 0 && d₁₂ ⋅ n̂₂ < 0
360360 if raycast (A₁, B₁, C₁, r̂☉, G₂)
361- btpm. sec. flux[j, 1 ] = 0
361+ btpm. sec. flux_sun[j ] = 0
362362 break
363363 end
364364 end
@@ -368,7 +368,7 @@ function mutual_shadowing!(btpm::BinaryAsteroidTPM, r☉, rₛ, R₂₁)
368368
369369 # ### Total eclipse of the secondary ####
370370 elseif π - θ₋ ≤ θ < π
371- btpm. sec. flux[:, 1 ] .= 0
371+ btpm. sec. flux_sun .= 0
372372 end
373373end
374374
@@ -429,12 +429,12 @@ function mutual_heating!(btpm::BinaryAsteroidTPM, rₛ, R₂₁)
429429 R_ir₂ = thermo_params2. reflectance_ir[j]
430430
431431 # # Mutual heating by scattered light
432- btpm. pri. flux[i, 2 ] += f₁₂ * R_vis₂ * btpm. sec. flux[j, 1 ]
433- btpm. sec. flux[j, 2 ] += f₂₁ * R_vis₁ * btpm. pri. flux[i, 1 ]
432+ btpm. pri. flux_scat[i ] += f₁₂ * R_vis₂ * btpm. sec. flux_sun[j ]
433+ btpm. sec. flux_scat[j ] += f₂₁ * R_vis₁ * btpm. pri. flux_sun[i ]
434434
435435 # # Mutual heating by thermal radiation
436- btpm. pri. flux[i, 3 ] += ε₂ * σ_SB * (1 - R_ir₂) * f₁₂ * T₂^ 4
437- btpm. sec. flux[j, 3 ] += ε₁ * σ_SB * (1 - R_ir₁) * f₂₁ * T₁^ 4
436+ btpm. pri. flux_rad[i ] += ε₂ * σ_SB * (1 - R_ir₂) * f₁₂ * T₂^ 4
437+ btpm. sec. flux_rad[j ] += ε₁ * σ_SB * (1 - R_ir₁) * f₂₁ * T₁^ 4
438438 end
439439 end
440440 end
0 commit comments