diff --git a/src/main.cpp b/src/main.cpp index 8a0dae3dec6bc199436379e5dad1b4750c5c7a64..71524b990f81526a2dfa0a0a785cbcb76802e39e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -153,9 +153,9 @@ int main(int argc, char *argv[]) BlockPerfectGas block_eos(rhoj, ej, pj, gammaj, cj); - while((t<tmax) and (iteration<1)) { + while((t<tmax) and (iteration<itermax)) { //double dt = 0.4*acoustic_solver.acoustic_dt(Vj, cj); - double dt = 0.8*finite_volumes_diffusion.diffusion_dt(rhoj, kj); + double dt = 0.4*finite_volumes_diffusion.diffusion_dt(rhoj, kj); if (t+dt>tmax) { dt=tmax-t; diff --git a/src/scheme/FiniteVolumesDiffusion.hpp b/src/scheme/FiniteVolumesDiffusion.hpp index 182871147b1fda4633e02de31398eee4ba758912..f54b291d6c9a8a2a8924993dd157ad71cc119ab3 100644 --- a/src/scheme/FiniteVolumesDiffusion.hpp +++ b/src/scheme/FiniteVolumesDiffusion.hpp @@ -107,7 +107,6 @@ private: sum3 += Vj(cell_here); } - //m_Fl(l) = ((sum2/face_nb_cells(l))/Vl(l))*sum; m_Fl(l) = ((sum2/sum3)/Vl(l))*sum; }); @@ -126,7 +125,7 @@ private: sum2 += kj(cell_here)*Vj(cell_here); sum3 += Vj(cell_here); */ - // Essai 1 OK + int cell_here = face_cells(0,0); int local_face_number_in_cell = face_cell_local_face(0,0); m_Fl(0) = -(kL(0) + kj(cell_here))*(1./(2*Vl(0)))*(tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)) - tensorProduct(uL(0), Cjr(cell_here, local_face_number_in_cell))); @@ -134,12 +133,6 @@ private: local_face_number_in_cell = face_cell_local_face(m_mesh.numberOfFaces()-1,0); m_Fl(m_mesh.numberOfFaces()-1) = -(kR(0) + kj(cell_here))*(1/(2.*Vl(m_mesh.numberOfFaces()-1)))*(tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)) - tensorProduct(uR(0), Cjr(cell_here, local_face_number_in_cell))); - double pi = 4.*std::atan(1.);; - std::ofstream fout("comparaison flux u"); - for (int l=0; l<m_mesh.numberOfFaces(); ++l) { - fout << xr[l][0] << ' ' << m_Fl[l](0,0) << ' ' << 2.*pi*cos(pi*xr[l][0])*std::exp(-2*pi*pi*0.000015625) << std::endl; - } - return m_Fl ; } @@ -171,7 +164,6 @@ private: sum2 += 1./Vj(cell_here); } - //m_Gl(l) = (1./face_nb_cells(l))*Fl(l)*sum; m_Gl(l) = (1./sum2)*Fl(l)*sum; }); @@ -179,14 +171,8 @@ private: m_Gl(0) = Fl(0)*uL(0); m_Gl(m_mesh.numberOfFaces()-1) = Fl(m_mesh.numberOfFaces()-1)*uR(0); - // affichage - double pi = 4.*std::atan(1.); - std::ofstream fout("comparaison flux E"); - for (int l=0; l<m_mesh.numberOfFaces(); ++l) { - fout << xr[l][0] << ' ' << m_Gl[l][0] << ' ' << sin(pi*xr[l][0])*2.*pi*cos(pi*xr[l][0])*std::exp(-4*pi*pi*0.000015625) << std::endl; - } - - return m_Gl ; + return m_Gl ; + } // Calcule la liste des inverse d'une liste de matrices @@ -277,14 +263,9 @@ public: }); - // for (int j=0; j<m_mesh.numberOfCells(); ++j) { - // std::cout << "dt_j[" << j << "]=" << dt_j[j] << '\n'; - // } double dt = std::numeric_limits<double>::max(); Kokkos::parallel_reduce(m_mesh.numberOfCells(), ReduceMin(dt_j), dt); - // std::cout << dt << std::endl; - // std::exit(0); return dt; }