1#ifndef MODEL_GAS_TRANSPORT_MIXTURE_AVERAGED_H_
2#define MODEL_GAS_TRANSPORT_MIXTURE_AVERAGED_H_
43 static constexpr const char*
name =
"mixture_averaged";
48 std::vector<double>
MW;
70 value.
type =
"constant";
91 double S = 1.16145 * pow(Tstar, -0.14874)
92 + 0.52487 / exp(0.77320 * Tstar)
93 + 2.16178 / exp(2.43787 * Tstar);
101 double cp =
thermo.cp_mol(T,
X, i, j, k);
102 return mu_enskog(T, n) * (
X(i, j, k, n) * cp + 1.25 *
Rg) /
MW[n];
110 if (
type ==
"constant" )
113 for (
int a = 0; a <
nspecies; ++a) {
114 double mua =
val1[a];
117 for (
int b = 0; b <
nspecies; ++b) {
118 double mub =
val1[b];
120 double ratio = pow(MWb / MWa, 0.25);
121 double mu_ratio = sqrt(mua / mub);
122 double term = sqrt(1.0 + MWa / MWb);
123 phi +=
X(i,j,k,b) * pow(1.0 + mu_ratio * ratio, 2.0) / (sqrt(8.0) * term);
125 mu_mix +=
X(i, j, k, a) * mua / phi;
128 else if (
type ==
"LJ" )
131 for (
int a = 0; a <
nspecies; ++a) {
135 for (
int b = 0; b <
nspecies; ++b) {
138 double ratio = pow(MWb / MWa, 0.25);
139 double mu_ratio = sqrt(mua / mub);
140 double term = sqrt(1.0 + MWa / MWb);
141 phi +=
X(i, j, k, b) * pow(1.0 + mu_ratio * ratio, 2.0) / (sqrt(8.0) * term);
143 mu_mix +=
X(i, j, k, a) * mua / phi;
151 if (!(mu_mix == mu_mix) ) mu_mix = 0.0;
159 if (
type ==
"constant" )
162 for (
int a = 0; a <
nspecies; ++a) {
163 double mua =
val1[a];
166 for (
int b = 0; b <
nspecies; ++b) {
167 double mub =
val1[b];
169 double ratio = pow(MWb / MWa, 0.25);
170 double mu_ratio = sqrt(mua / mub);
171 double term = sqrt(1.0 + MWa / MWb);
172 phi +=
X(i, j, k, b) * pow(1.0 + mu_ratio * ratio, 2.0) / (sqrt(8.0) * term);
174 k_mix +=
X(i, j, k, a) *
val2[a] / phi;
177 else if (
type ==
"LJ" )
180 for (
int a = 0; a <
nspecies; ++a) {
184 for (
int b = 0; b <
nspecies; ++b) {
187 double ratio = pow(MWb / MWa, 0.25);
188 double mu_ratio = sqrt(mua / mub);
189 double term = sqrt(1.0 + MWa / MWb);
190 phi +=
X(i, j, k, b) * pow(1.0 + mu_ratio * ratio, 2.0) / (sqrt(8.0) * term);
192 k_mix +=
X(i, j, k, a) *
k_eucken(T,
X, i, j, k, a) / phi;
208 for (
int a = 0; a <
nspecies; ++a) {
210 for (
int b = 0; b <
nspecies; ++b) {
211 if (a == b)
continue;
213 double sigmaAB = 0.5 * (
val1[a] +
val1[b]);
214 double epsAB = sqrt(
val2[a] *
val2[b]);
215 double Tstar = T / epsAB;
218 1.06036 / pow(Tstar, 0.15610) +
219 0.19300 / exp(0.47635 * Tstar) +
220 1.03587 / exp(1.52996 * Tstar) +
221 1.76474 / exp(3.89411 * Tstar);
224 0.0018583 * sqrt(T*T*T * (1.0 /
MW[a] + 1.0 /
MW[b])) /
225 ( (P / 101325.0) * sigmaAB*sigmaAB * omegaAB );
228 sumD +=
X(i, j, k, b) / DAB;
231 DKM(i, j, k, a) = (1.0 -
X(i, j, k ,a)) / sumD;
232 if (!(DKM(i, j, k, a) == DKM(i, j, k, a))) DKM(i, j, k, a) = 0.0;
int queryarr_required(std::string name, std::vector< T > &value, const std::source_location &location=std::source_location::current())
int query_switch(std::string name, std::initializer_list< std::pair< std::string, std::function< void()> > > cases, const std::source_location &location=std::source_location::current())
double dynamic_viscosity(double T, Set::Patch< const Set::Scalar > &X, int i, int j, int k) const
static constexpr const char * name
void diffusion_coeffs(Set::Patch< Set::Scalar > &DKM, double T, double P, Set::Patch< const Set::Scalar > &X, int i, int j, int k) const
double thermal_conductivity(double T, Set::Patch< const Set::Scalar > &X, int i, int j, int k) const
static void Parse(Mixture_Averaged &value, IO::ParmParse &pp, int a_nspecies, std::vector< double > &a_MW, Thermo::Thermo< Thermo::CpConstant > a_thermo)
double collision_integral(double Tstar) const
double mu_enskog(double T, int i) const
std::vector< double > val1
double k_eucken(double T, Set::Patch< const Set::Scalar > &X, int i, int j, int k, int n) const
std::vector< double > val2
Thermo::Thermo< Thermo::CpConstant > thermo
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, 1 > Vector
AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE void Assert(const char *file, const char *func, int line, const char *smt, bool pass, Args const &... args)
AMREX_GPU_HOST_DEVICE void Abort(const char *msg)
static Unit Temperature()