diff --git a/src/scheme/FiniteVolumesEulerUnknowns.hpp b/src/scheme/FiniteVolumesEulerUnknowns.hpp index b7ba56098c34816cd476696c88da7803a4475b4a..96278145bda4f445b14d73fbc2864671bccdb72a 100644 --- a/src/scheme/FiniteVolumesEulerUnknowns.hpp +++ b/src/scheme/FiniteVolumesEulerUnknowns.hpp @@ -353,7 +353,7 @@ public: Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){ // Differents k (xi) //m_kj[j] = xj[j][0]; - m_kj[j] = 0.014; + //m_kj[j] = 0.014; // TAC @@ -392,11 +392,11 @@ public: */ // k regulier - /* + 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] = 0.00014*m_kj[j]; - */ + m_kj[j] = 0.014*m_kj[j]; + }); @@ -408,8 +408,8 @@ public: m_uL[0] = zero; m_uR[0] = zero; - m_kL[0] = 0.014; - m_kR[0] = 0.014; + m_kL[0] = 0.; + m_kR[0] = 0.; Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){ diff --git a/src/scheme/Montee.hpp b/src/scheme/Montee.hpp index 80ad3cb3ef3be2859e03a40b345a5f3bb2b49c30..37bd0df0b0dd0ffebd1def75b3dff3d56c3580c5 100644 --- a/src/scheme/Montee.hpp +++ b/src/scheme/Montee.hpp @@ -152,31 +152,25 @@ private: const int J = node_cells(r,j); const int R = node_cell_local_node(r,j); - if ((r == 0) or (r == m_mesh.numberOfNodes()-1)) { - - br += Ajr(J,R)*uj(J) + pj(J)*Cjr(J,R); - - } else { - - for (int l=0; l<cell_nb_nodes(J); ++l) { - double sum_p = 0.; - double sum_u = 0.; - double sum = 0.; - int k = cell_nodes(J,l); - - for (int i=0; i<node_nb_cells(k); ++i) { - int cell_here = node_cells(k,i); - sum_p += (1./Vj(cell_here))*pj(cell_here); - sum_u += (1./Vj(cell_here))*uj[cell_here][0]; - sum += 1./Vj(cell_here); - } + for (int l=0; l<cell_nb_nodes(J); ++l) { + double sum_p = 0.; + double sum_u = 0.; + double sum = 0.; + int k = cell_nodes(J,l); - stock_p[l] = sum_p/sum; - stock_u[l] = sum_u/sum; + for (int i=0; i<node_nb_cells(k); ++i) { + int cell_here = node_cells(k,i); + sum_p += (1./Vj(cell_here))*pj(cell_here); + sum_u += (1./Vj(cell_here))*uj[cell_here][0]; + sum += 1./Vj(cell_here); } - - br += Ajr(J,R)*(uj(J) + (stock_u[1]-stock_u[0])/Vj(J)*(xr[r]-xj[J])) + (pj(J) + (stock_p[1]-stock_p[0])/Vj(J)*(xr[r][0]-xj[J][0]))*Cjr(J,R); + + stock_p[l] = sum_p/sum; + stock_u[l] = sum_u/sum; } + + br += Ajr(J,R)*(uj(J) + (stock_u[1]-stock_u[0])/Vj(J)*(xr[r]-xj[J])) + (pj(J) + (stock_p[1]-stock_p[0])/Vj(J)*(xr[r][0]-xj[J][0]))*Cjr(J,R); + } }); @@ -241,12 +235,6 @@ private: for (int r=0; r<cell_nb_nodes[j]; ++r) { int R = cell_nodes(j,r); - if ((R == 0) or (R == m_mesh.numberOfNodes()-1)) { - - m_Fjr(j,r) = Ajr(j,r)*(uj(j)-ur(R))+pj(j)*Cjr(j,r); - - } else { - std::vector<double> stock_p(2); std::vector<double> stock_u(2); @@ -267,7 +255,7 @@ private: stock_u[l] = sum_u/sum; } m_Fjr(j,r) = Ajr(j,r)*((uj(j)+(stock_u[1]-stock_u[0])/Vj(j)*(xr[R]-xj[j])) - ur(R)) + (pj(j)+(stock_p[1]-stock_p[0])/Vj(j)*(xr[R][0]-xj[j][0]))*Cjr(j,r); - } + } });