Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
ScalarWave::BoundaryCorrections::UpwindPenalty< Dim > Class Template Referencefinal

Computes the scalar wave upwind multipenalty boundary correction. More...

#include <UpwindPenalty.hpp>

Public Types

using options = tmpl::list<>
 
using dg_package_field_tags = tmpl::list< Tags::VPsi, Tags::VZero< Dim >, Tags::VPlus, Tags::VMinus, NormalTimesVPlus, NormalTimesVMinus, Gamma2VPsi, CharSpeedsTensor >
 
using dg_package_data_temporary_tags = tmpl::list< Tags::ConstraintGamma2 >
 
using dg_package_data_volume_tags = tmpl::list<>
 
- Public Types inherited from ScalarWave::BoundaryCorrections::BoundaryCorrection< Dim >
using creatable_classes = tmpl::list< UpwindPenalty< Dim > >
 

Public Member Functions

 UpwindPenalty (const UpwindPenalty &)=default
 
UpwindPenaltyoperator= (const UpwindPenalty &)=default
 
 UpwindPenalty (UpwindPenalty &&)=default
 
UpwindPenaltyoperator= (UpwindPenalty &&)=default
 
void pup (PUP::er &p) override
 
std::unique_ptr< BoundaryCorrection< Dim > > get_clone () const noexcept override
 
double dg_package_data (gsl::not_null< Scalar< DataVector > * > packaged_char_speed_v_psi, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > packaged_char_speed_v_zero, gsl::not_null< Scalar< DataVector > * > packaged_char_speed_v_plus, gsl::not_null< Scalar< DataVector > * > packaged_char_speed_v_minus, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > packaged_char_speed_n_times_v_plus, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > packaged_char_speed_n_times_v_minus, gsl::not_null< Scalar< DataVector > * > packaged_char_speed_gamma2_v_psi, gsl::not_null< tnsr::i< DataVector, 3, Frame::Inertial > * > packaged_char_speeds, const Scalar< DataVector > &pi, const tnsr::i< DataVector, Dim, Frame::Inertial > &phi, const Scalar< DataVector > &psi, const Scalar< DataVector > &constraint_gamma2, 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 noexcept
 
void dg_boundary_terms (gsl::not_null< Scalar< DataVector > * > pi_boundary_correction, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > phi_boundary_correction, gsl::not_null< Scalar< DataVector > * > psi_boundary_correction, const Scalar< DataVector > &char_speed_v_psi_int, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_v_zero_int, const Scalar< DataVector > &char_speed_v_plus_int, const Scalar< DataVector > &char_speed_v_minus_int, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_normal_times_v_plus_int, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_normal_times_v_minus_int, const Scalar< DataVector > &char_speed_constraint_gamma2_v_psi_int, const tnsr::i< DataVector, 3, Frame::Inertial > &char_speeds_int, const Scalar< DataVector > &char_speed_v_psi_ext, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_v_zero_ext, const Scalar< DataVector > &char_speed_v_plus_ext, const Scalar< DataVector > &char_speed_v_minus_ext, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_minus_normal_times_v_plus_ext, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_minus_normal_times_v_minus_ext, const Scalar< DataVector > &char_speed_constraint_gamma2_v_psi_ext, const tnsr::i< DataVector, 3, Frame::Inertial > &char_speeds_ext, dg::Formulation) const noexcept
 
- Public Member Functions inherited from ScalarWave::BoundaryCorrections::BoundaryCorrection< Dim >
 BoundaryCorrection (const BoundaryCorrection &)=default
 
BoundaryCorrectionoperator= (const BoundaryCorrection &)=default
 
 BoundaryCorrection (BoundaryCorrection &&)=default
 
BoundaryCorrectionoperator= (BoundaryCorrection &&)=default
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

template<size_t Dim>
class ScalarWave::BoundaryCorrections::UpwindPenalty< Dim >

Computes the scalar wave upwind multipenalty boundary correction.

This implements the upwind multipenalty boundary correction term \(D_\beta\). The general form is given by:

\begin{align*} D_\beta = T_{\beta\hat{\beta}}^{\mathrm{ext}} \Lambda^{\mathrm{ext},-}_{\hat{\beta}\hat{\alpha}} v^{\mathrm{ext}}_{\hat{\alpha}} -T_{\beta\hat{\beta}}^{\mathrm{int}} \Lambda^{\mathrm{int},-}_{\hat{\beta}\hat{\alpha}} v^{\mathrm{int}}_{\hat{\alpha}}. \end{align*}

We denote the evolved fields by \(u_{\alpha}\), the characteristic fields by \(v_{\hat{\alpha}}\), and implicitly sum over reapeated indices. \(T_{\beta\hat{\beta}}\) transforms characteristic fields to evolved fields, while \(\Lambda_{\hat{\beta}\hat{\alpha}}^-\) is a diagonal matrix with only the negative characteristic speeds, and has zeros on the diagonal for all other entries. The int and ext superscripts denote quantities on the internal and external side of the mortar. Note that Eq. (6.3) of [86] is not exactly what's implemented since that boundary term does not consistently treat both sides of the interface on the same footing.

For the scalar wave system the correction is:

\begin{align} D_{\Psi} &= \lambda_{v^{\Psi}}^{\mathrm{ext},-} v^{\mathrm{ext},\Psi} - \lambda_{v^{\Psi}}^{\mathrm{int},-} v^{\mathrm{int},\Psi}, \\ D_{\Pi} &= \frac{1}{2}\left(\lambda_{v^+}^{\mathrm{ext},-} v^{\mathrm{ext},+} + \lambda_{v^-}^{\mathrm{ext},-} v^{\mathrm{ext},-}\right) + \lambda_{v^\Psi}^{\mathrm{ext},-}\gamma_2 v^{\mathrm{ext},\Psi} \notag \\ &-\frac{1}{2}\left(\lambda_{v^+}^{\mathrm{int},-} v^{\mathrm{int},+} + \lambda_{v^-}^{\mathrm{int},-} v^{\mathrm{int},-}\right) - \lambda_{v^\Psi}^{\mathrm{int},-}\gamma_2 v^{\mathrm{int},\Psi} , \\ D_{\Phi_{i}} &= \frac{1}{2}\left(\lambda_{v^+}^{\mathrm{ext},-} v^{\mathrm{ext},+} - \lambda_{v^-}^{\mathrm{ext},-} v^{\mathrm{ext},-}\right)n_i^{\mathrm{ext}} + \lambda_{v^0}^{\mathrm{ext},-} v^{\mathrm{ext},0}_{i} \notag \\ &- \frac{1}{2}\left(\lambda_{v^+}^{\mathrm{int},-} v^{\mathrm{int},+} - \lambda_{v^-}^{\mathrm{int},-} v^{\mathrm{int},-}\right)n_i^{\mathrm{int}} - \lambda_{v^0}^{\mathrm{int},-} v^{\mathrm{int},0}_{i}, \end{align}

with characteristic fields

\begin{align} v^{\Psi} &= \Psi, \\ v^{0}_{i} &= (\delta^k_i-n^k n_i)\Phi_{k}, \\ v^{\pm} &= \Pi\pm n^i\Phi_{i} -\gamma_2 \Psi, \end{align}

and characteristic speeds

\begin{align} \lambda_{v^\Psi} =& -v^i_g n_i, \\ \lambda_{v^0} =& -v^i_g n_i, \\ \lambda_{v^\pm} =& \pm 1 - v^i_g n_i, \end{align}

where \(v_g^i\) is the mesh velocity and \(n_i\) is the outward directed unit normal covector to the interface. We have also defined

\begin{align} \lambda^{\pm}_{\hat{\alpha}} = \left\{ \begin{array}{ll} \lambda_{\hat{\alpha}} & \mathrm{if}\;\pm\lambda_{\hat{\alpha}}> 0 \\ 0 & \mathrm{otherwise} \end{array}\right. \end{align}

In the implementation we store the speeds in a rank-3 tensor with the zeroth component being \(\lambda_{v^\Psi}\), the first being \(\lambda_{v^+}\) and the second being \(\lambda_{v^-}\).

Note that we have assumed \(n_i^{\mathrm{ext}}\) points in the same direction as \(n_i^{\mathrm{int}}\), but in the code they point in opposite directions. If \(n_i^{\mathrm{ext}}\) points in the opposite direction the external speeds have their sign flipped and the \(\pm\) fields and their speeds reverse roles (i.e. the \(v^{\mathrm{ext},+}\) field is now flowing into the element, while \(v^{\mathrm{ext},-}\) flows out). In our implementation this reversal actually cancels out, and we have the following equations:

\begin{align} D_{\Psi} &= -\lambda_{v^{\Psi}}^{\mathrm{ext},+} v^{\mathrm{ext},\Psi} - \lambda_{v^{\Psi}}^{\mathrm{int},-} v^{\mathrm{int},\Psi}, \\ D_{\Pi} &= \frac{1}{2}\left(-\lambda_{v^+}^{\mathrm{ext},+} v^{\mathrm{ext},+} - \lambda_{v^-}^{\mathrm{ext},+} v^{\mathrm{ext},-}\right) - \lambda_{v^\Psi}^{\mathrm{ext},+}\gamma_2 v^{\mathrm{ext},\Psi} \notag \\ &-\frac{1}{2}\left(\lambda_{v^+}^{\mathrm{int},-} v^{\mathrm{int},+} + \lambda_{v^-}^{\mathrm{int},-} v^{\mathrm{int},-}\right) - \lambda_{v^\Psi}^{\mathrm{int},-}\gamma_2 v^{\mathrm{int},\Psi} , \\ D_{\Phi_{i}} &= \frac{1}{2}\left(-\lambda_{v^+}^{\mathrm{ext},+} v^{\mathrm{ext},+} + \lambda_{v^-}^{\mathrm{ext},+} v^{\mathrm{ext},-}\right)n_i^{\mathrm{ext}} - \lambda_{v^0}^{\mathrm{ext},+} v^{\mathrm{ext},0}_{i} \notag \\ &- \frac{1}{2}\left(\lambda_{v^+}^{\mathrm{int},-} v^{\mathrm{int},+} - \lambda_{v^-}^{\mathrm{int},-} v^{\mathrm{int},-}\right)n_i^{\mathrm{int}} - \lambda_{v^0}^{\mathrm{int},-} v^{\mathrm{int},0}_{i}, \end{align}

Member Data Documentation

◆ help

template<size_t Dim>
constexpr Options::String ScalarWave::BoundaryCorrections::UpwindPenalty< Dim >::help
staticconstexpr
Initial value:
= {
"Computes the UpwindPenalty boundary correction term for the scalar wave "
"system."}

The documentation for this class was generated from the following file: