-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some initial refactoring #122
Conversation
…urrently pass for some reaason, but may overhaul these
issue was electron pressure coupling, which I am removing
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
==========================================
- Coverage 87.22% 84.11% -3.11%
==========================================
Files 36 36
Lines 2058 2008 -50
==========================================
- Hits 1795 1689 -106
- Misses 263 319 +56
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
I'm gonna mark this ready for review. @DecBrick, could you take a look? |
docs/src/run.md
Outdated
@@ -136,13 +136,13 @@ tasks. | |||
|
|||
### The `Solution` object | |||
|
|||
Running a simulation returns a `HallThruster.Solution` object. This mimics a DifferentialEquations `DiffEqSolution` object and has the same fields: | |||
Running a simulation returns a `HallThruster.Solution` object, which has the the same fields: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be missing context, but the "same fields" seems to still be vestigial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it is. Fixed!
# Sound speeds | ||
aL = sqrt((charge_factor * TeL + γ * kB * TL) / mi) | ||
aR = sqrt((charge_factor * TeR + γ * kB * TR) / mi) | ||
aL = sqrt((γ * kB * TL) / mi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the ions currently only have a single temperature, is it worth leaving in the left and right calculations for if an ion temperature model is eventually implemented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's what I'm currently thinking
@@ -14,7 +14,8 @@ function wall_power_loss(model::ConstantSheathPotential, U, params, i) | |||
(;z_cell, index, L_ch, config, cache) = params | |||
|
|||
ne = cache.ne[i] | |||
ϵ = U[index.nϵ, i] / ne | |||
nϵ = cache.nϵ[i] | |||
ϵ = nϵ / ne |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like nϵ is only called once in this file, could save an allocation unless it's a setup for future changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming a variable doesn't cause a memory allocation. we still need to compute \epsilon in order to get the wall power loss here
test/runtests.jl
Outdated
@@ -80,3 +90,54 @@ end | |||
end | |||
end | |||
end | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
massive comment left at the bottom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far aside from the comments above.
For future steps, with regards to the params structure, it may be good to have a method to be able to call all of its keys in a concise manner from a solution object to allow the user to be able to see what properties are saved. A native way to do this in Julia may exist, but I haven't encountered it so far.
i think |
Well it does, maybe not do a full method but make a note about that in the documentation as the documentation on what fields the object has may not always be up to date. |
I've added a |
Addresses #121 in part, as well as making some other changes to the internals.
The main goal of this is to remove the vestiges of DifferentialEquations.jl. Previously, we had used that library for timestepping, and the entire design of the code was based on that. However, that led to some awkward design choices. Now that we no longer use DifferentialEquations, I would like to restructure the code in a way that makes more sense. This PR is a draft for now.
What's changed
U
. This saves about 3% of the computational time as we have reduced the number of rows we iterate through by 1Plots
and others) so that the only heavy test dep isSymbolics
, which we use for OVS.ODEProblem
thing and associated structureStill to come (in later PRs)
params
andcache
. These were designed to work with the DifferentialEquations.jl interface, but it's difficult to see what's in there. Ideally, we'd replace with more descriptively-named structures (perhaps "simulation" and "data"?). This would be a pretty large breaking change, so perhaps we could include methods for accessing things the "old way" for a while