SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
NewtonianEuler::AnalyticData::KhInstability< Dim > Class Template Reference

Initial data to simulate the Kelvin-Helmholtz instability. More...

#include <KhInstability.hpp>

Classes

struct  AdiabaticIndex
 The adiabatic index of the fluid. More...
struct  BackgroundDensity
 The mass density outside of the strip. More...
struct  BackgroundVelocity
 The velocity along \(x\) outside of the strip. More...
struct  PerturbAmplitude
 The amplitude of the perturbation. More...
struct  PerturbWidth
 The characteristic length for the width of the perturbation. More...
struct  Pressure
 The initial (constant) pressure of the fluid. More...
struct  StripBimedianHeight
 The vertical coordinate of the horizontal bimedian of the strip. More...
struct  StripDensity
 The mass density in the strip. More...
struct  StripThickness
 The thickness of the strip. More...
struct  StripVelocity
 The velocity along \(x\) in the strip. More...

Public Types

using equation_of_state_type = EquationsOfState::IdealFluid<false>
using options

Public Member Functions

 KhInstability (const KhInstability &)=default
KhInstabilityoperator= (const KhInstability &)=default
 KhInstability (KhInstability &&)=default
KhInstabilityoperator= (KhInstability &&)=default
auto get_clone () const -> std::unique_ptr< evolution::initial_data::InitialData > override
 KhInstability (double adiabatic_index, double strip_bimedian_height, double strip_thickness, double strip_density, double strip_velocity, double background_density, double background_velocity, double pressure, double perturbation_amplitude, double perturbation_width)
template<typename DataType, typename... Tags>
tuples::TaggedTuple< Tags... > variables (const tnsr::I< DataType, Dim, Frame::Inertial > &x, tmpl::list< Tags... >) const
 Retrieve a collection of hydrodynamic variables at position x.
const EquationsOfState::IdealFluid< false > & equation_of_state () const
void pup (PUP::er &) override

Static Public Attributes

static constexpr Options::String help

Friends

template<size_t SpatialDim>
bool operator== (const KhInstability< SpatialDim > &lhs, const KhInstability< SpatialDim > &rhs)

Detailed Description

template<size_t Dim>
class NewtonianEuler::AnalyticData::KhInstability< Dim >

Initial data to simulate the Kelvin-Helmholtz instability.

For comparison purposes, this class implements the planar shear of [183], which is evolved using periodic boundary conditions. The initial state consists of a horizontal strip of mass density \(\rho_\text{in}\) moving with horizontal speed \(v_{\text{in}}\). The rest of the fluid possesses mass density \(\rho_\text{out}\), and its horizontal velocity is \(v_{\text{out}}\), both constant. Mathematically,

\begin{align*} \rho(x, y) = \begin{cases} \rho_\text{in}, & \left|y - y_\text{mid}\right| < b/2\\ \rho_\text{out}, & \text{otherwise}, \end{cases} \end{align*}

and

\begin{align*} v_x(x, y) = \begin{cases} v_{\text{in}}, & \left|y - y_\text{mid}\right| < b/2\\ v_{\text{out}}, & \text{otherwise}, \end{cases} \end{align*}

where \(b > 0\) is the thickness of the strip, and \(y = y_\text{mid}\) is its horizontal bimedian. The initial pressure is set equal to a constant, and the system is evolved assuming an ideal fluid of known adiabatic index. Finally, in order to excite the instability, the vertical velocity is initialized to

\begin{align*} v_y(x, y) = A\sin(4\pi x) \left[\exp\left(-\dfrac{(y - y_\text{top})^2}{2\sigma^2}\right) + \exp\left(-\dfrac{(y - y_\text{bot})^2}{2\sigma^2}\right)\right], \end{align*}

whose net effect is to perturb the horizontal boundaries of the strip periodically along the \(x-\)axis. Here \(A\) is the amplitude, \(\sigma\) is a characteristic length for the perturbation width, and \(y_\text{top} = y_\text{mid} + b/2\) and \(y_\text{bot} = y_\text{mid} - b/2\) are the vertical coordinates of the top and bottom boundaries of the strip, respectively.

Note
The periodic form of the perturbation enforces the horizontal extent of the domain to be a multiple of 0.5. The domain chosen in [183] is the square \([0, 1]^2\), which covers two wavelengths of the perturbation. In addition, the authors ran their simulations using
PerturbWidth: 0.035355339059327376 # 0.05/sqrt(2)
The adiabatic index of the fluid.
Definition KhInstability.hpp:105
The mass density outside of the strip.
Definition KhInstability.hpp:141
The velocity along outside of the strip.
Definition KhInstability.hpp:149
The amplitude of the perturbation.
Definition KhInstability.hpp:164
The characteristic length for the width of the perturbation.
Definition KhInstability.hpp:171
The initial (constant) pressure of the fluid.
Definition KhInstability.hpp:156
The vertical coordinate of the horizontal bimedian of the strip.
Definition KhInstability.hpp:112
The mass density in the strip.
Definition KhInstability.hpp:126
The thickness of the strip.
Definition KhInstability.hpp:118
The velocity along in the strip.
Definition KhInstability.hpp:134
Note
This class can be used to initialize 2D and 3D data. In 3D, the strip is aligned to the \(xy-\)plane, and the vertical direction is taken to be the \(z-\)axis.

Member Typedef Documentation

◆ options

template<size_t Dim>
using NewtonianEuler::AnalyticData::KhInstability< Dim >::options
Initial value:
The adiabatic index of the ideal fluid.
Definition BlastWave.hpp:120
The mass density outside of the strip.
Definition KhInstability.hpp:123
The velocity along outside of the strip.
Definition KhInstability.hpp:131
The amplitude of the perturbation.
Definition KhInstability.hpp:146
The characteristic length for the width of the perturbation.
Definition KhInstability.hpp:153
The initial (constant) pressure of the fluid.
Definition KhInstability.hpp:138
The vertical coordinate of the horizontal bimedian of the strip.
Definition KhInstability.hpp:94
The mass density in the strip.
Definition KhInstability.hpp:108
The thickness of the strip.
Definition KhInstability.hpp:100
The velocity along in the strip.
Definition KhInstability.hpp:116

Member Function Documentation

◆ get_clone()

template<size_t Dim>
auto NewtonianEuler::AnalyticData::KhInstability< Dim >::get_clone ( ) const -> std::unique_ptr< evolution::initial_data::InitialData >
overridevirtual

Member Data Documentation

◆ help

template<size_t Dim>
Options::String NewtonianEuler::AnalyticData::KhInstability< Dim >::help
staticconstexpr
Initial value:
= {
"Initial data to simulate the KH instability."}

The documentation for this class was generated from the following file:
  • src/PointwiseFunctions/AnalyticData/NewtonianEuler/KhInstability.hpp