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

ajout fonction initialisation pour diffusion

parent 69263c8d
No related branches found
No related tags found
No related merge requests found
......@@ -128,32 +128,81 @@ public:
return m_kj;
}
// --- Acoustic Solver ---
// void initializeSod()
//{
// const Kokkos::View<const Rd*> xj = m_mesh_data.xj();
// Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
// if (xj[j][0]<0.5) {
// m_rhoj[j]=1;
// } else {
// m_rhoj[j]=0.125;
// }
// });
//Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
// if (xj[j][0]<0.5) {
// m_pj[j]=1;
// } else {
// m_pj[j]=0.1;
// }
// });
//Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
// m_uj[j] = zero;
// });
//Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
// m_gammaj[j] = 1.4;
// });
//BlockPerfectGas block_eos(m_rhoj, m_ej, m_pj, m_gammaj, m_cj);
//block_eos.updateEandCFromRhoP();
//Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
// m_Ej[j] = m_ej[j]+0.5*(m_uj[j],m_uj[j]);
// });
//const Kokkos::View<const double*> Vj = m_mesh_data.Vj();
//Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
// m_mj[j] = m_rhoj[j] * Vj[j];
// });
//Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
// m_inv_mj[j] = 1./m_mj[j];
// });
//Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
// m_kj[j] = 1;
// });
//}
// ------------------
void initializeSod()
{
const Kokkos::View<const Rd*> xj = m_mesh_data.xj();
double pi = 4.*std::atan(1.);
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
if (xj[j][0]<0.5) {
m_rhoj[j]=1;
} else {
m_rhoj[j]=0.125;
}
});
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
if (xj[j][0]<0.5) {
m_pj[j]=1;
} else {
m_pj[j]=0.1;
}
});
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
m_uj[j] = zero;
m_uj[j] = std::sin(pi*xj[j][0]);
});
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
m_gammaj[j] = 1.4;
m_gammaj[j] = 2.;
});
BlockPerfectGas block_eos(m_rhoj, m_ej, m_pj, m_gammaj, m_cj);
......@@ -177,6 +226,7 @@ public:
});
}
FiniteVolumesEulerUnknowns(const MeshDataType& mesh_data)
: m_mesh_data(mesh_data),
m_mesh(m_mesh_data.mesh()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment