mutationpp / Mutationpp

The MUlticomponent Thermodynamic And Transport library for IONized gases in C++
GNU Lesser General Public License v3.0
101 stars 58 forks source link

Mean free path computation fails for mixtures without electrons #239

Closed mgoodson-cvd closed 7 months ago

mgoodson-cvd commented 10 months ago

The computation of the mean free path fails for mixtures that do not contain electrons. It attempts to pull from Q11ee which is undefined for mixtures that do not contain electrons. The other routines that use Q11ee in this file have an initial check on if (i < m_thermo.hasElectrons()); the same will be needed here to adjust the behavior appropriately.

mgoodson-cvd commented 10 months ago

There are actually multiple bugs here. The first, as mentioned above, is that mixtures without electrons are not handled appropriately. The second is that Q11 is not indexed properly; it is using two indices into a flattened 1D array. My guess is that it used to be a matrix rather than array. The correct behavior for accessing Q11 is illustrated here.

mgoodson-cvd commented 10 months ago

@jbscoggi I'm struggling to find a reference on the computation of mean free path from collision integrals in a way similar to what you are doing here. Physically, I can see the connection between mean free path and collision integrals, but I'm not sure on the appropriate indexing for the summation when computing a "mixture" mean free path. Any clue where this originally came from?

mgoodson-cvd commented 10 months ago

Equation 17f of Gupta, Yos, Thompson and Lee (1990) note the formula for mean free path for a single species, but here they use $\overline{\Omega}_{i,i}^{2,2}$ rather than $\overline{\Omega}_{i,i}^{1,1}$ (which is related to Q11 being used in your function). Still not sure how one would do this for multiple species, other than perhaps just substituting the mixture viscosity, i.e., as obtained with Eq. 48 for thermal noneq, in to Eq 17c which relates the viscosity and the mean free path.