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

mise a jour avant la fermeture

parent ddc586e5
No related branches found
No related tags found
No related merge requests found
...@@ -166,14 +166,15 @@ int main(int argc, char *argv[]) ...@@ -166,14 +166,15 @@ int main(int argc, char *argv[])
double c = 0.; double c = 0.;
c = finite_volumes_diffusion.conservatif(unknowns); c = finite_volumes_diffusion.conservatif(unknowns);
/*
const Kokkos::View<const Rd*> xj = mesh_data.xj(); const Kokkos::View<const Rd*> xj = mesh_data.xj();
int size = 3000; int size = 3000;
std::vector<std::vector<double>> x(size, std::vector<double>(mesh.numberOfCells())); std::vector<std::vector<double>> x(size, std::vector<double>(mesh.numberOfCells()));
std::vector<std::vector<double>> rho_marche(size, std::vector<double>(mesh.numberOfCells())); std::vector<std::vector<double>> rho_marche(size, std::vector<double>(mesh.numberOfCells()));
std::vector<double> tempo(size); std::vector<double> tempo(size);
int i = 0; int i = 0;
*/
/*
// Ecriture des valeurs initiales dans un fichier // Ecriture des valeurs initiales dans un fichier
const Kokkos::View<const Rd*> xj = mesh_data.xj(); const Kokkos::View<const Rd*> xj = mesh_data.xj();
...@@ -270,7 +271,7 @@ int main(int argc, char *argv[]) ...@@ -270,7 +271,7 @@ int main(int argc, char *argv[])
} }
} }
diff.close(); diff.close();
*/
while((t<tmax) and (iteration<itermax)) { while((t<tmax) and (iteration<itermax)) {
...@@ -322,10 +323,10 @@ int main(int argc, char *argv[]) ...@@ -322,10 +323,10 @@ int main(int argc, char *argv[])
++iteration; ++iteration;
std::cout << "temps t : " << t << std::endl; std::cout << "temps t : " << t << std::endl;
/*
// ECRITURE DANS UN FICHIER // ECRITURE DANS UN FICHIER
if ((std::fmod(t,0.01) < 0.0001) or (t == tmax)) { if ((std::fmod(t,0.001) < 0.0001) or (t == tmax)) {
std::string ligne; std::string ligne;
...@@ -541,12 +542,12 @@ int main(int argc, char *argv[]) ...@@ -541,12 +542,12 @@ int main(int argc, char *argv[])
riffout.close(); riffout.close();
} }
*/
// ENTROPY TEST // ENTROPY TEST
//finite_volumes_diffusion.entropie(unknowns); //finite_volumes_diffusion.entropie(unknowns);
/*
// STOCKAGE COORDONNES ET TEMPS // STOCKAGE COORDONNES ET TEMPS
for (size_t j=0; j<mesh.numberOfCells(); ++j) { for (size_t j=0; j<mesh.numberOfCells(); ++j) {
x[i][j] = xj[j][0]; x[i][j] = xj[j][0];
...@@ -554,11 +555,12 @@ int main(int argc, char *argv[]) ...@@ -554,11 +555,12 @@ int main(int argc, char *argv[])
} }
tempo[i] = t; tempo[i] = t;
i = i + 1; i = i + 1;
*/
} }
std::cout << "i = " << i << std::endl; //std::cout << "i = " << i << std::endl;
std::cout << "* " << rang::style::underline << "Final time" << rang::style::reset std::cout << "* " << rang::style::underline << "Final time" << rang::style::reset
<< ": " << rang::fgB::green << t << rang::fg::reset << " (" << iteration << " iterations)\n"; << ": " << rang::fgB::green << t << rang::fg::reset << " (" << iteration << " iterations)\n";
...@@ -574,7 +576,7 @@ int main(int argc, char *argv[]) ...@@ -574,7 +576,7 @@ int main(int argc, char *argv[])
fout << ' ' << '\n'; fout << ' ' << '\n';
} }
*/ */
/*
std::ofstream fout("cararho"); std::ofstream fout("cararho");
fout.precision(15); fout.precision(15);
for (int j=0; j<mesh.numberOfCells(); ++j) { for (int j=0; j<mesh.numberOfCells(); ++j) {
...@@ -588,7 +590,7 @@ int main(int argc, char *argv[]) ...@@ -588,7 +590,7 @@ int main(int argc, char *argv[])
fout << ' ' << '\n'; fout << ' ' << '\n';
} }
} }
*/
/* /*
double error1 = 0.; double error1 = 0.;
...@@ -602,7 +604,7 @@ int main(int argc, char *argv[]) ...@@ -602,7 +604,7 @@ int main(int argc, char *argv[])
std::cout << "* " << rang::style::underline << "Erreur L infini rho" << rang::style::reset std::cout << "* " << rang::style::underline << "Erreur L infini rho" << rang::style::reset
<< ": " << rang::fgB::green << error2 << rang::fg::reset << " \n"; << ": " << rang::fgB::green << error2 << rang::fg::reset << " \n";
*/
double err0 = 0.; double err0 = 0.;
err0 = finite_volumes_diffusion.error_L1_u(unknowns, tmax); err0 = finite_volumes_diffusion.error_L1_u(unknowns, tmax);
...@@ -640,7 +642,7 @@ int main(int argc, char *argv[]) ...@@ -640,7 +642,7 @@ int main(int argc, char *argv[])
std::cout << "* " << rang::style::underline << "Erreur L infini E" << rang::style::reset std::cout << "* " << rang::style::underline << "Erreur L infini E" << rang::style::reset
<< ": " << rang::fgB::green << error5 << rang::fg::reset << " \n"; << ": " << rang::fgB::green << error5 << rang::fg::reset << " \n";
*/
std::cout << "* " << rang::style::underline << "Resultat conservativite rho E temps = 0" << rang::style::reset std::cout << "* " << rang::style::underline << "Resultat conservativite rho E temps = 0" << rang::style::reset
<< ": " << rang::fgB::green << c << rang::fg::reset << " \n"; << ": " << rang::fgB::green << c << rang::fg::reset << " \n";
...@@ -668,6 +670,26 @@ int main(int argc, char *argv[]) ...@@ -668,6 +670,26 @@ int main(int argc, char *argv[])
} }
} }
{ // gnuplot output for pression
const Kokkos::View<const Rd*> xj = mesh_data.xj();
const Kokkos::View<const double*> pj = unknowns.pj();
std::ofstream fout("p");
fout.precision(15);
for (size_t j=0; j<mesh.numberOfCells(); ++j) {
fout << xj[j][0] << ' ' << pj[j] << '\n';
}
}
{ // gnuplot output for internal energy
const Kokkos::View<const Rd*> xj = mesh_data.xj();
const Kokkos::View<const double*> ej = unknowns.ej();
std::ofstream fout("e");
fout.precision(15);
for (size_t j=0; j<mesh.numberOfCells(); ++j) {
fout << xj[j][0] << ' ' << ej[j] << '\n';
}
}
{ // gnuplot output for vitesse { // gnuplot output for vitesse
const Kokkos::View<const Rd*> xj = mesh_data.xj(); const Kokkos::View<const Rd*> xj = mesh_data.xj();
const Kokkos::View<const Rd*> uj = unknowns.uj(); const Kokkos::View<const Rd*> uj = unknowns.uj();
...@@ -676,12 +698,12 @@ int main(int argc, char *argv[]) ...@@ -676,12 +698,12 @@ int main(int argc, char *argv[])
fout.precision(15); fout.precision(15);
for (size_t j=0; j<mesh.numberOfCells(); ++j) { for (size_t j=0; j<mesh.numberOfCells(); ++j) {
fout << xj[j][0] << ' ' << uj[j][0] << ' ' << std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2) <<'\n'; //cas k constant //fout << xj[j][0] << ' ' << uj[j][0] << ' ' << std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2) <<'\n'; //cas k constant
//fout << xj[j][0] << ' ' << uj[j][0] << ' ' << std::sin(pi*xj[j][0])*std::exp(-tmax) <<'\n'; // cas k non constant //fout << xj[j][0] << ' ' << uj[j][0] << ' ' << std::sin(pi*xj[j][0])*std::exp(-tmax) <<'\n'; // cas k non constant
//fout << xj[j][0] << ' ' << uj[j][0] << ' ' << -(xj[j][0]*tmax)/((50./9.)-tmax*tmax) << '\n'; // kidder //fout << xj[j][0] << ' ' << uj[j][0] << ' ' << -(xj[j][0]*tmax)/((50./9.)-tmax*tmax) << '\n'; // kidder
//fout << xj[j][0] << ' ' << uj[j][0] << ' ' << xj[j][0] << std::endl; //fout << xj[j][0] << ' ' << uj[j][0] << ' ' << xj[j][0] << std::endl;
//fout << xj[j][0] << ' ' << uj[j][0] << '\n'; fout << xj[j][0] << ' ' << uj[j][0] << '\n';
} }
} }
...@@ -694,12 +716,12 @@ int main(int argc, char *argv[]) ...@@ -694,12 +716,12 @@ int main(int argc, char *argv[])
fout.precision(15); fout.precision(15);
for (size_t j=0; j<mesh.numberOfCells(); ++j) { for (size_t j=0; j<mesh.numberOfCells(); ++j) {
fout << xj[j][0] << ' ' << Ej[j] << ' ' << (-(std::cos(pi*xj[j][0])*std::cos(pi*xj[j][0]))+(std::sin(pi*xj[j][0])*std::sin(pi*xj[j][0])))*0.5*(std::exp(-4.*pi*pi*0.2)-1.) + 2. <<'\n'; // cas k constant //fout << xj[j][0] << ' ' << Ej[j] << ' ' << (-(std::cos(pi*xj[j][0])*std::cos(pi*xj[j][0]))+(std::sin(pi*xj[j][0])*std::sin(pi*xj[j][0])))*0.5*(std::exp(-4.*pi*pi*0.2)-1.) + 2. <<'\n'; // cas k constant
//fout << xj[j][0] << ' ' << Ej[j] << ' ' << ((xj[j][0]*pi*pi*0.5)*(std::sin(pi*xj[j][0])*std::sin(pi*xj[j][0]) - std::cos(xj[j][0]*pi)*std::cos(pi*xj[j][0])) - pi*0.5*std::sin(pi*xj[j][0])*std::cos(pi*xj[j][0]))*(std::exp(-2.*tmax)-1.) + 2. <<'\n' ; // cas k non constant //fout << xj[j][0] << ' ' << Ej[j] << ' ' << ((xj[j][0]*pi*pi*0.5)*(std::sin(pi*xj[j][0])*std::sin(pi*xj[j][0]) - std::cos(xj[j][0]*pi)*std::cos(pi*xj[j][0])) - pi*0.5*std::sin(pi*xj[j][0])*std::cos(pi*xj[j][0]))*(std::exp(-2.*tmax)-1.) + 2. <<'\n' ; // cas k non constant
//fout << xj[j][0] << ' ' << Ej[j] << ' ' << (std::sqrt((3.*((xj[j][0]*xj[j][0])/(h*h)) + 100.)/100.)/h)*(std::sqrt((3.*((xj[j][0]*xj[j][0])/(h*h)) + 100.)/100.)/h) + (-(xj[j][0]*tmax)/((50./9.)-tmax*tmax))*(-(xj[j][0]*tmax)/((50./9.)-tmax*tmax))*0.5 << '\n'; // kidder //fout << xj[j][0] << ' ' << Ej[j] << ' ' << (std::sqrt((3.*((xj[j][0]*xj[j][0])/(h*h)) + 100.)/100.)/h)*(std::sqrt((3.*((xj[j][0]*xj[j][0])/(h*h)) + 100.)/100.)/h) + (-(xj[j][0]*tmax)/((50./9.)-tmax*tmax))*(-(xj[j][0]*tmax)/((50./9.)-tmax*tmax))*0.5 << '\n'; // kidder
//fout << xj[j][0] << ' ' << Ej[j] << ' ' << xj[j][0]*xj[j][0]*0.5 + 2.*xj[j][0] + tmax + 1. << std::endl; //fout << xj[j][0] << ' ' << Ej[j] << ' ' << xj[j][0]*xj[j][0]*0.5 + 2.*xj[j][0] + tmax + 1. << std::endl;
//fout << xj[j][0] << ' ' << Ej[j] << '\n'; fout << xj[j][0] << ' ' << Ej[j] << '\n';
} }
} }
......
...@@ -124,17 +124,18 @@ private: ...@@ -124,17 +124,18 @@ private:
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) = -((kR(0)/Vj(m_mesh.numberOfCells()-1) + kj(cell_here)/Vj(cell_here))/(1./Vj(cell_here) + 1./Vj(m_mesh.numberOfCells()-1)))*(1./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)/Vj(m_mesh.numberOfCells()-1) + kj(cell_here)/Vj(cell_here))/(1./Vj(cell_here) + 1./Vj(m_mesh.numberOfCells()-1)))*(1./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)));
// Kidder // Kidder
// k = 0.5 // k = 0.5
//m_Fl(0,0) = -(t/((50./9.)-t*t))*0.5; //m_Fl(0,0) = -(t/((50./9.)-t*t))*0.5;
//m_Fl(m_mesh.numberOfFaces()-1,0) = -(t/((50./9.)-t*t))*0.5; //m_Fl(m_mesh.numberOfFaces()-1,0) = -(t/((50./9.)-t*t))*0.5;
/*
// k = x // k = x
//double h = std::sqrt(1. - (t*t)/(50./9.)); double h = std::sqrt(1. - (t*t)/(50./9.));
//m_Fl(0,0) = -(t/((50./9.)-t*t))*h*x0[0][0]; m_Fl(0,0) = -(t/((50./9.)-t*t))*h*x0[0][0];
//m_Fl(m_mesh.numberOfFaces()-1,0) = -(t/((50./9.)-t*t))*h*xmax[0][0]; m_Fl(m_mesh.numberOfFaces()-1,0) = -(t/((50./9.)-t*t))*h*xmax[0][0];
*/
// k = 0 // k = 0
//m_Fl(0,0) = 0.; //m_Fl(0,0) = 0.;
//m_Fl(m_mesh.numberOfFaces()-1,0) = 0.; //m_Fl(m_mesh.numberOfFaces()-1,0) = 0.;
...@@ -245,6 +246,7 @@ private: ...@@ -245,6 +246,7 @@ private:
m_Bl(m_mesh.numberOfFaces()-1) = -(nuR(0) + nuj(cell_here))*(1/(2.*Vl(m_mesh.numberOfFaces()-1)))*(Tj(cell_here) - TR(0)); m_Bl(m_mesh.numberOfFaces()-1) = -(nuR(0) + nuj(cell_here))*(1/(2.*Vl(m_mesh.numberOfFaces()-1)))*(Tj(cell_here) - TR(0));
//m_Bl(m_mesh.numberOfFaces()-1) = (nuR(0)/Vj(m_mesh.numberOfCells()-1) + nuj(cell_here)/Vj(cell_here))/(1./Vj(m_mesh.numberOfCells()-1) + 1./Vj(cell_here))*((Tj(cell_here)-TR(0))/Vl(m_mesh.numberOfFaces()-1)); //m_Bl(m_mesh.numberOfFaces()-1) = (nuR(0)/Vj(m_mesh.numberOfCells()-1) + nuj(cell_here)/Vj(cell_here))/(1./Vj(m_mesh.numberOfCells()-1) + 1./Vj(cell_here))*((Tj(cell_here)-TR(0))/Vl(m_mesh.numberOfFaces()-1));
// Kiddder // Kiddder
/* /*
// nu = (1+x)*0.5 // nu = (1+x)*0.5
...@@ -449,7 +451,7 @@ public: ...@@ -449,7 +451,7 @@ public:
const Kokkos::View<const double*> Vj = m_mesh_data.Vj(); const Kokkos::View<const double*> Vj = m_mesh_data.Vj();
const Kokkos::View<const Rd**> Cjr = m_mesh_data.Cjr(); const Kokkos::View<const Rd**> Cjr = m_mesh_data.Cjr();
// double pi = 4.*std::atan(1.); double pi = 4.*std::atan(1.);
double h = std::sqrt(1. - (t*t)/(50./9.)); double h = std::sqrt(1. - (t*t)/(50./9.));
// CL en diffusion pure // CL en diffusion pure
...@@ -472,8 +474,8 @@ public: ...@@ -472,8 +474,8 @@ public:
// Mise a jour de la vitesse et de l'energie totale specifique // Mise a jour de la vitesse et de l'energie totale specifique
const Kokkos::View<const double*> inv_mj = unknowns.invMj(); const Kokkos::View<const double*> inv_mj = unknowns.invMj();
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j) { Kokkos::parallel_for(m_mesh.numberOfCells()-2, KOKKOS_LAMBDA(const int& j0) {
//const int j = j0+1; const int j = j0+1;
Rd momentum_fluxes = zero; Rd momentum_fluxes = zero;
double energy_fluxes = 0.; double energy_fluxes = 0.;
Rd trich = zero; Rd trich = zero;
...@@ -594,9 +596,9 @@ public: ...@@ -594,9 +596,9 @@ public:
double err_u = 0.; double err_u = 0.;
double exact_u = 0.; double exact_u = 0.;
for (size_t j=0; j<m_mesh.numberOfCells(); ++j) { for (size_t j=0; j<m_mesh.numberOfCells(); ++j) {
exact_u = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2); // solution exacte cas test k constant //exact_u = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2); // solution exacte cas test k constant
//exact_u = std::sin(pi*xj[j][0])*std::exp(-t); // solution exacte cas test k non constant //exact_u = std::sin(pi*xj[j][0])*std::exp(-t); // solution exacte cas test k non constant
//exact_u = -(xj[j][0]*t)/((50./9.)-t*t); // kidder exact_u = -(xj[j][0]*t)/((50./9.)-t*t); // kidder
//exact_u = xj[j][0]; //exact_u = xj[j][0];
err_u += (exact_u - uj[j][0])*(exact_u - uj[j][0])*Vj(j); err_u += (exact_u - uj[j][0])*(exact_u - uj[j][0])*Vj(j);
} }
...@@ -616,8 +618,8 @@ public: ...@@ -616,8 +618,8 @@ public:
double err_E = 0.; double err_E = 0.;
double exact_E = 0.; double exact_E = 0.;
for (size_t j=0; j<m_mesh.numberOfCells(); ++j) { for (size_t j=0; j<m_mesh.numberOfCells(); ++j) {
exact_E = (-(std::cos(pi*xj[j][0])*std::cos(pi*xj[j][0]))+(std::sin(pi*xj[j][0])*std::sin(pi*xj[j][0])))*0.5*(std::exp(-4.*pi*pi*0.2)-1.) + 2.; //exact_E = (-(std::cos(pi*xj[j][0])*std::cos(pi*xj[j][0]))+(std::sin(pi*xj[j][0])*std::sin(pi*xj[j][0])))*0.5*(std::exp(-4.*pi*pi*0.2)-1.) + 2.;
//exact_E = ((xj[j][0]*pi*pi*0.5)*(std::sin(pi*xj[j][0])*std::sin(pi*xj[j][0]) - std::cos(xj[j][0]*pi)*std::cos(pi*xj[j][0])) - pi*0.5*std::sin(pi*xj[j][0])*std::cos(pi*xj[j][0]))*(std::exp(-2.*t)-1.) + 2.; exact_E = ((xj[j][0]*pi*pi*0.5)*(std::sin(pi*xj[j][0])*std::sin(pi*xj[j][0]) - std::cos(xj[j][0]*pi)*std::cos(pi*xj[j][0])) - pi*0.5*std::sin(pi*xj[j][0])*std::cos(pi*xj[j][0]))*(std::exp(-2.*t)-1.) + 2.;
//exact_E = xj[j][0]*xj[j][0]*0.5 + 2.*xj[j][0] + 1. + t; //exact_E = xj[j][0]*xj[j][0]*0.5 + 2.*xj[j][0] + 1. + t;
err_E += (exact_E - Ej[j])*(exact_E - Ej[j])*Vj(j); err_E += (exact_E - Ej[j])*(exact_E - Ej[j])*Vj(j);
} }
...@@ -634,7 +636,6 @@ public: ...@@ -634,7 +636,6 @@ public:
const Kokkos::View<const Rd*> xj = m_mesh_data.xj(); const Kokkos::View<const Rd*> xj = m_mesh_data.xj();
//double pi = 4.*std::atan(1.);
double h = std::sqrt(1. - (t*t)/(50./9.)); double h = std::sqrt(1. - (t*t)/(50./9.));
double exacte = std::sqrt((4.*((xj[0][0]*xj[0][0])/(h*h)) + 100.-(xj[0][0]*xj[0][0])/(h*h))/100.)/h; double exacte = std::sqrt((4.*((xj[0][0]*xj[0][0])/(h*h)) + 100.-(xj[0][0]*xj[0][0])/(h*h))/100.)/h;
double erreur = std::abs(exacte - rhoj[0]); double erreur = std::abs(exacte - rhoj[0]);
......
...@@ -336,7 +336,7 @@ public: ...@@ -336,7 +336,7 @@ public:
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){ Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
//m_kj[j] = xj[j][0]; //m_kj[j] = xj[j][0];
//m_kj[j] = 0.; m_kj[j] = 0.;
/* /*
// Sod // Sod
...@@ -364,7 +364,7 @@ public: ...@@ -364,7 +364,7 @@ public:
//m_kj[j] = 0.0007; //m_kj[j] = 0.0007;
// Re = 10 000 // Re = 10 000
//m_kj[j] = 0.00014; m_kj[j] = 0.00014;
// Re = 100 000 // Re = 100 000
//m_kj[j] = 0.000014; //m_kj[j] = 0.000014;
...@@ -374,12 +374,12 @@ public: ...@@ -374,12 +374,12 @@ public:
} }
} }
*/ */
/*
// k regulier // k regulier
int n = 1; int n = 1;
m_kj[j] = std::exp(1.)*std::exp(-1./(1.-( (xj[j][0]-(0.7+0.1/n)) / (0.1/n) )*( (xj[j][0]-(0.7+0.1/n)) / (0.1/n) ))) * (xj[j][0]>0.7)*(xj[j][0]<0.7+0.1/n) + std::exp(1.)*std::exp(-1./(1.-( (xj[j][0]-(0.9-0.1/n)) / (0.1/n) )*( (xj[j][0]-(0.9-0.1/n)) / (0.1/n) ))) * (xj[j][0]>0.9-0.1/n)*(xj[j][0]<0.9) + (xj[j][0]>0.7+0.1/n)*(xj[j][0]<0.9-0.1/n); m_kj[j] = std::exp(1.)*std::exp(-1./(1.-( (xj[j][0]-(0.7+0.1/n)) / (0.1/n) )*( (xj[j][0]-(0.7+0.1/n)) / (0.1/n) ))) * (xj[j][0]>0.7)*(xj[j][0]<0.7+0.1/n) + std::exp(1.)*std::exp(-1./(1.-( (xj[j][0]-(0.9-0.1/n)) / (0.1/n) )*( (xj[j][0]-(0.9-0.1/n)) / (0.1/n) ))) * (xj[j][0]>0.9-0.1/n)*(xj[j][0]<0.9) + (xj[j][0]>0.7+0.1/n)*(xj[j][0]<0.9-0.1/n);
m_kj[j] = 0.14*m_kj[j]; m_kj[j] = 0.014*m_kj[j];
*/
}); });
...@@ -398,17 +398,6 @@ public: ...@@ -398,17 +398,6 @@ public:
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){ Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
//m_nuj(j) = 0.5*(1.+xj[j][0]); //m_nuj(j) = 0.5*(1.+xj[j][0]);
m_nuj(j) = 0.; m_nuj(j) = 0.;
/*
if (xj[j][0]<0.7) {
m_nuj[j]=0.;
} else {
if (xj[j][0]<0.9){
m_nuj[j]=0.5;
} else {
m_nuj[j]=0. ;
}
}
*/
}); });
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){ Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
...@@ -470,8 +459,8 @@ public: ...@@ -470,8 +459,8 @@ public:
}); });
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){ Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
m_kj[j] = 2.; // k constant, k = 2 //m_kj[j] = 2.; // k constant, k = 2
//m_kj[j] = xj[j][0]; // k non constant, k = x m_kj[j] = xj[j][0]; // k non constant, k = x
}); });
// Conditions aux bords de Dirichlet sur u et k // Conditions aux bords de Dirichlet sur u et k
...@@ -479,12 +468,12 @@ public: ...@@ -479,12 +468,12 @@ public:
m_uL[0] = zero; m_uL[0] = zero;
m_uR[0] = zero; m_uR[0] = zero;
//m_uR[0] = xj[0]; //m_uR[0] = xj[0];
m_kL[0] = 2.; m_kL[0] = 0.;
m_kR[0] = 2.; m_kR[0] = 1.;
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){ Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
m_nuj(j) = 0.; //m_nuj(j) = 0.;
//m_nuj(j) = 0.5*(1.+xj[j][0]); // k = x m_nuj(j) = 0.5*(1.+xj[j][0]); // k = x
}); });
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){ Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
...@@ -493,10 +482,12 @@ public: ...@@ -493,10 +482,12 @@ public:
// Conditions aux bords de Dirichlet sur T et nu // Conditions aux bords de Dirichlet sur T et nu
m_TL[0] = m_ej[0]; //m_TL[0] = m_ej[0];
m_TR[0] = m_ej[m_mesh.numberOfCells()-1]; //m_TR[0] = m_ej[m_mesh.numberOfCells()-1];
m_nuL[0] = 0.; m_TL[0] = 2.;
m_nuR[0] = 0.; m_TR[0] = 2.;
m_nuL[0] = 0.5;
m_nuR[0] = 1.;
} }
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment