-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implement pure Braginskii closure in diffusive processes, fix bugs in conductivity, add more sheath diagnostics #195
base: master
Are you sure you want to change the base?
Conversation
- This allows other components to pick and choose which ones are used rather than using the total frequency all the time. I am leaving the total frequency in there to be refactored later
- The collision sums contain exactly the same collisions as they did in the past, allowing legacy behaviour. Note this means that collision_frequency != sum(collision_frequencies).
- Makes it easier to split them up later
- Collisionality mode is now a string input to allow different combinations. It will throw an exception if the string is not "legacy" or "braginskii". Still not sure if "legacy" should be called something else or not.
- This is equivalent to dirichlet(0) on velocity and momentum but Bohm based sheath heat flux output - Won't work if sheath is supersonic because velocity is hardcoded to Bohm in the ion_sum ion current calc to get vesheath. This is a bug that should be fixed in a separate PR
- Species name at the end to allow easy splitting - "div" can be a prefix for other divergence terms we save
Known shortcoming: no warning if the collision list is incomplete. For example, if you want AFN neutral diffusion, you need both CX and IZ reactions enabled and these will be picked up. If e.g. IZ is disabled, there will be no warning.
@bendudson ready for review/merge |
Wondering if renaming |
This isn't trivial to merge - it's been merged with Also note that this PR features a lot of line changes; I refactored the flux/flow calculations so that they are more clear (just like in |
Now implemented in a much simpler way using the no_flow flag from the parallel_sheath PR
Previously it was 3.9 for all non-electron species which is not correct
Intro
Closure refers to, among other things, the formulations for particle diffusion, conduction and viscosity. Standard Braginskii closure is only valid when there is only one heavy ion in the system (i.e. no impurities or other species like He and T). The current gold standard is Zhdanov closure (see Makarov 2021, 2023) which is implemented in all the other leading edge codes. Zhdanov is complicated and we don't have it yet.
In order to do a bit better than Braginskii, Hermes-3 currently keeps the Braginskii formulations but considers all enabled collisions (en, nn, ni) and charge exchange for a particular species. This at least enables some accounting of secondary ion species. However, it is likely really no substitute for Zhdanov and we must implement it as soon as we can.
While the current closure setup is better than Braginskii in a multispecies scenario, it makes code comparison and verification tricky. This PR implements the ability to switch to pure Braginskii for this reason. For neutral diffusion, the SOLPS AFN (see Horsten 2017) model considers CX and IZ rates and this is also reproduced here.
Note: To preserve reasonable collisionality in a multi-ion setup, ei and ii collisions as well as charge exchange consider all available ions.
Here are the Braginskii collision choices for each process:
This PR
This PR modifies the ways collisions are saved. Instead of dumping everything into a sum in
species["collision_frequency"]
, each collisional process is now registered under its own name, e.g.species["collision_frequencies"]["d_d+_iz"]
and each process that requires collisions must pick specific collisions out depending on whether we want to have the multispecies model or the Braginskii model.There are additional changes:
Note: the collision selector has been done in a really awful way - it needs refactoring. Unfortunately I have no time to do this right now and even though it's ugly it works, so let's merge it and raise an issue.
To do:
collisions.cxx
to save individual frequencies[ ] Implement for Ne and ADAS reactions?evolve_energy.cxx