41 int traitPth = le_fluide_->getTraitementPth();
46 double present = le_fluide_->vitesse().equation().schema_temps().temps_courant();
47 double dt = le_fluide_->vitesse().equation().schema_temps().pas_de_temps();
48 double futur = present + dt;
49 const DoubleTab& tab_tempnp1 = le_fluide_->inco_chaleur().valeurs(futur);
50 const DoubleTab& tab_tempn = le_fluide_->inco_chaleur().valeurs(present);
51 int nb_faces = le_dom->nb_faces();
58 const DoubleTab& tab_rho = le_fluide_->masse_volumique().valeurs();
60 DoubleTrav tab_tmp(tab_rho);
62 assert(tab_tmp.
size() == nb_faces);
63 const double invdt = 1. / dt;
64 CDoubleArrView tempn =
static_cast<const ArrOfDouble&
>(tab_tempn).view_ro();
65 CDoubleArrView tempnp1 =
static_cast<const ArrOfDouble&
>(tab_tempnp1).view_ro();
66 DoubleArrView tmp =
static_cast<ArrOfDouble&
>(tab_tmp).view_wo();
67 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), range_1D(0, nb_faces), KOKKOS_LAMBDA(
const int i)
69 tmp[i] *= (tempnp1[i] - tempn[i]) / tempnp1[i] * invdt;
71 end_gpu_timer(__KERNEL_NAME__);
78 Pth = Pth_n / (1 - S * dt);
83 else if (traitPth == 1)
99 double debit_u_imp = 0, debit_rho_u_imp = 0;
102 le_fluide_->calculer_masse_volumique();
106 tab_tmp.
copy(tab_tempn, RESIZE_OPTIONS::NOCOPY_NOINIT);
108 CDoubleArrView tempn =
static_cast<const ArrOfDouble&
>(tab_tempn).view_ro();
109 DoubleArrView tmp =
static_cast<ArrOfDouble&
>(tab_tmp).view_wo();
110 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), range_1D(0, nb_faces), KOKKOS_LAMBDA(
const int i)
112 tmp(i) = 1. / tempn(i);
114 end_gpu_timer(__KERNEL_NAME__);
117 CDoubleArrView tempnp1 =
static_cast<const ArrOfDouble&
>(tab_tempnp1).view_ro();
118 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), range_1D(0, nb_faces), KOKKOS_LAMBDA(
const int i)
120 tmp(i) = 1. / tempnp1(i);
122 end_gpu_timer(__KERNEL_NAME__);
126 for (
int n_bord = 0; n_bord < le_dom->nb_front_Cl(); n_bord++)
128 const Cond_lim_base& la_cl = le_dom_Cl->les_conditions_limites(n_bord).valeur();
134 int nfin = ndeb + la_front_dis.
nb_faces();
137 CDoubleTabView face_normales = le_dom->face_normales().view_ro();
138 CIntTabView face_voisins = le_dom->face_voisins().view_ro();
140 Kokkos::parallel_reduce(start_gpu_timer(__KERNEL_NAME__), range_1D(ndeb, nfin), KOKKOS_LAMBDA(
const int face,
double& debit_local)
143 for (
int d = 0; d < dim; d++)
144 debit_v += face_normales(face, d) * val_imp(face - ndeb, d) / tempnp1(face);
145 int n0 = face_voisins(face, 0);
148 debit_local += debit_v;
150 end_gpu_timer(__KERNEL_NAME__);
152 debit_rho_u_imp += debit;
154 debit_u_imp += debit;
158 Cerr << la_cl.
que_suis_je() <<
" est incompatible avec le traitement conservation_masse." << finl;
167 Pth = Pth_n * (masse_n - dt * debit_rho_u_imp) / (masse_np1 + dt * debit_u_imp);
176 const int traitPth = le_fluide_->getTraitementPth();
179 else if (traitPth == 0)
181 for (
int n_bord = 0; n_bord < le_dom->nb_front_Cl(); n_bord++)
183 const Cond_lim& la_cl = le_dom_Cl->les_conditions_limites(n_bord);
188 Cerr <<
"EDO_Pression_th_VEF_Gaz_Parfait::" << __func__ <<
" not yet coded ! Call the 911 !!" << finl;
193 const double present = le_fluide_->vitesse().equation().schema_temps().temps_courant();
194 const double dt = le_fluide_->vitesse().equation().schema_temps().pas_de_temps();
195 const double futur = present + dt;
196 const DoubleTab& tempnp1 = le_fluide_->inco_chaleur().valeurs(futur);
197 const DoubleTab& tempn = le_fluide_->inco_chaleur().valeurs(present);
198 const int nb_faces = le_dom->nb_faces();
214 double debit_u_imp = 0, debit_rho_u_imp = 0;
217 le_fluide_->calculer_masse_volumique();
221 tmp.
copy(tempn, RESIZE_OPTIONS::NOCOPY_NOINIT);
222 for (
int i = 0; i < nb_faces; i++)
223 tmp[i] = 1. / tempn[i];
225 for (
int i = 0; i < nb_faces; i++)
226 tmp[i] = 1. / tempnp1[i];
230 for (
int n_bord = 0; n_bord < le_dom->nb_front_Cl(); n_bord++)
232 const Cond_lim_base& la_cl = le_dom_Cl->les_conditions_limites(n_bord).valeur();
238 int nfin = ndeb + la_front_dis.
nb_faces();
239 for (
int face = ndeb; face < nfin; face++)
243 debit_v += le_dom->face_normales(face, d) * diri.
val_imp_au_temps(futur, face - ndeb, d) / tempnp1(face);
244 int n0 = le_dom->face_voisins(face, 0);
248 debit_rho_u_imp += debit_v;
250 debit_u_imp += debit_v;
255 Cerr << la_cl.
que_suis_je() <<
" est incompatible avec le traitement conservation_masse." << finl;
264 for (
int f = 0; f < nb_faces; f++)
265 Pth_n(f) = Pth_n(f) * (masse_n - dt * debit_rho_u_imp) / (masse_np1 + dt * debit_u_imp);