42 std::string AverageSolver::solverName =
45 AverageSolver::create,
46 "Average Riemann solver");
79 int expDim = Fwd.num_elements()-2;
82 for (j = 0; j < Fwd[0].num_elements(); ++j)
88 for (i = 0; i < expDim; ++i)
90 Ufwd[i] = Fwd[i+1][j]/Fwd[0][j];
91 Ubwd[i] = Bwd[i+1][j]/Bwd[0][j];
92 tmp1 += Ufwd[i]*Fwd[i+1][j];
93 tmp2 += Ubwd[i]*Bwd[i+1][j];
96 NekDouble Pfwd = (gamma - 1.0) * (Fwd[expDim+1][j] - 0.5 * tmp1);
97 NekDouble Pbwd = (gamma - 1.0) * (Bwd[expDim+1][j] - 0.5 * tmp2);
100 flux[0][j] = 0.5 * (Fwd[1][j] + Bwd[1][j]);
101 flux[expDim+1][j] = 0.5 * (Ufwd[0] * (Fwd[expDim+1][j] + Pfwd) +
102 Ubwd[0] * (Bwd[expDim+1][j] + Pbwd));
104 for (i = 0; i < expDim; ++i)
106 flux[i+1][j] = 0.5 * (Fwd[0][j] * Ufwd[0] * Ufwd[i] +
107 Bwd[0][j] * Ubwd[0] * Ubwd[i]);
111 flux[1][j] += 0.5 * (Pfwd + Pbwd);
virtual void v_ArraySolve(const Array< OneD, const Array< OneD, NekDouble > > &Fwd, const Array< OneD, const Array< OneD, NekDouble > > &Bwd, Array< OneD, Array< OneD, NekDouble > > &flux)
Average Riemann solver.
RiemannSolverFactory & GetRiemannSolverFactory()
std::map< std::string, RSParamFuncType > m_params
Map of parameter function types.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.