From 4a8c3da79c1799a8c654a1d79a3418045c1820cc Mon Sep 17 00:00:00 2001
From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr>
Date: Wed, 27 Jun 2018 15:40:15 +0200
Subject: [PATCH] correction CL pour nu, T et flux nu partial_x T

---
 src/main.cpp                              |  6 ++---
 src/scheme/FiniteVolumesDiffusion.hpp     | 27 +++++++++++++++++------
 src/scheme/FiniteVolumesEulerUnknowns.hpp |  2 +-
 3 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index e34d3e45f..f7e34b27f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -613,7 +613,7 @@ int main(int argc, char *argv[])
      const Kokkos::View<const Rd*> xj   = mesh_data.xj();
      const Kokkos::View<const double*> rhoj = unknowns.rhoj();
      double h = std::sqrt(1. - (tmax*tmax)/(50./9.));
-     std::ofstream fout("rho1600");
+     std::ofstream fout("rho");
      fout.precision(15);
      for (size_t j=0; j<mesh.numberOfCells(); ++j) {
        fout << xj[j][0] << ' ' << rhoj[j] << ' ' << std::sqrt((3.*((xj[j][0]*xj[j][0])/(h*h)) + 100.)/100.)/h << '\n'; // kidder
@@ -625,7 +625,7 @@ int main(int argc, char *argv[])
      const Kokkos::View<const Rd*> xj   = mesh_data.xj();
      const Kokkos::View<const Rd*> uj = unknowns.uj();
      double pi = 4.*std::atan(1.);
-     std::ofstream fout("u1600");
+     std::ofstream fout("u");
      fout.precision(15);
      for (size_t j=0; j<mesh.numberOfCells(); ++j) {
 
@@ -642,7 +642,7 @@ int main(int argc, char *argv[])
      const Kokkos::View<const double*> Ej = unknowns.Ej();
      //double pi = 4.*std::atan(1.);
      double h = std::sqrt(1. - (tmax*tmax)/(50./9.));
-     std::ofstream fout("E1600");
+     std::ofstream fout("E");
      fout.precision(15);
      for (size_t j=0; j<mesh.numberOfCells(); ++j) {
 
diff --git a/src/scheme/FiniteVolumesDiffusion.hpp b/src/scheme/FiniteVolumesDiffusion.hpp
index 8fa7ce14e..b178c4b13 100644
--- a/src/scheme/FiniteVolumesDiffusion.hpp
+++ b/src/scheme/FiniteVolumesDiffusion.hpp
@@ -192,7 +192,6 @@ private:
     m_Gl(0) = -(t/((50./9.)-t*t))*h*Fl(0,0)*x0(0);
     m_Gl(m_mesh.numberOfFaces()-1) = -(t/((50./9.)-t*t))*h*Fl(m_mesh.numberOfFaces()-1,0)*xmax(0);
     
-
     return m_Gl ;
 
   }
@@ -239,14 +238,20 @@ private:
       });
 
     // Conditions aux bords
-    
+    /*
     int cell_here = face_cells(0,0);
     m_Bl(0) = (nuL(0) + nuj(cell_here))*(1./(2*Vl(0)))*(Tj(cell_here) - TL(0));
     
     cell_here = face_cells(m_mesh.numberOfFaces()-1,0);
     m_Bl(m_mesh.numberOfFaces()-1) = -(nuR(0) + nuj(cell_here))*(1/(2.*Vl(m_mesh.numberOfFaces()-1)))*(Tj(cell_here) - TR(0));
-
+    */
+    
+    double h = std::sqrt(1. - (t*t)/(50./9.));
+    m_Bl(0) = ((1.+h*x0[0][0])*3.*h*x0[0][0])/(100.*h*h*h*h);
+    m_Bl(m_mesh.numberOfFaces()-1) = ((1.+h*xmax[0][0])*3.*h*xmax[0][0])/(100.*h*h*h*h);
+    
     return m_Bl ;
+
   }
 
 
@@ -413,8 +418,16 @@ public:
     //TR(0) = 2-0.5*pi*pi*(std::exp(-2.*t)-1.);
     
     // Kidder
-    TL(0) = (1./(100*h*h))*((3.*x0[0][0]*x0[0][0])/(h*h) + 100.);
-    TR(0) = (1./(100*h*h))*((3.*xmax[0][0]*xmax[0][0])/(h*h) + 100.);
+    /*
+    TL(0) = (1./(100*h*h))*((3.*h*x0[0][0]*h*x0[0][0])/(h*h) + 100.);
+    TR(0) = (1./(100*h*h))*((3.*h*xmax[0][0]*h*xmax[0][0])/(h*h) + 100.);
+    nuL(0) = (h*x0[0][0]+1.)*0.5;
+    nuR(0) = (h*xmax[0][0]+1.)*0.5;
+    uL[0] = (-h*x0[0][0]*t)/((50./9.)-t*t);
+    uR[0] = (-h*xmax[0][0]*t)/((50./9.)-t*t);
+    kL[0] = h*x0[0][0];
+    kR[0] = h*xmax[0][0] ;
+    */
 
     // Calcule les flux
     computeExplicitFluxes(uj, Cjr, kj, uL, uR, kL, kR, Tj, nuj, TL, TR, nuL, nuR, t);
@@ -431,8 +444,8 @@ public:
 
     // Mise a jour de la vitesse et de l'energie totale specifique
     const Kokkos::View<const double*> inv_mj = unknowns.invMj();
-    Kokkos::parallel_for(m_mesh.numberOfCells()-2, KOKKOS_LAMBDA(const int& j0) {
-	const int j = j0+1;
+    Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j) {
+	//const int j = j0+1;
 	Rd momentum_fluxes = zero;
 	double energy_fluxes = 0.;
 	Rd trich = zero;
diff --git a/src/scheme/FiniteVolumesEulerUnknowns.hpp b/src/scheme/FiniteVolumesEulerUnknowns.hpp
index c9dcf1625..8b59faeca 100644
--- a/src/scheme/FiniteVolumesEulerUnknowns.hpp
+++ b/src/scheme/FiniteVolumesEulerUnknowns.hpp
@@ -409,7 +409,7 @@ public:
     m_TR[0] = 103./100.;
     m_nuL[0] = 0.5;
     m_nuR[0] = 1.;
-
+   
   }
   
   
-- 
GitLab