SpECTRE
v2024.05.11
|
The HLLC (Harten-Lax-van Leer-Contact) Riemann solver for the NewtonianEuler system. More...
#include <Hllc.hpp>
Classes | |
struct | LargestIngoingCharSpeed |
struct | LargestOutgoingCharSpeed |
Public Types | |
using | options = tmpl::list<> |
using | dg_package_field_tags = tmpl::list< Tags::MassDensityCons, Tags::MomentumDensity< Dim >, Tags::EnergyDensity, hydro::Tags::Pressure< DataVector >, ::Tags::NormalDotFlux< Tags::MassDensityCons >, ::Tags::NormalDotFlux< Tags::MomentumDensity< Dim > >, ::Tags::NormalDotFlux< Tags::EnergyDensity >, InterfaceUnitNormal, NormalDotVelocity, LargestOutgoingCharSpeed, LargestIngoingCharSpeed > |
using | dg_package_data_temporary_tags = tmpl::list<> |
using | dg_package_data_primitive_tags = tmpl::list< hydro::Tags::SpatialVelocity< DataVector, Dim >, hydro::Tags::SpecificInternalEnergy< DataVector > > |
using | dg_package_data_volume_tags = tmpl::list< hydro::Tags::EquationOfState< false, 2 > > |
using | dg_boundary_terms_volume_tags = tmpl::list<> |
Public Types inherited from NewtonianEuler::BoundaryCorrections::BoundaryCorrection< Dim > | |
using | creatable_classes = tmpl::list< Hll< Dim >, Hllc< Dim >, Rusanov< Dim > > |
Public Member Functions | |
Hllc (const Hllc &)=default | |
Hllc & | operator= (const Hllc &)=default |
Hllc (Hllc &&)=default | |
Hllc & | operator= (Hllc &&)=default |
void | pup (PUP::er &p) override |
std::unique_ptr< BoundaryCorrection< Dim > > | get_clone () const override |
double | dg_package_data (gsl::not_null< Scalar< DataVector > * > packaged_mass_density, gsl::not_null< tnsr::I< DataVector, Dim, Frame::Inertial > * > packaged_momentum_density, gsl::not_null< Scalar< DataVector > * > packaged_energy_density, gsl::not_null< Scalar< DataVector > * > packaged_pressure, gsl::not_null< Scalar< DataVector > * > packaged_normal_dot_flux_mass_density, gsl::not_null< tnsr::I< DataVector, Dim, Frame::Inertial > * > packaged_normal_dot_flux_momentum_density, gsl::not_null< Scalar< DataVector > * > packaged_normal_dot_flux_energy_density, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > packaged_interface_unit_normal, gsl::not_null< Scalar< DataVector > * > packaged_normal_dot_velocity, gsl::not_null< Scalar< DataVector > * > packaged_largest_outgoing_char_speed, gsl::not_null< Scalar< DataVector > * > packaged_largest_ingoing_char_speed, const Scalar< DataVector > &mass_density, const tnsr::I< DataVector, Dim, Frame::Inertial > &momentum_density, const Scalar< DataVector > &energy_density, const tnsr::I< DataVector, Dim, Frame::Inertial > &flux_mass_density, const tnsr::IJ< DataVector, Dim, Frame::Inertial > &flux_momentum_density, const tnsr::I< DataVector, Dim, Frame::Inertial > &flux_energy_density, const tnsr::I< DataVector, Dim, Frame::Inertial > &velocity, const Scalar< DataVector > &specific_internal_energy, const tnsr::i< DataVector, Dim, Frame::Inertial > &normal_covector, const std::optional< tnsr::I< DataVector, Dim, Frame::Inertial > > &, const std::optional< Scalar< DataVector > > &normal_dot_mesh_velocity, const EquationsOfState::EquationOfState< false, 2 > &equation_of_state) const |
void | dg_boundary_terms (gsl::not_null< Scalar< DataVector > * > boundary_correction_mass_density, gsl::not_null< tnsr::I< DataVector, Dim, Frame::Inertial > * > boundary_correction_momentum_density, gsl::not_null< Scalar< DataVector > * > boundary_correction_energy_density, const Scalar< DataVector > &mass_density_int, const tnsr::I< DataVector, Dim, Frame::Inertial > &momentum_density_int, const Scalar< DataVector > &energy_density_int, const Scalar< DataVector > &pressure_int, const Scalar< DataVector > &normal_dot_flux_mass_density_int, const tnsr::I< DataVector, Dim, Frame::Inertial > &normal_dot_flux_momentum_density_int, const Scalar< DataVector > &normal_dot_flux_energy_density_int, const tnsr::i< DataVector, Dim, Frame::Inertial > &interface_unit_normal_int, const Scalar< DataVector > &normal_dot_velocity_int, const Scalar< DataVector > &largest_outgoing_char_speed_int, const Scalar< DataVector > &largest_ingoing_char_speed_int, const Scalar< DataVector > &mass_density_ext, const tnsr::I< DataVector, Dim, Frame::Inertial > &momentum_density_ext, const Scalar< DataVector > &energy_density_ext, const Scalar< DataVector > &pressure_ext, const Scalar< DataVector > &normal_dot_flux_mass_density_ext, const tnsr::I< DataVector, Dim, Frame::Inertial > &normal_dot_flux_momentum_density_ext, const Scalar< DataVector > &normal_dot_flux_energy_density_ext, const tnsr::i< DataVector, Dim, Frame::Inertial > &interface_unit_normal_ext, const Scalar< DataVector > &normal_dot_velocity_ext, const Scalar< DataVector > &largest_outgoing_char_speed_ext, const Scalar< DataVector > &largest_ingoing_char_speed_ext, dg::Formulation dg_formulation) const |
Public Member Functions inherited from NewtonianEuler::BoundaryCorrections::BoundaryCorrection< Dim > | |
BoundaryCorrection (const BoundaryCorrection &)=default | |
BoundaryCorrection & | operator= (const BoundaryCorrection &)=default |
BoundaryCorrection (BoundaryCorrection &&)=default | |
BoundaryCorrection & | operator= (BoundaryCorrection &&)=default |
virtual std::unique_ptr< BoundaryCorrection< Dim > > | get_clone () const =0 |
Static Public Attributes | |
static constexpr Options::String | help |
The HLLC (Harten-Lax-van Leer-Contact) Riemann solver for the NewtonianEuler system.
Let \(U\) be the evolved variable, \(F^i\) the flux, \(v^i\) the spatial velocity, and \(n_i\) be the outward directed unit normal to the interface. Denoting \(F := n_i F^i\) and \(v:=n_iv^i\), the HLLC boundary correction is [182]
\begin{align*} G_\text{HLLC} = \left\{\begin{array}{lcl} F_\text{int} & \text{if} & 0 \leq \lambda_\text{min} \\ F_\text{int} + \lambda_\text{min}(U_\text{*int} - U_\text{int}) & \text{if} & \lambda_\text{min} \leq 0 \leq \lambda_\text{*} \\ -F_\text{ext} + \lambda_\text{max}(U_\text{*ext} - U_\text{ext}) & \text{if} & \lambda_\text{*} \leq 0 \leq \lambda_\text{max} \\ -F_\text{ext} & \text{if} & \lambda_\text{max} \leq 0 \end{array}\right\} \end{align*}
where "int" and "ext" stand for interior and exterior.
Intermediate ('star') states are given by
\begin{align*} U_\text{*int} = \left(\frac{\lambda_\text{min} - v_\text{int}} {\lambda_\text{min} - \lambda_*}\right) \left[\begin{array}{c} \displaystyle \rho_\text{int} \\ \displaystyle \rho_\text{int}[v_\text{int}^x + (\lambda_* - v_\text{int}) n_x^\text{int}] \\ \displaystyle \rho_\text{int}[v_\text{int}^y + (\lambda_* - v_\text{int}) n_y^\text{int}] \\ \displaystyle \rho_\text{int}[v_\text{int}^z + (\lambda_* - v_\text{int}) n_z^\text{int}] \\ \displaystyle E_\text{int} + p_\text{int} \frac{\lambda_* - v_\text{int}} {\lambda_\text{min} - v_\text{int}} + \rho_\text{int}\lambda_*(\lambda_* - v_\text{int}) \end{array}\right] \end{align*}
and
\begin{align*} U_\text{*ext} = \left(\frac{\lambda_\text{max} + v_\text{ext}} {\lambda_\text{max} - \lambda_*}\right) \left[\begin{array}{c} \displaystyle \rho_\text{ext} \\ \displaystyle \rho_\text{ext}[-v_\text{ext}^x - (\lambda_* + v_\text{ext}) n_x^\text{ext}] \\ \displaystyle \rho_\text{ext}[-v_\text{ext}^y - (\lambda_* + v_\text{ext}) n_y^\text{ext}] \\ \displaystyle \rho_\text{ext}[-v_\text{ext}^z - (\lambda_* + v_\text{ext}) n_z^\text{ext}] \\ \displaystyle E_\text{ext} + p_\text{ext} \frac{\lambda_* + v_\text{ext}} {\lambda_\text{max} + v_\text{ext}} + \rho_\text{ext}\lambda_*(\lambda_* + v_\text{ext}) \end{array}\right]. \end{align*}
The contact wave speed \(\lambda_*\) is [183]
\begin{align*} \lambda_* = \frac { p_\text{ext} - p_\text{int} + \rho_\text{int}v_\text{int}(\lambda_\text{min}-v_\text{int}) + \rho_\text{ext}v_\text{ext}(\lambda_\text{max}+v_\text{ext})} { \rho_\text{int}(\lambda_\text{min}-v_\text{int}) - \rho_\text{ext}(\lambda_\text{max} + v_\text{ext})}. \end{align*}
\(\lambda_\text{min}\) and \(\lambda_\text{max}\) are estimated by [44]
\begin{align*} \lambda_\text{min} &= \text{min}\left(\lambda^{-}_\text{int},-\lambda^{+}_\text{ext}\right) \\ \lambda_\text{max} &= \text{max}\left(\lambda^{+}_\text{int},-\lambda^{-}_\text{ext}\right) \end{align*}
where \(\lambda^{+}\) ( \(\lambda^{-}\)) is the largest characteristic speed in the outgoing (ingoing) direction for each domain.
Note the minus signs in front of \(\lambda^{\pm}_\text{ext}\), which is because an outgoing speed w.r.t. the neighboring element is an ingoing speed w.r.t. the local element, and vice versa. Similarly, the \(F_{\text{ext}}\) term in \(G_\text{HLLC}\) and the \(v_\text{ext}\) term in \(U_\text{*ext}\) have a positive sign because the outward directed normal of the neighboring element has the opposite sign, i.e. \(n_i^{\text{ext}}=-n_i^{\text{int}}\).
For the NewtonianEuler system, \(\lambda^\pm\) are given as
\begin{align*} \lambda^\pm = v \pm c_s \end{align*}
where \(c_s\) is the sound speed.
dg_boundary_terms
function returns \(G - F_\text{int}\)In the implementation, we use
\begin{align*} G_\text{HLLC} = \left\{\begin{array}{lcl} F_\text{int} + \lambda_\text{min}(U_\text{*int} - U_\text{int}) & \text{if} & 0 \leq \lambda_\text{*} \\ -F_\text{ext} + \lambda_\text{max}(U_\text{*ext} - U_\text{ext}) & \text{if} & \lambda_\text{*} \leq 0 \\ \end{array}\right\}, \end{align*}
with
\begin{align*} \lambda_\text{min} &= \text{min}\left(\lambda^{-}_\text{int},-\lambda^{+}_\text{ext}, 0\right) \\ \lambda_\text{max} &= \text{max}\left(\lambda^{+}_\text{int},-\lambda^{-}_\text{ext}, 0\right). \end{align*}
Provided that \(\lambda_*\) falls in the correct range i.e
\begin{align*} \text{min}\left(\lambda^{-}_\text{int},-\lambda^{+}_\text{ext}\right) < \lambda_* < \text{max}\left(\lambda^{+}_\text{int},-\lambda^{-}_\text{ext}\right), \end{align*}
this prescription recovers the original HLLC boundary correction for all four cases. For either \(\lambda_\text{min} = 0\) or \(\lambda_\text{max} = 0\) (i.e. all characteristics move in the same direction), boundary correction reduces to pure upwinding.
|
overridevirtual |
|
staticconstexpr |