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

modifs sur les CL, imposition sur les flux Fl et Gl pour diffusion

parent d41c3067
No related branches found
No related tags found
No related merge requests found
...@@ -172,7 +172,7 @@ int main(int argc, char *argv[]) ...@@ -172,7 +172,7 @@ int main(int argc, char *argv[])
t += dt_euler; t += dt_euler;
// ETAPE 2 DU SPLITTING - DIFFUSION // ETAPE 2 DU SPLITTING - DIFFUSION
/*
double dt_diff = 0.4*finite_volumes_diffusion.diffusion_dt(rhoj, kj); double dt_diff = 0.4*finite_volumes_diffusion.diffusion_dt(rhoj, kj);
if (dt_euler <= dt_diff) { if (dt_euler <= dt_diff) {
...@@ -190,7 +190,7 @@ int main(int argc, char *argv[]) ...@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
} }
std::cout << "diff : " << t_diff << std::endl; std::cout << "diff : " << t_diff << std::endl;
} }
*/
// DIFFUSION PURE // DIFFUSION PURE
......
...@@ -163,7 +163,7 @@ private: ...@@ -163,7 +163,7 @@ private:
} }
*/ */
Kokkos::View<Rd*> // calcule u_r (vitesse au sommet du maillage et flux de vitesse) Kokkos::View<Rd*>
computeUr(const Kokkos::View<const Rdd*>& Ar, computeUr(const Kokkos::View<const Rdd*>& Ar,
const Kokkos::View<const Rd*>& br, const Kokkos::View<const Rd*>& br,
const double& t) { const double& t) {
...@@ -176,7 +176,9 @@ private: ...@@ -176,7 +176,9 @@ private:
Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) { Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) {
m_ur[r]=invAr(r)*br(r); m_ur[r]=invAr(r)*br(r);
}); });
m_ur[0]=zero;
// Conditions aux limites dependant du temps
m_ur[0]=(-t/((50./9.)-t*t))*xr[0];
m_ur[m_mesh.numberOfNodes()-1] = (-t/((50./9.)-t*t))*xr[m_mesh.numberOfNodes()-1]; m_ur[m_mesh.numberOfNodes()-1] = (-t/((50./9.)-t*t))*xr[m_mesh.numberOfNodes()-1];
return m_ur; return m_ur;
......
...@@ -81,7 +81,8 @@ private: ...@@ -81,7 +81,8 @@ private:
const Kokkos::View<const Rd*>& uL, const Kokkos::View<const Rd*>& uL,
const Kokkos::View<const Rd*>& uR, const Kokkos::View<const Rd*>& uR,
const Kokkos::View<const double*>& kL, const Kokkos::View<const double*>& kL,
const Kokkos::View<const double*>& kR) { const Kokkos::View<const double*>& kR,
const double& t) {
const Kokkos::View<const unsigned int**>& face_cells = m_connectivity.faceCells(); const Kokkos::View<const unsigned int**>& face_cells = m_connectivity.faceCells();
...@@ -112,7 +113,7 @@ private: ...@@ -112,7 +113,7 @@ private:
}); });
// Conditions aux bords // Conditions aux bords
/*
int cell_here = face_cells(0,0); int cell_here = face_cells(0,0);
int local_face_number_in_cell = face_cell_local_face(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))); 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)));
...@@ -121,6 +122,9 @@ private: ...@@ -121,6 +122,9 @@ private:
local_face_number_in_cell = face_cell_local_face(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))*(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))); 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)));
//m_Fl(m_mesh.numberOfFaces()-1) = -xr[m_mesh.numberOfNodes()-1][0]*(tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)) - tensorProduct(uR(0), Cjr(cell_here, local_face_number_in_cell))); //m_Fl(m_mesh.numberOfFaces()-1) = -xr[m_mesh.numberOfNodes()-1][0]*(tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)) - tensorProduct(uR(0), Cjr(cell_here, local_face_number_in_cell)));
*/
m_Fl(0,0) = -(t/((50./9.)-t*t))*xr[0][0];
m_Fl(m_mesh.numberOfFaces()-1,0) = -(t/((50./9.)-t*t))*xr[m_mesh.numberOfFaces()-1][0];
return m_Fl ; return m_Fl ;
} }
...@@ -158,11 +162,10 @@ private: ...@@ -158,11 +162,10 @@ private:
}); });
// Conditions aux bords // Conditions aux bords
m_Gl(0) = Fl(0)*uL(0); // m_Gl(0) = Fl(0)*uL(0);
m_Gl(m_mesh.numberOfFaces()-1) = Fl(m_mesh.numberOfFaces()-1)*uR(0); //m_Gl(m_mesh.numberOfFaces()-1) = Fl(m_mesh.numberOfFaces()-1)*uR(0);
//const double delta_x = 1./100.; m_Gl(0) = -(t/((50./9.)-t*t))*Fl(0)*xr(0);
//double brico = - ((xr[m_mesh.numberOfNodes()-1][0]+delta_x)*t)/((50./9.)-t*t); m_Gl(m_mesh.numberOfFaces()-1) = -(t/((50./9.)-t*t))*Fl(m_mesh.numberOfFaces()-1)*xr(m_mesh.numberOfFaces()-1);
//m_Gl[m_mesh.numberOfFaces()-1][0] = brico*Fl[m_mesh.numberOfFaces()-1](0,0);
return m_Gl ; return m_Gl ;
...@@ -198,7 +201,7 @@ private: ...@@ -198,7 +201,7 @@ private:
const Kokkos::View<const double*>& kR, const Kokkos::View<const double*>& kR,
const double& t) { const double& t) {
Kokkos::View<Rdd*> Fl = m_Fl ; Kokkos::View<Rdd*> Fl = m_Fl ;
Fl = computeFl (Cjr, uj, kj, uL, uR, kL, kR); Fl = computeFl (Cjr, uj, kj, uL, uR, kL, kR, t);
Kokkos::View<Rd*> Gl = m_Gl ; Kokkos::View<Rd*> Gl = m_Gl ;
Gl = computeGl (uj, Fl, uL, uR, t); Gl = computeGl (uj, Fl, uL, uR, t);
} }
...@@ -256,8 +259,6 @@ public: ...@@ -256,8 +259,6 @@ public:
dt_j[j]= 0.5*rhoj(j)*Vj(j)*(1./(2.*kj(j) + sum))*minVl; dt_j[j]= 0.5*rhoj(j)*Vj(j)*(1./(2.*kj(j) + sum))*minVl;
}); });
double dt = std::numeric_limits<double>::max(); double dt = std::numeric_limits<double>::max();
...@@ -287,7 +288,7 @@ public: ...@@ -287,7 +288,7 @@ public:
const Kokkos::View<const Rd*> xj = m_mesh_data.xj(); const Kokkos::View<const Rd*> xj = m_mesh_data.xj();
// Premiere possibilite CL (le mieux a mon avis et le plus logique) // Premiere possibilite CL (le mieux a mon avis et le plus logique)
uR[0] = (-t/((50./9.)-t*t))*xj[m_mesh.numberOfCells()-1]; //uR[0] = (-t/((50./9.)-t*t))*xj[m_mesh.numberOfCells()-1];
// Deuxieme possiblitie CL // Deuxieme possiblitie CL
Kokkos::View<const Rd*> xr = m_mesh.xr(); Kokkos::View<const Rd*> xr = m_mesh.xr();
......
...@@ -241,12 +241,11 @@ public: ...@@ -241,12 +241,11 @@ public:
// Conditions aux bords de Dirichlet sur u et k // Conditions aux bords de Dirichlet sur u et k
m_uL[0] = zero; m_uL[0] = zero;
m_uR[0] = zero; m_uR[0] = zero;
m_kL[0] = xj[0][0]; m_kL[0] = xj[0][0];
m_kR[0] = xj[m_mesh.numberOfCells()-1][0]; m_kR[0] = xj[m_mesh.numberOfCells()-1][0];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment