TrixiShockTube.IdealGasTrixiShockTube.IdealGasTrixiShockTube.boundary_condition_reflectTrixiShockTube.build_ODETrixiShockTube.build_limiterTrixiShockTube.build_semidiscretizationTrixiShockTube.build_shocktube_icTrixiShockTube.calculate_MachTrixiShockTube.density_pressureTrixiShockTube.locatorTrixiShockTube.run_shockTrixiShockTube.xtdata
TrixiShockTube.IdealGas — TypeIdealGas(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)TrixiShockTube.IdealGas — MethodIdealGas(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].
TrixiShockTube.boundary_condition_reflect — Methodboundary_condition_reflect(u_inner, orientation, direction, x, t,
surface_flux_function, equations::CompressibleEulerMulticomponentEquations1D)Boundary condition reflecting the flow at the domain edges.
TrixiShockTube.build_ODE — Methodbuild_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 problemsaveat::AbstractVector{<:Real}: time steps at which to save the solutioncfl::Real: CFL limiter
Keyword arguments
callbacks::Tuple(Function)...: additional callbacks to pass to theCallbackSetconstructor. See Trixi.jl callbacks for more details.
TrixiShockTube.build_limiter — Methodbuild_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 pressureequations::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.
TrixiShockTube.build_semidiscretization — Methodbuild_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 slabequations::CompressibleEulerMulticomponentEquations1D: equations for which to build the semidiscretization
Keyword arguments
origin::Real: origin of the domaininitial_refinement_level::Integer: initial refinement level (number of elements = 2^level)n_cells_max::Integer: maximum number of cellssurface_flux::Function: surface flux functionvolume_flux::Function: two-point volume flux function (must be one offlux_ranocha,flux_shima_etal,flux_chandrashekarorflux_kennedy_gruber)basis::LobattoLegendreBasis: polynomial basis of the approximation space of specified orderindicator_sc::IndicatorHennemannGassner: shock-capturing indicator for the DGSEM solver
TrixiShockTube.build_shocktube_ic — Methodbuild_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.
TrixiShockTube.calculate_Mach — Functioncalculate_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 compositiondriven::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 fromdriverargument pressure if not specified.
TrixiShockTube.density_pressure — Methoddensity_pressure(u, equations::CompressibleEulerMulticomponentEquations1D)Compute the density times the pressure from the conserved variables u.
TrixiShockTube.locator — Methodlocator(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
TrixiShockTube.run_shock — Methodrun_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 problemsaveat::AbstractVector{<:Real}: time steps at which to save the solutioncfl::Real: CFL limiterlimiter!::Function: positivity-preserving limiter
Keyword arguments
callbacks::Tuple(Function)...: additional callbacks to pass to theCallbackSetconstructor. See Trixi.jl callbacks for more details.
TrixiShockTube.xtdata — Methodxtdata(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 fromsemi::SemidiscretizationHyperbolic: semidiscretization for which to extract the data
Keyword arguments
nvisnodes::Integer: number of visualization nodes