TrixiShockTube.IdealGasType
IdealGas(P, T, R, gamma)

Initialize an ideal gas with the specified pressure, temperature, specific gas constant, and isentropic exponent. All properties are specified in SI units:

  • P: pressure [Pa]
  • T: temperature [K]
  • R: specific gas constant [J/(kg*K)]
  • gamma: isentropic exponent

If you don't want to remember the argument order, you can use keyword arguments, e.g.

IdealGas(P = 101325, T = 300, R = 296.8, gamma = 7/5)
source
TrixiShockTube.IdealGasMethod
IdealGas(species::String, P, T)

Create an ideal gas with the specified species name, pressure, and temperature. If the species gas is not one of the following gases, its properties are obtained from PyThermo: [N2, Ar, O2, CO2, air, H2, He, SF6].

source
TrixiShockTube.boundary_condition_reflectMethod
boundary_condition_reflect(u_inner, orientation, direction, x, t,
                           surface_flux_function, equations::CompressibleEulerMulticomponentEquations1D)

Boundary condition reflecting the flow at the domain edges.

source
TrixiShockTube.build_ODEMethod
build_ODE(semi, saveat, cfl; callbacks)

Build an ODE problem with the specified semi semidiscretization, saveat output time steps and cfl CFL limiter using the CompressibleEulerMulticomponentEquations1D equations. Any additional callbacks are passed to the CallbackSet constructor.

Arguments

  • semi::SemidiscretizationHyperbolic: semidiscretization for which to build the ODE problem
  • saveat::AbstractVector{<:Real}: time steps at which to save the solution
  • cfl::Real: CFL limiter

Keyword arguments

  • callbacks::Tuple(Function)...: additional callbacks to pass to the CallbackSet constructor. See Trixi.jl callbacks for more details.
source
TrixiShockTube.build_limiterMethod
build_limiter(thresh, equations::CompressibleEulerMulticomponentEquations1D)
build_limiter(equations::CompressibleEulerMulticomponentEquations1D)

Build a PositivityPreservingLimiterZhangShu for the CompressibleEulerMulticomponentEquations1D equations with the given threshold(s) for each of N components' (NC) density and the total pressure.

Arguments

  • thresh::NTuple{NC+1, <:Real}: minimum threshold(s) for each species' density and the total pressure
  • equations::CompressibleEulerMulticomponentEquations1D: equations for which to build the limiter

Alternatively, a single threshold can be specified for all species' densities and the total pressure. If a threshold is not specified, a default value of 1e-7 is used.

source
TrixiShockTube.build_semidiscretizationMethod
build_semidiscretization(slabs, equations::CompressibleEulerMulticomponentEquations1D;
                         origin = 0.0,
                         initial_refinement_level = 7,
                         n_cells_max = 10_000,
                         surface_flux = flux_lax_friedrichs,
                         volume_flux  = flux_ranocha,
                         basis        = LobattoLegendreBasis(3),
                         indicator_sc = IndicatorHennemannGassner(equations, basis,
                                                                 alpha_max=0.5,
                                                                 alpha_min=0.001,
                                                                 alpha_smooth=true,
                                                                 variable=density_pressure))

Build a DGSEM semidiscretization with the specified surface_flux and volume_flux using the CompressibleEulerMulticomponentEquations1D equations.

Arguments

  • slabs::Tuple{<:Chemical, <:Real}...: gas composition and length [m] of each slab
  • equations::CompressibleEulerMulticomponentEquations1D: equations for which to build the semidiscretization

Keyword arguments

  • origin::Real: origin of the domain
  • initial_refinement_level::Integer: initial refinement level (number of elements = 2^level)
  • n_cells_max::Integer: maximum number of cells
  • surface_flux::Function: surface flux function
  • volume_flux::Function: two-point volume flux function (must be one of flux_ranocha, flux_shima_etal, flux_chandrashekar or flux_kennedy_gruber)
  • basis::LobattoLegendreBasis: polynomial basis of the approximation space of specified order
  • indicator_sc::IndicatorHennemannGassner: shock-capturing indicator for the DGSEM solver
source
TrixiShockTube.build_shocktube_icMethod
build_shockube_ic(slabs::Tuple{<:Chemical, <:Real}...)

Create an initial condition for a shock tube problem given the gas composition and length of each slab. The gas composition is specified as either a Species or Mixture object from PyThermo.jl.

Arguments

  • slabs::Tuple{<:Chemical, <:Real}...: gas composition and length [m] of each slab

Keyword arguments

  • origin::Float64: coordinate system origin of the shock tube in meters relative to the start of the first slab; default is 0.0.
  • pseudodensity::Float64: artificial fill fraction relative to true density [kg/m^3] in regions outside of the specified slab. Increase if numerical instabilities are encountered. Default is 1e-4.
source
TrixiShockTube.calculate_MachFunction
calculate_Mach(driver, driven, P_driver = ustrip(u"Pa", PyThermo.pressure(driver)))

Calculate the Mach number generated in a lossless 1D shock tube given the driver and driven gas compositions and thermodynamic states. The gas compositions and states are specified as either Species or Mixture objects from PyThermo.jl.

Arguments

  • driver::PyThermo.Chemical: driver gas composition
  • driven::PyThermo.Chemical: driven gas composition

Optional arguments

  • M₀::Float64: initial guess for Mach number; default is 1.1

Keyword arguments

  • P_driver::Float64: driver gas pressure in Pa; taken from driver argument pressure if not specified.
source
TrixiShockTube.density_pressureMethod
density_pressure(u, equations::CompressibleEulerMulticomponentEquations1D)

Compute the density times the pressure from the conserved variables u.

source
TrixiShockTube.locatorMethod
locator(lengths, origin)

Create a function that returns the index of the slab containing a given position.

Arguments

  • lengths::AbstractVector{<:Real}: length of each slab [m]
  • origin::Real: coordinate system origin of the shock tube in meters relative to the start of the first slab
source
TrixiShockTube.run_shockMethod
run_shock(semi, saveat, cfl, limiter!; callbacks)

Run a shock tube simulation with the specified semi semidiscretization, saveat output time steps, cfl CFL limiter, and limiter! positivity-preserving limiter using the CompressibleEulerMulticomponentEquations1D equations. Any additional callbacks are passed to the CallbackSet constructor.

Arguments

  • semi::SemidiscretizationHyperbolic: semidiscretization for which to build the ODE problem
  • saveat::AbstractVector{<:Real}: time steps at which to save the solution
  • cfl::Real: CFL limiter
  • limiter!::Function: positivity-preserving limiter

Keyword arguments

  • callbacks::Tuple(Function)...: additional callbacks to pass to the CallbackSet constructor. See Trixi.jl callbacks for more details.
source
TrixiShockTube.xtdataMethod
xtdata(sol, semi; nvisnodes=nothing)

Extract the primitive field solution data from the sol solution and semi semidiscretization at nvisnodes visualization nodes. By default, nvisnodes is set to twice the number of nodes in the polynomial approximation space. If nvisnodes is set to zero, the solution data is extracted at the nodes of the approximation space.

Arguments

  • sol::TrixiODESolution: solution to extract the data from
  • semi::SemidiscretizationHyperbolic: semidiscretization for which to extract the data

Keyword arguments

  • nvisnodes::Integer: number of visualization nodes
source