61 const DoubleTab& n_f = domaine.face_normales();
62 const DoubleVect& fs = domaine.face_surfaces();
63 const IntTab& f_e = domaine.face_voisins();
64 const DoubleTab& d_bulles = pb_->get_champ(
"diametre_bulles").valeurs();
65 const DoubleTab& alpha = pb_->get_champ(
"alpha").valeurs();
67 const int nf_tot = domaine.nb_faces_tot();
75 domaine.domaine().creer_tableau_elements(pvit_elem);
81 for (
int f = 0; f < nf_tot; f ++)
84 const int c = (f_e(f,0) >= 0) ? 0 : 1 ;
85 if (f_e(f, (c == 0) ? 1 : 0 ) >= 0)
86 Process::exit(
"Error in the definition of the boundary conditions for wall laws");
87 const int e = f_e(f,c);
90 DoubleTrav u_parallel(D);
94 for (
int d = 0; d <D ; d++)
95 u_orth -= pvit_elem(e, N*d+n)*n_f(f,d)/fs(f);
96 for (
int d = 0 ; d < D ; d++)
97 u_parallel(d) = pvit_elem(e, N*d+n) - u_orth*(-n_f(f,d))/fs(f);
102 for (
int d = 0; d <D ; d++)
103 u_orth -= vit(nf_tot + e * D+d, n)*n_f(f,d)/fs(f);
104 for (
int d = 0 ; d < D ; d++)
105 u_parallel(d) = vit(nf_tot + e * D + d, n) - u_orth*(-n_f(f,d))/fs(f) ;
109 for (
int d = 0; d < D; d++)
110 residu += u_parallel(d)*n_f(f,d)/fs(f);
112 Process::exit(
"Loi_paroi_adaptative : Error in the calculation of the parallel velocity for wall laws");
113 const double norm_u_parallel = std::sqrt(domaine.dot(&u_parallel(0), &u_parallel(0)));
115 const double y_loc = (c == 0) ? domaine.dist_face_elem0(f, e) : domaine.dist_face_elem1(f, e);
116 const double y_p_loc =
calc_y_plus_loc(norm_u_parallel, nu_visc(e, n), y_loc, y_p(f, n), &d_bulles(e, 0), &alpha(e, 0));
118 y_p(f, n) = std::max(
y_p_min_, y_p_loc);
119 u_t(f, n) = y_p(f, n)*nu_visc(e, n)/y_loc;
126 const int iter_max = 20;
130 double u_tau = nu*y_p/y;
138 while( (std::fabs(
u_plus_de_y_plus(y_p, nu, y, d_bulles, alpha) - u_par/u_tau) > eps) and (step < iter_max));
140 assert ( (std::fabs(u_par/u_tau -
u_plus_de_y_plus(y_p, nu, y, d_bulles, alpha)) <
eps_y_p_*10) and (step < iter_max));