Skip to content
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

Open
wants to merge 71 commits into
base: master
Choose a base branch
from

Conversation

mikekryjak
Copy link
Collaborator

@mikekryjak mikekryjak commented Dec 13, 2023

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:

  • Neutral diffusion: CX, IZ
  • Electron conduction: ee
  • Ion conduction: ii
  • Ion viscosity: ii

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:

  • Resolved the sqrt(2) mistake in the electron collision time: Electron conduction kappa is wrong #234
  • Resolved incorrect kappa constant in neutral parallel conduction (previously assumed same as ions which is not correct, see Power 2023 thesis)
  • Added sheath diagnostics for particle and heat flux in source form

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:

  • Allow collisions.cxx to save individual frequencies
  • Allow hydrogenic ionisation and CX to save individual frequencies
  • [ ] Implement for Ne and ADAS reactions?
  • Allow conduction and viscosity to pick individual frequencies
  • Allow the neutral transport model to pick individual frequencies in 1D
  • Allow the neutral transport model to pick individual frequencies in 2D
  • Make sure this handles lack of collisions with an Exception
  • Test
  • Add to evolve_energy.cxx
  • Test with evolve_energy
  • Add documentation
  • Add documentation on tau_ee choice and references
  • Rename "legacy" to "multispecies", also in docs
  • Merge master into this PR
  • Separate neutral and ion parallel conduction collisionalities in evolve_pressure
  • Separate neutral and ion parallel conduction collisionalities in evolve_energy
  • Test on evolve_energy

@mikekryjak mikekryjak changed the title Allow components to pick which collisions are used for calculation Implement pure Braginskii closure May 3, 2024
@mikekryjak mikekryjak changed the title Implement pure Braginskii closure Implement pure Braginskii closure in diffusive processes May 3, 2024
mikekryjak added 6 commits May 3, 2024 11:10
- 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.
@bendudson bendudson marked this pull request as ready for review September 3, 2024 16:54
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.
@mikekryjak
Copy link
Collaborator Author

@bendudson ready for review/merge

@mikekryjak
Copy link
Collaborator Author

Wondering if renaming legacy to multispecies would be better.

@mikekryjak
Copy link
Collaborator Author

This isn't trivial to merge - it's been merged with sheath-diagnostics and had the suppress_outflow functionality implemented which have now been superseded by the implementation in parallel-sheath. I need to untangle that bit from it before we merge it in.

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 neutral_boundary)

@mikekryjak mikekryjak changed the title Implement pure Braginskii closure in diffusive processes Implement pure Braginskii closure in diffusive processes, fix bugs in conductivity, add more sheath diagnostics Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants