76 size_t expDim = Fwd.size() - 2;
79 for (j = 0; j < Fwd[0].size(); ++j)
85 for (i = 0; i < expDim; ++i)
87 Ufwd[i] = Fwd[i + 1][j] / Fwd[0][j];
88 Ubwd[i] = Bwd[i + 1][j] / Bwd[0][j];
89 tmp1 += Ufwd[i] * Fwd[i + 1][j];
90 tmp2 += Ubwd[i] * Bwd[i + 1][j];
94 NekDouble eFwd = (Fwd[expDim + 1][j] - 0.5 * tmp1) / Fwd[0][j];
95 NekDouble eBwd = (Bwd[expDim + 1][j] - 0.5 * tmp2) / Bwd[0][j];
101 flux[0][j] = 0.5 * (Fwd[1][j] + Bwd[1][j]);
102 flux[expDim + 1][j] = 0.5 * (Ufwd[0] * (Fwd[expDim + 1][j] + Pfwd) +
103 Ubwd[0] * (Bwd[expDim + 1][j] + Pbwd));
105 for (i = 0; i < expDim; ++i)
107 flux[i + 1][j] = 0.5 * (Fwd[0][j] * Ufwd[0] * Ufwd[i] +
108 Bwd[0][j] * Ubwd[0] * Ubwd[i]);
112 flux[1][j] += 0.5 * (Pfwd + Pbwd);
static RiemannSolverSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
static std::string solverName
AverageSolver(const LibUtilities::SessionReaderSharedPtr &pSession)
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) final
Average Riemann solver.
EquationOfStateSharedPtr m_eos
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
RiemannSolverFactory & GetRiemannSolverFactory()