21 const Real un = p.
u * normal[
XX];
22 const Real rho_un = p.
rho * un;
24 flux[1] = rho_un * p.
u + p.
p * normal[
XX];
25 flux[2] = rho_un * p.
H;
26 wave_speed=std::abs(un)+p.
c*std::abs(normal[
XX]);
32 const Real un = p.
u * normal[
XX];
33 const Real rho_un = p.
rho * un;
35 flux[1] = rho_un * p.
u + p.
p *normal[
XX];
36 flux[2] = rho_un * p.
H;
42 wave_speed=std::abs(p.
u * normal[
XX])+p.
c*std::abs(normal[XX]);
48 const Real un = p.
u * normal[
XX];
49 const Real cn = p.
c * normal[
XX];
51 eigen_values[1] = un+cn;
52 eigen_values[2] = un-cn;
60 p.
u, p.
u+p.
c, p.
u-p.
c,
61 0.5*p.
u*p.
u, p.
H+p.
c*p.
u, p.
H-p.
c*p.
u;
67 const Real nx = normal[
XX];
68 const Real gm1 = p.
gamma-1;
69 const Real inv_c = 1. / p.
c;
70 const Real inv_c2 = inv_c * inv_c;
71 const Real M = p.
u*inv_c;
76 1.-0.5*gm1*M2, p.
u*gm1*inv_c2, -gm1*inv_c2,
77 0.25*gm1*M2-0.5*M, -0.5*inv_c2*(gm1*p.
u-p.
c), 0.5*gm1*inv_c2,
78 0.25*gm1*M2+0.5*M, -0.5*inv_c2*(gm1*p.
u+p.
c), 0.5*gm1*inv_c2;
86 Real left_wave_speed, right_wave_speed;
89 wave_speed =
std::max(left_wave_speed,right_wave_speed);
90 flux = 0.5*(left_flux+right_flux);
91 flux -= 0.5*wave_speed*(right.
cons - left.
cons);
99 const Real sqrt_rhoL = std::sqrt(std::abs(left.
rho));
100 const Real sqrt_rhoR = std::sqrt(std::abs(right.
rho));
102 roe.
rho = sqrt_rhoL*sqrt_rhoR;
103 roe.
u = (sqrt_rhoL*left.
u + sqrt_rhoR*right.
u) / (sqrt_rhoL + sqrt_rhoR);
104 roe.
H = (sqrt_rhoL*std::abs(left.
H) + sqrt_rhoR*std::abs(right.
H)) / (sqrt_rhoL + sqrt_rhoR);
105 roe.
c2 = (roe.
gamma-1.)*(roe.
H-0.5*roe.
u*roe.
u);
107 roe.
c = std::sqrt(roe.
c2);
113 if (left.
rho<0 || right.
rho<0)
123 const Real drho = (right.
rho - left.
rho);
124 const Real du = (right.
u - left.
u);
125 const Real dp = (right.
p - left.
p);
126 dW[0] = drho - dp/roe.
c2;
127 dW[1] = 0.5*(dp/roe.
c2 + du*roe.
rho/roe.
c);
128 dW[2] = 0.5*(dp/roe.
c2 - du*roe.
rho/roe.
c);
141 flux.noalias() = 0.5*(flux_left+flux_right);
145 flux[eq] -= 0.5*std::abs(lambda[
k]) * dW[
k] *
R(eq,k);
171 Real wave_speed_left, wave_speed_right;
172 wave_speed_left =
std::min(lambda_left.minCoeff(), lambda_roe.minCoeff());
173 wave_speed_right =
std::max(lambda_right.maxCoeff(), lambda_roe.maxCoeff());
175 if (wave_speed_left >= 0.)
179 else if (wave_speed_right <= 0.)
190 flux[eq] = (wave_speed_right*flux_left[eq]-wave_speed_left*flux_right[eq]);
191 flux[eq] += (wave_speed_left*wave_speed_right)*(right.
cons[eq]-left.
cons[eq]);
192 flux[eq] /= (wave_speed_right-wave_speed_left);
boost::proto::terminal< SFOp< NormalOp > >::type const normal
Real R()
Definition of the ideal gas constant [J/mol K].
MatrixTypes< NDIM, NEQS >::ColVector_NDIM ColVector_NDIM
void compute_roe_average(const Data &left, const Data &right, Data &roe)
Linearize a left and right state using the Roe average.
void compute_roe_flux(const Data &left, const Data &right, const ColVector_NDIM &normal, RowVector_NEQS &flux, Real &wave_speed)
Roe Approximate Riemann solver.
void compute_convective_flux(const Data &p, const ColVector_NDIM &normal, RowVector_NEQS &flux, Real &wave_speed)
Convective flux in conservative form, and maximum absolute wave speed.
void compute_convective_eigenvalues(const Data &p, const ColVector_NDIM &normal, RowVector_NEQS &eigen_values)
Eigenvalues or wave speeds projected on a given normal.
MatrixTypes< NDIM, NEQS >::Matrix_NEQSxNEQS Matrix_NEQSxNEQS
Real max(const Real a, const Real b)
Maximum between two scalars.
MatrixTypes< NDIM, NEQS >::RowVector_NEQS RowVector_NEQS
void compute_convective_right_eigenvectors(const Data &p, const ColVector_NDIM &normal, Matrix_NEQSxNEQS &right_eigenvectors)
Right eigenvectors projected on a given normal.
void compute_convective_wave_speed(const Data &p, const ColVector_NDIM &normal, Real &wave_speed)
Maximum absolute wave speed.
Real min(const Real a, const Real b)
Minimum between two scalars.
Real c2
square of speed of sound, very commonly used
Top-level namespace for coolfluid.
void compute_rusanov_flux(const Data &left, const Data &right, const ColVector_NDIM &normal, RowVector_NEQS &flux, Real &wave_speed)
Rusanov Approximate Riemann solver.
unsigned int Uint
typedef for unsigned int
void compute_convective_left_eigenvectors(const Data &p, const ColVector_NDIM &normal, Matrix_NEQSxNEQS &left_eigenvectors)
Left eigenvectors projected on a given normal.
Real gamma
specific heat ratio
void compute_hlle_flux(const Data &left, const Data &right, const ColVector_NDIM &normal, RowVector_NEQS &flux, Real &wave_speed)
HLLE Approximate Riemann solver.