diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 58b7a052029372ad60c9f283ba723d6ac3221d74..4fb77fe85c07f23ef481ea855d965dd17da2c8cf 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -50,7 +50,7 @@ public: // pas constant - /* + Mesh(const Connectivity& connectivity) : m_connectivity(connectivity), m_xr("xr", connectivity.numberOfNodes()) @@ -60,11 +60,11 @@ public: m_xr[r][0] = r*delta_x; }); } -*/ + // pas non constant - + /* Mesh(const Connectivity& connectivity) : m_connectivity(connectivity), m_xr("xr", connectivity.numberOfNodes()) @@ -85,7 +85,7 @@ public: } }); } - + */ ~Mesh() { diff --git a/src/scheme/FiniteVolumesDiffusion.hpp b/src/scheme/FiniteVolumesDiffusion.hpp index 760a2835002771215ea02645937a5770eb10a410..9eb4ce42fcd17ea2da2fe155a1637d73c5b20ac3 100644 --- a/src/scheme/FiniteVolumesDiffusion.hpp +++ b/src/scheme/FiniteVolumesDiffusion.hpp @@ -109,31 +109,32 @@ private: //m_Fl(l) = ((sum2/face_nb_cells(l))/Vl(l))*sum; m_Fl(l) = ((sum2/sum3)/Vl(l))*sum; - // Conditions aux bords - - /* - // Essai 1 - 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))*0.5*(tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)) - tensorProduct(uL(0), Cjr(cell_here, local_face_number_in_cell))); - cell_here = face_cells(m_mesh.numberOfFaces()-1,0); - 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))*0.5*(tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)) - tensorProduct(uR(0), Cjr(cell_here, local_face_number_in_cell))); - - // Essai 2 - m_Fl(0) = -(kL(0) + kj(0))*0.5*(tensorProduct(uj(0), Cjr(0, 0))); - m_Fl(m_mesh.numberOfFaces()-1) = -(kR(0) + kj(m_mesh.numberOfCells()-1))*0.5*(tensorProduct(uj(m_mesh.numberOfCells()-1), Cjr(m_mesh.numberOfCells()-1,1))); - */ - }); + // Conditions aux bords + /* + // Essai 1 + 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))*0.5*(tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)) - tensorProduct(uL(0), Cjr(cell_here, local_face_number_in_cell))); + cell_here = face_cells(m_mesh.numberOfFaces()-1,0); + 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))*0.5*(tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)) - tensorProduct(uR(0), Cjr(cell_here, local_face_number_in_cell))); + + // Essai 2 + m_Fl(0) = -(kL(0) + kj(0))*0.5*(tensorProduct(uj(0), Cjr(0, 0))); + m_Fl(m_mesh.numberOfFaces()-1) = -(kR(0) + kj(m_mesh.numberOfCells()-1))*0.5*(tensorProduct(uj(m_mesh.numberOfCells()-1), Cjr(m_mesh.numberOfCells()-1,1))); + */ + return m_Fl ; } // Calcule un Gl Kokkos::View<Rd*> computeGl(const Kokkos::View<const Rd*>& uj, - const Kokkos::View<const Rdd*>& Fl) { + const Kokkos::View<const Rdd*>& Fl, + const Kokkos::View<const Rd*>& uL, + const Kokkos::View<const Rd*>& uR) { const Kokkos::View<const unsigned int**>& face_cells = m_connectivity.faceCells(); @@ -158,9 +159,9 @@ private: m_Gl(l) = (1./sum2)*Fl(l)*sum; }); - // Provisoire - m_Gl(0) = 0; - m_Gl(m_mesh.numberOfFaces()-1) = 0; + // Conditions aux bords + m_Gl(0) = Fl(0)*uL(0); + m_Gl(m_mesh.numberOfFaces()-1) = Fl(m_mesh.numberOfFaces()-1)*uR(0); return m_Gl ; } @@ -196,7 +197,7 @@ private: Kokkos::View<Rdd*> Fl = m_Fl ; Fl = computeFl (Cjr, uj, kj, uL, uR, kL, kR); Kokkos::View<Rd*> Gl = m_Gl ; - Gl = computeGl (uj, Fl ); + Gl = computeGl (uj, Fl, uL, uR); } Kokkos::View<Rdd*> m_Fl;