From 52c789b4b8dcd041f3df79d4865152e63952eb62 Mon Sep 17 00:00:00 2001 From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr> Date: Wed, 9 May 2018 13:46:21 +0200 Subject: [PATCH] ajout conditions aux bords dans Gl --- src/mesh/Mesh.hpp | 8 ++--- src/scheme/FiniteVolumesDiffusion.hpp | 43 ++++++++++++++------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 58b7a0520..4fb77fe85 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 760a28350..9eb4ce42f 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; -- GitLab