122 const int Nk = (tab_k) ? (*tab_k).line_size() : -1;
126 std::string Type_diss =
"other";
132 DoubleTrav epsilon(alpha);
135 visc_turb.
eps(epsilon);
136 const double limiter = visc_turb.
limiteur();
139 Matrice_Morse *Ma = matrices.count(
"alpha") ? matrices.at(
"alpha") :
nullptr;
140 Matrice_Morse *Mk = matrices.count(
"k") ? matrices.at(
"k") :
nullptr;
141 Matrice_Morse *Mtau = matrices.count(
"tau") ? matrices.at(
"tau") :
nullptr;
142 Matrice_Morse *Momega = matrices.count(
"omega") ? matrices.at(
"omega") :
nullptr;
143 Matrice_Morse *Mai = matrices.count(
"interfacial_area") ? matrices.at(
"interfacial_area") :
nullptr;
149 DoubleTrav a_l(N), p_l(N), T_l(N), rho_l(N), nu_l(N), sigma_l(N,N), dv(N, N), d_bulles_l(N), eps_l(Nk), k_l(Nk), coeff(N, N);
153 DoubleTab pvit_elem(0, N * D);
154 domaine.domaine().creer_tableau_elements(pvit_elem);
158 const double fac_sec = 1.e4 ;
159 const double alpha_min = 1.e-3 ;
162 for (
int e = 0; e < domaine.nb_elem(); e++)
165 for (
int n = 0; n < N; n++)
167 a_l(n) = alpha(e, n);
168 p_l(n) = press_p(e, n * (Np > 1));
169 T_l(n) = temp_p(e, n);
170 rho_l(n) = rho_p(!cR * e, n);
171 nu_l(n) = nu_p(!cM * e, n);
172 for (
int k = 0; k < N; k++)
176 sigma_l(n, k) = sat.
sigma(temp_p(e,n), press_p(e,n * (Np > 1)));
178 d_bulles_l(n) = d_bulles(e,n);
181 for (
int n = 0; n < Nk; n++)
183 eps_l(n) =epsilon(e, n) ;
184 k_l(n) = (tab_k_p) ? (*tab_k_p)(e,n) : 0;
188 for (
int d = 0; d < D; d++)
189 for (
int n = 0; n < N; n++)
190 for (
int k = 0; k < N; k++)
191 dv(n, k) += (pvit_elem(e, N * d + n) - ((n!=k) ? pvit_elem(e, N * d + k) : 0) ) * (pvit_elem(e, N * d + n) - ((n!=k) ? pvit_elem(e, N * d + k) : 0) );
193 for (
int n = 0; n < N; n++)
194 for (
int k = 0; k < N ; k++)
195 dv(n, k) = sqrt(dv(n, k)) ;
198 correlation_rupt.
coefficient(a_l, p_l, T_l, rho_l, nu_l, sigma_l, dh, dv, d_bulles_l, eps_l, k_l, coeff);
200 for (
int k = 0; k < N ; k++)
202 double eps_valeurs {0.0};
204 if (Type_diss ==
"tau")
205 eps_valeurs =
beta_k_ * ((*tab_k)(e,
n_l)>1.e-8 ? (*tab_k)(e,
n_l)*(*tab_k)(e,
n_l)/ std::max((*tab_k)(e,
n_l) * (*tau)(e,
n_l), limiter * nu_p(e,
n_l)) : 0 );
206 else if (Type_diss ==
"omega")
207 eps_valeurs =
beta_k_ * ((*tab_k)(e,
n_l)*(*omega)(e,
n_l)) ;
209 eps_valeurs = epsilon(e,
n_l);
213 const double cbrt_6 = std::cbrt(6.);
214 const double factor_tmp = M_PI /( 3. * cbrt_6 * cbrt_6 * cbrt_6 * cbrt_6 * cbrt_6 );
215 const double fac = (alpha(e, k)>alpha_min) ? pe(e) * ve(e) * factor_tmp * coeff(k,
n_l) : 0. ;
216 const double dalpha_fac = (alpha(e, k)>alpha_min) ? pe(e) * ve(e) * factor_tmp * coeff(
n_l, k) : 0.;
217 const double ai = std::max(inco(e, k), 0.) ;
218 const double eps_1_over3 = std::cbrt(eps_valeurs) ;
219 const double ai_5_over3 = std::cbrt(ai) * std::cbrt(ai) * std::cbrt(ai) * std::cbrt(ai) * std::cbrt(ai) ;
221 const double cbrt_alpha_ek = std::cbrt(alpha(e, k));
222 const double one_overalpha_2_over3 = (alpha(e, k) > alpha_min) ? 1./std::min(cbrt_alpha_ek * cbrt_alpha_ek, fac_sec) :0. ;
223 const double one_overalpha_5_over3 = (alpha(e, k) > alpha_min) ? 1./std::min(cbrt_alpha_ek * cbrt_alpha_ek * cbrt_alpha_ek * cbrt_alpha_ek * cbrt_alpha_ek, fac_sec) : 0.;
227 secmem(e , k) += (fac > 0. ) ? fac * one_overalpha_2_over3 * alpha_p(e,
n_l) * ai_5_over3 * eps_1_over3 : 0. ;
230 (*Ma)(N * e + k , N * e + k) -= (fac > 0. ) ? fac * -2./3.* one_overalpha_5_over3 * alpha_p(e,
n_l) * ai_5_over3 * eps_1_over3 + dalpha_fac * one_overalpha_2_over3 * alpha_p(e,
n_l) * ai_5_over3 * eps_1_over3 : 0. ;
233 (*Mai)(N * e + k , N * e + k) -= (fac > 0. ) ? fac * one_overalpha_2_over3 * alpha_p(e,
n_l) * 5./3. * std::cbrt(ai) * std::cbrt(ai) * eps_1_over3 : 0. ;
236 if (Type_diss ==
"tau")
238 if ((*tab_k)(e,
n_l) * (*tau)(e,
n_l) > limiter * nu_p(e,
n_l))
241 (*Mk)(N * e + k, Nk * e +
n_l) -= (fac > 0. ) ? fac * one_overalpha_2_over3 * alpha_p(e,
n_l) * ai_5_over3 * 1./3. * std::cbrt(
beta_k_) / std::min(std::cbrt((*tab_k)(e,
n_l)) * std::cbrt((*tab_k)(e,
n_l)),fac_sec) / std::min(std::cbrt((*tau)(e,
n_l)),fac_sec) : 0.;
244 (*Mtau)(N * e + k, Nk * e +
n_l) -= (fac > 0. ) ? fac * one_overalpha_2_over3 * alpha_p(e,
n_l) * ai_5_over3 *-1./3. * std::cbrt(
beta_k_) * std::cbrt((*tab_k)(e,
n_l)) / std::min(std::cbrt((*tau)(e,
n_l)) * std::cbrt((*tau)(e,
n_l)) * std::cbrt((*tau)(e,
n_l)) * std::cbrt((*tau)(e,
n_l)),fac_sec) : 0. ;
250 (*Mk)(N * e + k, Nk * e +
n_l) -= (fac > 0. ) ? fac * one_overalpha_2_over3 * alpha_p(e,
n_l) * ai_5_over3 * 1./3. * std::cbrt(
beta_k_) / std::min(std::cbrt((*tab_k)(e,
n_l)),fac_sec) / std::min(std::cbrt(limiter * nu_p(e,
n_l)),fac_sec) : 0.;
253 if (Type_diss ==
"omega")
256 (*Momega)(N * e + k , Nk * e +
n_l) -= (fac > 0. ) ? fac * one_overalpha_2_over3 * alpha_p(e,
n_l) * ai_5_over3 * 1./3. * std::cbrt(
beta_k_) * std::cbrt((*tab_k)(e,
n_l)) / std::min(std::cbrt((*omega)(e,
n_l)) * std::cbrt((*omega)(e,
n_l)),fac_sec) : 0.;
259 (*Mk)(N * e + k , Nk * e +
n_l) -= (fac > 0. ) ? fac * one_overalpha_2_over3 * alpha_p(e,
n_l) * ai_5_over3 * 1./3. * std::cbrt(
beta_k_) / std::min(std::cbrt((*tab_k)(e,
n_l)) * std::cbrt((*tab_k)(e,
n_l)) ,fac_sec) * std::cbrt((*omega)(e,
n_l)) : 0.;