20 const Real un = p.
U.dot(normal);
21 const Real rho_un = p.
rho * un;
23 flux[1] = rho_un * p.
U[
XX] + p.
p * normal[
XX];
24 flux[2] = rho_un * p.
U[
YY] + p.
p * normal[
YY];
25 flux[3] = rho_un * p.
H;
26 wave_speed=std::abs(un)+p.
c;
32 const Real un = p.
U.dot(normal);
33 const Real rho_un = p.
rho * un;
35 flux[1] = rho_un * p.
U[
XX] + p.
p * normal[
XX];
36 flux[2] = rho_un * p.
U[
YY] + p.
p * normal[
YY];
37 flux[3] = rho_un * p.
H;
43 wave_speed=std::abs(p.
U.dot(normal))+p.
c;
49 const Real un = p.
U.dot(normal);
60 const Real& u = p.
U[
XX];
61 const Real&
v = p.
U[
YY];
62 const Real& nx = normal[
XX];
63 const Real& ny = normal[
YY];
64 const Real un = p.
U.dot(normal);
65 const Real us = u*ny - v*nx;
68 u, ny, u+p.
c*nx, u-p.
c*nx,
69 v, -nx, v+p.
c*ny, v-p.
c*ny,
70 0.5*p.
U2, us, p.
H+p.
c*un, p.
H-p.
c*un;
76 const Real& u = p.
U[
XX];
77 const Real&
v = p.
U[
YY];
78 const Real& nx = normal[
XX];
79 const Real& ny = normal[
YY];
80 const Real un = p.
U.dot(normal);
81 const Real us = u*ny - v*nx;
82 const Real gm1 = p.
gamma-1;
83 const Real inv_c = 1. / p.
c;
84 const Real inv_c2 = inv_c * inv_c;
88 2.-gm1*p.
H*inv_c2, u*gm1*inv_c2, v*gm1*inv_c2, -gm1*inv_c2,
90 0.5*inv_c2*(0.5*gm1*p.
U2+p.
c*un), -0.5*inv_c2*(gm1*u-p.
c*nx), -0.5*inv_c2*(gm1*v-p.
c*ny), 0.5*gm1*inv_c2,
91 0.5*inv_c2*(0.5*gm1*p.
U2-p.
c*un), -0.5*inv_c2*(gm1*u+p.
c*nx), -0.5*inv_c2*(gm1*v+p.
c*ny), 0.5*gm1*inv_c2;
99 Real left_wave_speed, right_wave_speed;
102 wave_speed =
std::max(left_wave_speed,right_wave_speed);
103 flux = 0.5*(left_flux+right_flux);
104 flux -= 0.5*wave_speed*(right.
cons - left.
cons);
110 const Real sqrt_rhoL = std::sqrt(left.
rho);
111 const Real sqrt_rhoR = std::sqrt(right.
rho);
113 roe.
rho = sqrt_rhoL*sqrt_rhoR;
114 roe.
U = (sqrt_rhoL*left.
U + sqrt_rhoR*right.
U) / (sqrt_rhoL + sqrt_rhoR);
115 roe.
H = (sqrt_rhoL*left.
H + sqrt_rhoR*right.
H) / (sqrt_rhoL + sqrt_rhoR);
116 roe.
U2 = roe.
U.squaredNorm();
119 roe.
c = std::sqrt(roe.
c2);
132 s << normal[
YY], -normal[
XX];
134 const Real drho = (right.
rho - left.
rho);
135 const Real dp = (right.
p - left.
p);
136 const Real dun = dU.dot(normal);
137 const Real dus = dU.dot(s);
139 dW[0] = drho - dp/roe.
c2;
140 dW[1] = dus * roe.
rho;
141 dW[2] = 0.5*(dp/roe.
c2 + dun*roe.
rho/roe.
c);
142 dW[3] = 0.5*(dp/roe.
c2 - dun*roe.
rho/roe.
c);
154 flux.noalias() = 0.5*(flux_left+flux_right);
158 flux[eq] -= 0.5*std::abs(lambda[
k]) * dW[
k] *
R(eq,k);
176 Real wave_speed_left, wave_speed_right;
177 wave_speed_left =
std::min(lambda_left.minCoeff(), lambda_roe.minCoeff());
178 wave_speed_right =
std::max(lambda_right.maxCoeff(), lambda_roe.maxCoeff());
180 if (wave_speed_left >= 0.)
184 else if (wave_speed_right <= 0.)
195 flux[eq] = (wave_speed_right*flux_left[eq]-wave_speed_left*flux_right[eq]);
196 flux[eq] += (wave_speed_left*wave_speed_right)*(right.
cons[eq]-left.
cons[eq]);
197 flux[eq] /= (wave_speed_right-wave_speed_left);
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.
boost::proto::terminal< SFOp< NormalOp > >::type const normal
Real R()
Definition of the ideal gas constant [J/mol K].
void compute_rusanov_flux(const Data &left, const Data &right, const ColVector_NDIM &normal, RowVector_NEQS &flux, Real &wave_speed)
Rusanov Approximate Riemann solver.
void compute_hlle_flux(const Data &left, const Data &right, const ColVector_NDIM &normal, RowVector_NEQS &flux, Real &wave_speed)
HLLE Approximate Riemann solver.
Real max(const Real a, const Real b)
Maximum between two scalars.
void compute_convective_left_eigenvectors(const Data &p, const ColVector_NDIM &normal, Matrix_NEQSxNEQS &left_eigenvectors)
Left eigenvectors projected on a given normal.
Real min(const Real a, const Real b)
Minimum between two scalars.
Real c2
square of speed of sound, very commonly used
MatrixTypes< NDIM, NEQS >::ColVector_NDIM ColVector_NDIM
Top-level namespace for coolfluid.
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_roe_average(const Data &left, const Data &right, Data &roe)
Linearize a left and right state using the Roe average.
void compute_convective_eigenvalues(const Data &p, const ColVector_NDIM &normal, RowVector_NEQS &eigen_values)
Eigenvalues or wave speeds projected on a given normal.
void compute_jacobian_conservative_wrt_primitive(const Data &p, Matrix_NEQSxNEQS &dcons_dprim)
Calculate the Jacobian of the conserved variables with respect to the primitive variables.
unsigned int Uint
typedef for unsigned int
MatrixTypes< NDIM, NEQS >::Matrix_NEQSxNEQS Matrix_NEQSxNEQS
void compute_jacobian_primitive_wrt_conservative(const Data &p, Matrix_NEQSxNEQS &dprim_dcons)
Calculate the Jacobian of the primitive variables with respect to the conservative variables...
void compute_specific_entropy(const Data &p, Real &specific_entropy)
Compute the specific entropy from the primitive variables.
Real gamma
specific heat ratio
MatrixTypes< NDIM, NEQS >::RowVector_NEQS RowVector_NEQS