Commit 8ce41deb authored by Anne Reinarz's avatar Anne Reinarz
Browse files

update information on custom riemann solvers

parent c351e7c3
......@@ -233,10 +233,8 @@ For \texttt{type}, the supported values are given in table \ref{table:solver-typ
\hline
Finite Volumes & \\
\hline
\texttt{user} & Instructs the toolkit that you want to implement all
the Finite Volume steps (notably the Riemann solver) yourself.
\\
\texttt{musclhancock} & Use a MUSCL-Hancock Riemann solver. \\
\texttt{robustmusclhancock} & Use a slightly more robust version of the MUSCL-Hancock Riemann solver. \\
\texttt{godunov} & Use a standard Godunov Riemann solver. \\
\hline
\end{tabular}
......
......@@ -352,11 +352,57 @@ users to engage parts of the generic kernels while implementing other parts on
their own. For instance, in both the ADERDG and Finite Volume schemes, users can
overwrite the Riemann Solver with their own implementation.
Start with a spec file that asks for a standard Riemann solver, such as \texttt{type=godunov} and then
overwrite the Riemann solvers implementation in the abstract solver interface in the user solver.
In the ADERDG scheme, the Riemann Solver is called once per patch/cell. In the
Finite Volume schemes, the Riemann Solver is called on each point.
\todo[inline]{Supply further information how to make use of this. Provide
an example, for instance an Osher-type Riemann Solver.}
As an example we provide here an implementation of the Rusanov flux (as it is currently
implemented in \exahype) for a simple
system without non-conservative products or source terms.
\begin{code}
double riemannSolver(double* fL, double *fR,
const double* qL, const double* qR,
int direction) {
constexpr int numberOfVariables = SolverType::NumberOfVariables;
constexpr int numberOfParameters = SolverType::NumberOfParameters;
constexpr int numberOfData = numberOfVariables + numberOfParameters;
double sL[numberOfVariables];
double sR[numberOfVariables];
solver.eigenvalues(qL, normalNonZero, sL);
solver.eigenvalues(qR, normalNonZero, sR);
double s_max = -1.0;
for (int i = 0; i < numberOfVariables; i++) {
const double abs_sL_i = std::abs(sL[i]);
s_max = std::max( abs_sL_i, s_max );
}
for (int i = 0; i < numberOfVariables; i++) {
const double abs_sR_i = std::abs(sR[i]);
s_max = std::max( abs_sR_i, s_max );
}
double FL2[DIMENSIONS][numberOfVariables] = {0.0};
double FR2[DIMENSIONS][numberOfVariables] = {0.0};
double* FL[DIMENSIONS]={FL2[0], FL2[1]};
double* FR[DIMENSIONS]={FR2[0], FR2[1]};
solver.flux(qL, FL);
solver.flux(qR, FR);
for (int i = 0; i < numberOfVariables; i++) {
fL[i] = 0.5 * s_max * (qL[i] - qR[i])
+ 0.5 * (FL2[normalNonZero][i] + FR2[normalNonZero][i]);
fR[i] = fL[i];
}
return s_max;
}
\end{code}
\todo[inline]{Provide
a better example, for instance an Osher-type Riemann Solver.}
......
......@@ -20,6 +20,7 @@
\item Sven Köppel (FIAS, Goethe University Frankfurt))
\item Tobias Weinzierl (Durham University)
\item Vasco Varduhn (TUM, Munich)
\item Anne Reinarz (TUM, Munich)
\end{itemize}
\subsection{Detailed contributions}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment