Skip to content

Commit

Permalink
fix massive divergence angles when ion velocity small or negative
Browse files Browse the repository at this point in the history
  • Loading branch information
archermarx committed Feb 1, 2025
1 parent c41bb52 commit 52cbabb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ EditURL = "NEWS.md"

# Release notes

## v0.18.3

### Bug fixes
- Fix indexing error in rate coefficient calculation
- Fix massive divergence angles when ion velocity is zero or negative

## v0.18.2

### New features
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "HallThruster"
uuid = "2311f341-5e6d-4941-9e3e-3ce0ae0d9ed6"
authors = ["Thomas Marks <marksta@umich.edu>"]
version = "0.18.2"
version = "0.18.3"

[deps]
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Expand Down
7 changes: 5 additions & 2 deletions src/simulation/plume.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ function update_plume_geometry!(params)
L_ch = thruster.geometry.channel_length
exit_plane_index = max(findfirst(>=(L_ch), grid.cell_centers), 1)
Tev_exit = Tev[exit_plane_index]
inv_mi = 1 / mi

for i in (exit_plane_index + 1):(grid.num_cells)
ui = sum(niui[Z, i] for Z in 1:ncharge) /
sum(ni[Z, i] for Z in 1:ncharge)
tanδ_i = sqrt(5 * e * Tev_exit / 3 / mi) / ui

tanδ[i] = max(0.0, tanδ_i)
thermal_speed = sqrt((5/3) * e * Tev_exit * inv_mi)
ui = max(ui, thermal_speed)
tanδ[i] = clamp(thermal_speed / ui, 0.0, 1.0)

avg_tan_δ = 0.5 * (tanδ[i] + tanδ[i - 1])
Δz = grid.cell_centers[i] - grid.cell_centers[i - 1]
inner_radius[i] = max(0.0, inner_radius[i - 1] - avg_tan_δ * Δz)
Expand Down

2 comments on commit 52cbabb

@archermarx
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/124144

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.18.3 -m "<description of version>" 52cbabb5bbc6b550c2c237cce0b56146756a7a8d
git push origin v0.18.3

Please sign in to comment.