Skip to content
Snippets Groups Projects
Commit 591811a1 authored by Fanny CHOPOT's avatar Fanny CHOPOT
Browse files

modification condition CFL dans diffusion

parent a49c4dcf
Branches
No related tags found
No related merge requests found
......@@ -154,6 +154,7 @@ int main(int argc, char *argv[])
Kokkos::View<double*> gammaj = unknowns.gammaj();
Kokkos::View<double*> cj = unknowns.cj();
Kokkos::View<double*> kj = unknowns.kj();
Kokkos::View<double*> nuj = unknowns.nuj();
Kokkos::View<Rd*> uj = unknowns.uj();
BlockPerfectGas block_eos(rhoj, ej, pj, gammaj, cj);
......@@ -312,7 +313,7 @@ int main(int argc, char *argv[])
// DIFFUSION PURE
double dt = 0.4*finite_volumes_diffusion.diffusion_dt(rhoj,kj,cj);
double dt = 0.4*finite_volumes_diffusion.diffusion_dt(rhoj,kj,nuj,cj);
if (t+dt > tmax) {
dt = tmax-t;
}
......
......@@ -311,6 +311,7 @@ public:
KOKKOS_INLINE_FUNCTION
double diffusion_dt(const Kokkos::View<const double*>& rhoj,
const Kokkos::View<const double*>& kj,
const Kokkos::View<const double*>& nuj,
const Kokkos::View<const double*>& cj) const {
Kokkos::View<double*> dt_j("dt_j", m_mesh.numberOfCells());
......@@ -336,16 +337,26 @@ public:
}
double sum = 0.;
double sum1 = 0.;
for (int m = 0; m < cell_nb_nodes(j); ++m) {
sum += kj(cell_nodes(j,m));
sum1 += nuj(cell_nodes(j,m));
}
if (sum < sum1) {
if (sum == 0.) {
dt_j[j] = std::numeric_limits<double>::max();
} else {
dt_j[j]= 0.5*rhoj(j)*Vj(j)*(1./sum)*minVl;
}
} else {
if (sum1 == 0.) {
dt_j[j] = std::numeric_limits<double>::max();
} else {
dt_j[j]= 0.5*rhoj(j)*Vj(j)*(1./sum1)*minVl;
}
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment