Cantera / enhancements

Repository for proposed and ongoing enhancements to Cantera
11 stars 5 forks source link

Add to documentation: multi_diff_coeffs #143

Closed marina8888 closed 2 years ago

marina8888 commented 2 years ago

Abstract

Suggestion to add to documentation the orientation of species for multi-component diffusion coefficients in the Transport class.

Motivation

Multicomponent diffusion coefficients are useful in studying the contributions of diffusive flux to species. At present cantera prints a matrix of multicomponent diffusion coefficients of species k within species j. However, these are not interchangeable (i.e species j within species k does not give the same value). Therefore, it would help in the documentation to know the orientation of species j and k on the axis.

Possible Solutions

N/A

References

Used for calculations in relation to Fickian and Soret diffusion components. e.g https://www.sciencedirect.com/science/article/abs/pii/S0010218009002764?via%3Dihub

If this improvement request is not accepted, please could it be possible to ask about the orientation in the comments? Thank you in advance for your help and support with this request.

decaluwe commented 2 years ago

Hi @marina8888 Thanks for this suggestion - I just did some digging and agree that there is not much documentation (mainly just a suggestion to check out R. Kee's "Chemically Reacting Flow" text book).

One question: what type of documentation are you asking about here?

  1. Documentation in the header files include/cantera/transport/MultiTransport.h
  2. Documentation on the website (e.g., somewhere like https://cantera.org/science/phases.html),
  3. Somewhere else (such as Doxygen)?

My inclination would be to start with the website's "Science" section (which I've been meaning to overhaul, for some time, anyway), but just wondering what you had in mind.

Thanks, Steven

marina8888 commented 2 years ago

Hi @decaluwe, thank you for the response. I have added a file below on what is printed when using the multi_diff_coeffs function in the python interface.

Since the coefficient values are not interchangeable (i.e coefficient value of species j in k vs species k in j are not the same), I have found it difficult to understand whether it is the diffusion coefficient of species [row index] in species [column index] or the other way around. I don't believe detailed documentation is necessary, but just one sentence to say species k [row] in species j [column] would suffice, I believe.

I am not sure about implementation across other interfaces, but I will try to look through the C files to see if I can find a comment on this.

marina8888 commented 2 years ago

multi_diff_example.csv

decaluwe commented 2 years ago

I would generally think that your intuition above is correct: D_[row][column] is the coefficient of species [row index] in species [column index], but agree that some explanation would be helpful.

My question is: where would it be most helpful for this to be provided?

From your posts, maybe you mean this:

For a Cantera solution object g, you want the output of help(g.__class__.multi_diff_coeffs) to give this info.

Is that correct?

marina8888 commented 2 years ago

I agree, yes, in the object g.class.multi_diff_coeffs that would be the best place. Thank you very much for taking the time to look into this request. It was difficult for me to be confident in the order without it being explicitly mentioned in the documentation.

FYI for future reference - coefficient order - @gotama721

decaluwe commented 2 years ago

@marina8888 can you clarify - is the information you want:

marina8888 commented 2 years ago

@decaluwe I just saw the change in the documentation. Apologies for the late reply and thank you for very much for checking the orientation and making the change.