PlasmaPy / PlasmaPy

An open source Python package for plasma research and education
http://docs.plasmapy.org
BSD 3-Clause "New" or "Revised" License
572 stars 337 forks source link

Refactor transport coefficient functionality #730

Open namurphy opened 4 years ago

namurphy commented 4 years ago

At present, the ClassicalTransport class in plasmapy.formulary.braginskii is pretty monolithic, which makes it harder to maintain and modify. We will need to refactor this class in order to make it less monolithic. It would be helpful to figure out use cases for how transport coefficients are used in research and plasma education in order to figure out what sort of API makes the most sense. This issue is probably going to be really difficult, so it'd be helpful to break it up into smaller pull requests.

Related to: #191, #248, #256, #308, #538, #604, #705

joglekara commented 4 years ago

Hi @namurphy !

I think I can help tackle this. I've managed to work on a couple of publications involving Braginskii transport so I can think of an API that would be helpful.

What is the best way for me to contribute, process-wise?

namurphy commented 4 years ago

Very nice to meet you, @joglekara! It would be great if you could contribute. We could begin talking about this on our Riot channel. This would also be a good topic for one of our community meetings, which are at 18 UTC on Tuesdays (info announced on Riot an hour or so before). We also have a development guide in our docs, though I've been needing to update it. If you would be able to design an API for transport coefficient functionality, we would very much appreciate it!

StanczakDominik commented 4 years ago

Or we could just discuss things in here if that's what you prefer. Thanks for offering to help with this, @joglekara, much appreciated!

It's probably best to just start floating ideas for what the API should look like, etc... I still haven't gotten any experience in transport theory since we worked on that part of the code, so I can only really help out from an external/programmer point of view.

Anything initial you have in mind for it?

joglekara commented 4 years ago

Thanks for the welcome, @StanczakDominik .

This work has been useful to me over the years.

For our work in this issue, the following components from that manuscript are relevant:

  1. Eq 7a and 7b have the transport coefficients in Braginskii's form.
  2. The normalizations for each of the coefficients is given at the top right of page 1032
  3. The Fokker-Planck solution to each of those coefficients is given at the bottom of page 1035.
  4. The parameters needed to reconstruct those coefficients are given on page 1037.

With all that said, I think a useful API would be one that returns each/any of those coefficients as a function of (n_e, T_e, Z, B).

I'm envisioning storing that table from 1037 in plain text, loading it in numpy, and just using their best-fit equations from 1035 to reconstruct the normalized transport coefficients, unnormalize, and return.

StanczakDominik commented 4 years ago

While we're going through this, one further thing to note here:

I also started thinking about potentially maybe tackling this issue sometime in the future.