Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MasanoriKanamaru committed Jul 27, 2023
1 parent 4f0c933 commit f031538
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/TPM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ function update_flux_scat_single!(shape, A_B)
for visiblefacet in shape.facets[i].visiblefacets
j = visiblefacet.id
fᵢⱼ = visiblefacet.f
shape.flux[i, 2] += fᵢⱼ * (A_B isa Real ? A_B : A_B[j]) * shape.flux[j, 1]
A_B = (A_B isa Real ? A_B : A_B[j])
shape.flux[i, 2] += fᵢⱼ * A_B * shape.flux[j, 1]
end
end
end
Expand Down Expand Up @@ -420,8 +421,11 @@ function update_flux_rad_single!(shape, ε, A_TH)
for visiblefacet in shape.facets[i].visiblefacets
j = visiblefacet.id
fᵢⱼ = visiblefacet.f
ε =isa Real ? ε : ε[j])
A_TH = (A_TH isa Real ? A_TH : A_TH[j])
Tⱼ = shape.facets[j].temps[begin]
shape.flux[i, 3] +=isa Real ? ε : ε[j]) * σ_SB * (1 - (A_TH isa Real ? A_TH : A_TH[j])) * fᵢⱼ * Tⱼ^4

shape.flux[i, 3] += ε * σ_SB * (1 - A_TH) * fᵢⱼ * Tⱼ^4
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion src/non_grav.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ function update_thermal_force!(shape::ShapeModel, A_B, ε)

## Total amount of scattered light and radiation [W/m²].
## Note that both are assumed to be isotropic.
Eᵢ = (A_B isa Real ? A_B : A_B[i]) * F_scat +isa Real ? ε : ε[i]) * σ_SB * Tᵢ^4
A_B = (A_B isa Real ? A_B : A_B[i])
ε =isa Real ? ε : ε[i])
Eᵢ = A_B * F_scat + ε * σ_SB * Tᵢ^4

## Thermal force on each face
@. shape.facets[i].force = - 2/3 * Eᵢ * aᵢ / c₀ * n̂ᵢ # The first term normal to the face
Expand Down

0 comments on commit f031538

Please sign in to comment.