SpECTRE
v2024.04.12
|
Items related to evolving the Newtonian Euler system. More...
Namespaces | |
namespace | AnalyticData |
Holds classes implementing analytic data for the NewtonianEuler system. | |
namespace | BoundaryConditions |
Boundary conditions for the Newtonian Euler hydrodynamics system. | |
namespace | BoundaryCorrections |
Boundary corrections/numerical fluxes. | |
namespace | fd |
Finite difference functionality for Newtonian Euler. | |
namespace | OptionTags |
OptionTags for the conservative formulation of the Newtonian Euler system | |
namespace | Solutions |
Holds classes implementing a solution to the Newtonian Euler system. | |
namespace | Sources |
namespace | subcell |
Code required by the DG-subcell/FD hybrid solver. | |
namespace | Tags |
Tags for the conservative formulation of the Newtonian Euler system | |
Classes | |
struct | ComputeFluxes |
Compute the fluxes of the conservative variables of the Newtonian Euler system. More... | |
struct | ConservativeFromPrimitive |
Compute the conservative variables from the primitive variables. More... | |
struct | PrimitiveFromConservative |
Compute the primitive variables from the conservative variables. More... | |
struct | System |
struct | TimeDerivativeTerms |
Compute the time derivative of the conserved variables for the Newtonian Euler system. More... | |
Functions | |
template<size_t Dim> | |
std::pair< DataVector, std::pair< Matrix, Matrix > > | numerical_eigensystem (const tnsr::I< double, Dim > &velocity, const Scalar< double > &sound_speed_squared, const Scalar< double > &specific_enthalpy, const Scalar< double > &kappa_over_density, const tnsr::i< double, Dim > &unit_normal) |
Compute the transform matrices between the conserved variables and the characteristic variables of the NewtonianEuler system. More... | |
template<size_t Dim> | |
void | characteristic_speeds (gsl::not_null< std::array< DataVector, Dim+2 > * > char_speeds, const tnsr::I< DataVector, Dim > &velocity, const Scalar< DataVector > &sound_speed, const tnsr::i< DataVector, Dim > &normal) |
Compute the characteristic speeds of NewtonianEuler system. More... | |
template<size_t Dim> | |
std::array< DataVector, Dim+2 > | characteristic_speeds (const tnsr::I< DataVector, Dim > &velocity, const Scalar< DataVector > &sound_speed, const tnsr::i< DataVector, Dim > &normal) |
Compute the characteristic speeds of NewtonianEuler system. More... | |
template<size_t Dim> | |
Matrix | right_eigenvectors (const tnsr::I< double, Dim > &velocity, const Scalar< double > &sound_speed_squared, const Scalar< double > &specific_enthalpy, const Scalar< double > &kappa_over_density, const tnsr::i< double, Dim > &unit_normal) |
Compute the transform matrices between the conserved variables and the characteristic variables of the NewtonianEuler system. More... | |
template<size_t Dim> | |
Matrix | left_eigenvectors (const tnsr::I< double, Dim > &velocity, const Scalar< double > &sound_speed_squared, const Scalar< double > &specific_enthalpy, const Scalar< double > &kappa_over_density, const tnsr::i< double, Dim > &unit_normal) |
Compute the transform matrices between the conserved variables and the characteristic variables of the NewtonianEuler system. More... | |
template<typename DataType > | |
void | internal_energy_density (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &mass_density, const Scalar< DataType > &specific_internal_energy) |
template<typename DataType > | |
Scalar< DataType > | internal_energy_density (const Scalar< DataType > &mass_density, const Scalar< DataType > &specific_internal_energy) |
template<typename DataType , size_t Dim, typename Fr > | |
void | kinetic_energy_density (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &mass_density, const tnsr::I< DataType, Dim, Fr > &velocity) |
template<typename DataType , size_t Dim, typename Fr > | |
Scalar< DataType > | kinetic_energy_density (const Scalar< DataType > &mass_density, const tnsr::I< DataType, Dim, Fr > &velocity) |
template<typename DataType , size_t Dim, typename Fr > | |
void | mach_number (gsl::not_null< Scalar< DataType > * > result, const tnsr::I< DataType, Dim, Fr > &velocity, const Scalar< DataType > &sound_speed) |
template<typename DataType , size_t Dim, typename Fr > | |
Scalar< DataType > | mach_number (const tnsr::I< DataType, Dim, Fr > &velocity, const Scalar< DataType > &sound_speed) |
template<typename DataType , size_t Dim, typename Fr > | |
void | ram_pressure (gsl::not_null< tnsr::II< DataType, Dim, Fr > * > result, const Scalar< DataType > &mass_density, const tnsr::I< DataType, Dim, Fr > &velocity) |
template<typename DataType , size_t Dim, typename Fr > | |
tnsr::II< DataType, Dim, Fr > | ram_pressure (const Scalar< DataType > &mass_density, const tnsr::I< DataType, Dim, Fr > &velocity) |
template<typename DataType , size_t ThermodynamicDim> | |
void | sound_speed_squared (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &mass_density, const Scalar< DataType > &specific_internal_energy, const EquationsOfState::EquationOfState< false, ThermodynamicDim > &equation_of_state) |
template<typename DataType , size_t ThermodynamicDim> | |
Scalar< DataType > | sound_speed_squared (const Scalar< DataType > &mass_density, const Scalar< DataType > &specific_internal_energy, const EquationsOfState::EquationOfState< false, ThermodynamicDim > &equation_of_state) |
template<typename DataType , size_t Dim, typename Fr > | |
void | specific_kinetic_energy (gsl::not_null< Scalar< DataType > * > result, const tnsr::I< DataType, Dim, Fr > &velocity) |
template<typename DataType , size_t Dim, typename Fr > | |
Scalar< DataType > | specific_kinetic_energy (const tnsr::I< DataType, Dim, Fr > &velocity) |
Items related to evolving the Newtonian Euler system.
std::array< DataVector, Dim+2 > NewtonianEuler::characteristic_speeds | ( | const tnsr::I< DataVector, Dim > & | velocity, |
const Scalar< DataVector > & | sound_speed, | ||
const tnsr::i< DataVector, Dim > & | normal | ||
) |
Compute the characteristic speeds of NewtonianEuler system.
The principal symbol of the system is diagonalized so that the elements of the diagonal matrix are the characteristic speeds
\begin{align*} \lambda_1 &= v_n - c_s,\\ \lambda_{i + 1} &= v_n,\\ \lambda_{\text{Dim} + 2} &= v_n + c_s, \end{align*}
where \(i = 1,...,\text{Dim}\), \(v_n = n_i v^i\) is the velocity projected onto the normal, and \(c_s\) is the sound speed.
void NewtonianEuler::characteristic_speeds | ( | gsl::not_null< std::array< DataVector, Dim+2 > * > | char_speeds, |
const tnsr::I< DataVector, Dim > & | velocity, | ||
const Scalar< DataVector > & | sound_speed, | ||
const tnsr::i< DataVector, Dim > & | normal | ||
) |
Compute the characteristic speeds of NewtonianEuler system.
The principal symbol of the system is diagonalized so that the elements of the diagonal matrix are the characteristic speeds
\begin{align*} \lambda_1 &= v_n - c_s,\\ \lambda_{i + 1} &= v_n,\\ \lambda_{\text{Dim} + 2} &= v_n + c_s, \end{align*}
where \(i = 1,...,\text{Dim}\), \(v_n = n_i v^i\) is the velocity projected onto the normal, and \(c_s\) is the sound speed.
Scalar< DataType > NewtonianEuler::internal_energy_density | ( | const Scalar< DataType > & | mass_density, |
const Scalar< DataType > & | specific_internal_energy | ||
) |
Compute the internal energy density, \(\rho \epsilon\), where \(\rho\) is the mass density, and \(\epsilon\) is the specific internal energy.
void NewtonianEuler::internal_energy_density | ( | gsl::not_null< Scalar< DataType > * > | result, |
const Scalar< DataType > & | mass_density, | ||
const Scalar< DataType > & | specific_internal_energy | ||
) |
Compute the internal energy density, \(\rho \epsilon\), where \(\rho\) is the mass density, and \(\epsilon\) is the specific internal energy.
Scalar< DataType > NewtonianEuler::kinetic_energy_density | ( | const Scalar< DataType > & | mass_density, |
const tnsr::I< DataType, Dim, Fr > & | velocity | ||
) |
Compute the kinetic energy density, \(\rho v^2/2\), where \(\rho\) is the mass density, and \(v\) is the magnitude of the velocity.
void NewtonianEuler::kinetic_energy_density | ( | gsl::not_null< Scalar< DataType > * > | result, |
const Scalar< DataType > & | mass_density, | ||
const tnsr::I< DataType, Dim, Fr > & | velocity | ||
) |
Compute the kinetic energy density, \(\rho v^2/2\), where \(\rho\) is the mass density, and \(v\) is the magnitude of the velocity.
Matrix NewtonianEuler::left_eigenvectors | ( | const tnsr::I< double, Dim > & | velocity, |
const Scalar< double > & | sound_speed_squared, | ||
const Scalar< double > & | specific_enthalpy, | ||
const Scalar< double > & | kappa_over_density, | ||
const tnsr::i< double, Dim > & | unit_normal | ||
) |
Compute the transform matrices between the conserved variables and the characteristic variables of the NewtonianEuler system.
Let \(u\) be the conserved (i.e., evolved) variables of the Newtonian Euler system, and \(w\) the characteristic variables of this system with respect to a unit normal one form \(n_i\). The function left_eigenvectors
computes the matrix \(\Omega_{L}\) corresponding to the transform \(w = \Omega_{L} u\). The function right_eigenvectors
computes the matrix \(\Omega_{R}\) corresponding to the inverse transform \(u = \Omega_{R} w\). Here the components of \(u\) are ordered as \(u = \{\rho, \rho v_x, \rho v_y, \rho v_z, e\}\) in 3D, and the components of \(w\) are ordered by their corresponding eigenvalues (i.e., characteristic speeds) \(\lambda = \{v_n - c_s, v_n, v_n, v_n, v_n + c_s\}\). In these expressions, \(\rho\) is the fluid mass density, \(v_{x,y,z}\) are the components of the fluid velocity, \(e\) is the total energy density, \(v_n\) is the component of the velocity along the unit normal \(n_i\), and \(c_s\) is the sound speed.
For a short discussion of the characteristic transformation and the matrices \(\Omega_{L}\) and \(\Omega_{R}\), see [114] Chapter 3.
Here we briefly summarize the procedure. With \(F^x(u)\) the Newtonian Euler flux in direction \(x\), then the flux Jacobian along \(x\) is the matrix \(A_x = \partial F^x_{\beta}(u) / \partial u_{\alpha}\). The indices \(\alpha, \beta\) range over the different evolved fields. In higher dimensions, the flux Jacobian along the unit normal \(n_i\) is \(A = n_x A_x + n_y A_y + n_z A_z\). This matrix can be diagonalized as \(A = \Omega_{R} \Lambda \Omega_{L}\). Here \(\Lambda = \mathrm{diag}(v_n - c_s, v_n, v_n, v_n, v_n + c_s)\) is a diagonal matrix containing the characteristic speeds; \(\Omega_{R}\) is a matrix whose columns are the right eigenvectors of \(A\); \(\Omega_{L}\) is the inverse of \(R\).
Scalar< DataType > NewtonianEuler::mach_number | ( | const tnsr::I< DataType, Dim, Fr > & | velocity, |
const Scalar< DataType > & | sound_speed | ||
) |
Compute the local Mach number, \(\text{Ma} = v/c_s\), where \(v\) is the magnitude of the velocity, and \(c_s\) is the sound speed.
void NewtonianEuler::mach_number | ( | gsl::not_null< Scalar< DataType > * > | result, |
const tnsr::I< DataType, Dim, Fr > & | velocity, | ||
const Scalar< DataType > & | sound_speed | ||
) |
Compute the local Mach number, \(\text{Ma} = v/c_s\), where \(v\) is the magnitude of the velocity, and \(c_s\) is the sound speed.
std::pair< DataVector, std::pair< Matrix, Matrix > > NewtonianEuler::numerical_eigensystem | ( | const tnsr::I< double, Dim > & | velocity, |
const Scalar< double > & | sound_speed_squared, | ||
const Scalar< double > & | specific_enthalpy, | ||
const Scalar< double > & | kappa_over_density, | ||
const tnsr::i< double, Dim > & | unit_normal | ||
) |
Compute the transform matrices between the conserved variables and the characteristic variables of the NewtonianEuler system.
See right_eigenvectors
and left_eigenvectors
for more details.
However, note that this function computes the transformation (i.e., the eigenvectors of the flux Jacobian) numerically, instead of using the analytic expressions. This is useful as a proof-of-concept for more complicated systems where the analytic expressions may not be known.
tnsr::II< DataType, Dim, Fr > NewtonianEuler::ram_pressure | ( | const Scalar< DataType > & | mass_density, |
const tnsr::I< DataType, Dim, Fr > & | velocity | ||
) |
Compute the ram pressure, \(\rho v^i v^j\), where \(\rho\) is the mass density, and \(v^i\) is the velocity.
void NewtonianEuler::ram_pressure | ( | gsl::not_null< tnsr::II< DataType, Dim, Fr > * > | result, |
const Scalar< DataType > & | mass_density, | ||
const tnsr::I< DataType, Dim, Fr > & | velocity | ||
) |
Compute the ram pressure, \(\rho v^i v^j\), where \(\rho\) is the mass density, and \(v^i\) is the velocity.
Matrix NewtonianEuler::right_eigenvectors | ( | const tnsr::I< double, Dim > & | velocity, |
const Scalar< double > & | sound_speed_squared, | ||
const Scalar< double > & | specific_enthalpy, | ||
const Scalar< double > & | kappa_over_density, | ||
const tnsr::i< double, Dim > & | unit_normal | ||
) |
Compute the transform matrices between the conserved variables and the characteristic variables of the NewtonianEuler system.
Let \(u\) be the conserved (i.e., evolved) variables of the Newtonian Euler system, and \(w\) the characteristic variables of this system with respect to a unit normal one form \(n_i\). The function left_eigenvectors
computes the matrix \(\Omega_{L}\) corresponding to the transform \(w = \Omega_{L} u\). The function right_eigenvectors
computes the matrix \(\Omega_{R}\) corresponding to the inverse transform \(u = \Omega_{R} w\). Here the components of \(u\) are ordered as \(u = \{\rho, \rho v_x, \rho v_y, \rho v_z, e\}\) in 3D, and the components of \(w\) are ordered by their corresponding eigenvalues (i.e., characteristic speeds) \(\lambda = \{v_n - c_s, v_n, v_n, v_n, v_n + c_s\}\). In these expressions, \(\rho\) is the fluid mass density, \(v_{x,y,z}\) are the components of the fluid velocity, \(e\) is the total energy density, \(v_n\) is the component of the velocity along the unit normal \(n_i\), and \(c_s\) is the sound speed.
For a short discussion of the characteristic transformation and the matrices \(\Omega_{L}\) and \(\Omega_{R}\), see [114] Chapter 3.
Here we briefly summarize the procedure. With \(F^x(u)\) the Newtonian Euler flux in direction \(x\), then the flux Jacobian along \(x\) is the matrix \(A_x = \partial F^x_{\beta}(u) / \partial u_{\alpha}\). The indices \(\alpha, \beta\) range over the different evolved fields. In higher dimensions, the flux Jacobian along the unit normal \(n_i\) is \(A = n_x A_x + n_y A_y + n_z A_z\). This matrix can be diagonalized as \(A = \Omega_{R} \Lambda \Omega_{L}\). Here \(\Lambda = \mathrm{diag}(v_n - c_s, v_n, v_n, v_n, v_n + c_s)\) is a diagonal matrix containing the characteristic speeds; \(\Omega_{R}\) is a matrix whose columns are the right eigenvectors of \(A\); \(\Omega_{L}\) is the inverse of \(R\).
Scalar< DataType > NewtonianEuler::sound_speed_squared | ( | const Scalar< DataType > & | mass_density, |
const Scalar< DataType > & | specific_internal_energy, | ||
const EquationsOfState::EquationOfState< false, ThermodynamicDim > & | equation_of_state | ||
) |
Compute the Newtonian sound speed squared \(c_s^2 = \chi + p\kappa / \rho^2\), where \(p\) is the fluid pressure, \(\rho\) is the mass density, \(\chi = (\partial p/\partial\rho)_\epsilon\) and \(\kappa = (\partial p/ \partial \epsilon)_\rho\), where \(\epsilon\) is the specific internal energy.
void NewtonianEuler::sound_speed_squared | ( | gsl::not_null< Scalar< DataType > * > | result, |
const Scalar< DataType > & | mass_density, | ||
const Scalar< DataType > & | specific_internal_energy, | ||
const EquationsOfState::EquationOfState< false, ThermodynamicDim > & | equation_of_state | ||
) |
Compute the Newtonian sound speed squared \(c_s^2 = \chi + p\kappa / \rho^2\), where \(p\) is the fluid pressure, \(\rho\) is the mass density, \(\chi = (\partial p/\partial\rho)_\epsilon\) and \(\kappa = (\partial p/ \partial \epsilon)_\rho\), where \(\epsilon\) is the specific internal energy.
Scalar< DataType > NewtonianEuler::specific_kinetic_energy | ( | const tnsr::I< DataType, Dim, Fr > & | velocity | ) |
Compute the specific kinetic energy, \(v^2/2\), where \(v\) is the magnitude of the velocity.
void NewtonianEuler::specific_kinetic_energy | ( | gsl::not_null< Scalar< DataType > * > | result, |
const tnsr::I< DataType, Dim, Fr > & | velocity | ||
) |
Compute the specific kinetic energy, \(v^2/2\), where \(v\) is the magnitude of the velocity.