mutationpp / Mutationpp

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

does nonequilibrium density include ionization? #133

Closed CatarinaGarbacz closed 3 years ago

CatarinaGarbacz commented 4 years ago

Hi, I want to use Mutation++ to compute the density of a mixture in thermal and chemical nonequilibrium. I see we have this function available

double Thermodynamics::density(const double T, const double P, const double const X) const { double density = 0.0; for (int i = 0; i < nGas(); ++i) density += X[i] speciesMw(i); density = P / (RU T); return density; }

from my understanding, this only works if there are no electrons in the mixture since for electrons we would consider Tve instead of T. I am correct ?

Thank you

jbscoggi commented 4 years ago

Hey @CatarinaGarbacz, the easiest approach is just to use the state model that you want (Like ChemNonEqTTv) and then call the mixture.density() function after setting the state. That should be what need I think.

CatarinaGarbacz commented 4 years ago

Hi JB thanks for answering.

I am not so sure, but let me explain you better the specifics of what I'm looking for.

I want to compute the density at the flow initialization stage, where I have mass fractions, pressure and temperatures. to set the state of the mixture for the model ChemNonEqTTv, I first need to compute the density through the "nonequilibrium" equation of state (since the inputs for setstate include species densities). so I need to compute the density explicitly beforehand... and I don't see how that formula would account for electrons in the mixture... but if I'm wrong or if there's another way to account for electrons, I'm all ears :)

jbscoggi commented 4 years ago

Ah OK I understand now, yes I think that is an edge case that is not currently implemented. If the temperatures are equal, then you could just use the function you mentioned before, but if they are not, then it would not work. It should be easy enough to implement this though.

CatarinaGarbacz commented 4 years ago

makes sense! I'm not gonna implement this now since I'm full on developing on SU2, but actually I will take note of these little things that would me useful in Mutation++ and I might do it in the future, once things are more solid in SU2.

thanks again