SpECTRE  v2024.04.12
hydro::Solutions::SmoothFlow< Dim, IsRelativistic > Class Template Reference

Smooth sinusoidal density wave. More...

#include <SmoothFlow.hpp>

Classes

struct  AdiabaticIndex
 The adiabatic index for the ideal fluid. More...
 
struct  MeanVelocity
 The mean flow velocity. More...
 
struct  PerturbationSize
 The perturbation amplitude of the rest mass density of the fluid. More...
 
struct  Pressure
 The constant pressure throughout the fluid. More...
 
struct  WaveVector
 The wave vector of the profile. More...
 

Public Member Functions

 SmoothFlow (const SmoothFlow &)=default
 
SmoothFlowoperator= (const SmoothFlow &)=default
 
 SmoothFlow (SmoothFlow &&)=default
 
SmoothFlowoperator= (SmoothFlow &&)=default
 
 SmoothFlow (CkMigrateMessage *)
 
void pup (PUP::er &)
 

Protected Types

using equation_of_state_type = EquationsOfState::IdealFluid< IsRelativistic >
 
using options = tmpl::list< MeanVelocity, WaveVector, Pressure, AdiabaticIndex, PerturbationSize >
 

Protected Member Functions

 SmoothFlow (const std::array< double, Dim > &mean_velocity, const std::array< double, Dim > &wavevector, double pressure, double adiabatic_index, double perturbation_size)
 
const EquationsOfState::IdealFluid< IsRelativistic > & equation_of_state () const
 
template<typename DataType >
auto variables (const tnsr::I< DataType, Dim > &x, double t, tmpl::list< hydro::Tags::RestMassDensity< DataType > >) const -> tuples::TaggedTuple< hydro::Tags::RestMassDensity< DataType > >
 Retrieve hydro variable at (x, t)
 
template<typename DataType >
auto variables (const tnsr::I< DataType, Dim > &x, double t, tmpl::list< hydro::Tags::SpecificInternalEnergy< DataType > >) const -> tuples::TaggedTuple< hydro::Tags::SpecificInternalEnergy< DataType > >
 Retrieve hydro variable at (x, t)
 
template<typename DataType >
auto variables (const tnsr::I< DataType, Dim > &x, double, tmpl::list< hydro::Tags::Pressure< DataType > >) const -> tuples::TaggedTuple< hydro::Tags::Pressure< DataType > >
 Retrieve hydro variable at (x, t)
 
template<typename DataType >
auto variables (const tnsr::I< DataType, Dim > &x, double, tmpl::list< hydro::Tags::SpatialVelocity< DataType, Dim > >) const -> tuples::TaggedTuple< hydro::Tags::SpatialVelocity< DataType, Dim > >
 Retrieve hydro variable at (x, t)
 
template<typename DataType , bool LocalIsRelativistic = IsRelativistic, Requires< IsRelativistic and IsRelativistic==LocalIsRelativistic > = nullptr>
auto variables (const tnsr::I< DataType, Dim > &x, double, tmpl::list< hydro::Tags::LorentzFactor< DataType > >) const -> tuples::TaggedTuple< hydro::Tags::LorentzFactor< DataType > >
 Retrieve hydro variable at (x, t)
 
template<typename DataType >
auto variables (const tnsr::I< DataType, Dim > &x, double t, tmpl::list< hydro::Tags::SpecificEnthalpy< DataType > >) const -> tuples::TaggedTuple< hydro::Tags::SpecificEnthalpy< DataType > >
 Retrieve hydro variable at (x, t)
 

Friends

template<size_t LocalDim, bool LocalIsRelativistic>
bool operator== (const SmoothFlow< LocalDim, LocalIsRelativistic > &lhs, const SmoothFlow< LocalDim, LocalIsRelativistic > &rhs)
 

Detailed Description

template<size_t Dim, bool IsRelativistic>
class hydro::Solutions::SmoothFlow< Dim, IsRelativistic >

Smooth sinusoidal density wave.

This is the generic infrastructure for a smooth flow solution that can be used by the hydro systems to avoid code duplication. The solution has a constant pressure and uniform spatial velocity provided that the rest mass density satisfies the advection equation

\begin{align*} \partial_t\rho + v^i\partial_i\rho = 0, \end{align*}

and the specific internal energy is a function of the rest mass density only, \(\epsilon = \epsilon(\rho)\). For testing purposes, this class implements this solution for the case where \(\rho\) is a sine wave. The user specifies the mean flow velocity of the fluid, the wavevector of the density profile, and the amplitude \(A\) of the density profile. In Cartesian coordinates \((x, y, z)\), and using dimensionless units, the primitive variables at a given time \(t\) are then

\begin{align*} \rho(\vec{x},t) &= 1 + A \sin(\vec{k}\cdot(\vec{x} - \vec{v}t)) \\ \vec{v}(\vec{x},t) &= [v_x, v_y, v_z]^{T},\\ P(\vec{x},t) &= P, \\ \epsilon(\vec{x}, t) &= \frac{P}{(\gamma - 1)\rho}\\ \end{align*}

where we have assumed \(\epsilon\) and \(\rho\) to be related through an equation mathematically equivalent to the equation of state of an ideal gas, where the pressure is held constant.


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