Skip to content

rgfrosh.shock.IdealShock

Bases: Shock

A class for calculating properties in various regions of an ideal reflected shock. Most of the equations implemented were derived in Gaydon and Hurle1.


  1. Gaydon, A. G. and I. R. Hurle (1963). The shock tube in high-temperature chemical physics, Reinhold Publishing Corporation. 

__init__(gamma: float, MW: float, *, M: float = None, u1: float = None, T1: float = 300, P1: float = None, T5: float = None, P5: float = None)

Solves the ideal shock equations for the following combination of parameters:

  1. Incident shock Mach number (\(M\)), or incident shock velocity (\(u_1\)), and initial conditions (\(T_1\), \(P_1\))
  2. Reflected shock conditions (\(T_5\), \(P_5\)) and initial temperature (\(T_1\))

given the mixture's specific heat ratio (\(\gamma\)) and mean molecular weight (\(\overline{M}\)). Density is calculated using the ideal gas law:

\[ \rho = \frac{P}{RT} \]

where \(R\) is the specific gas constant:

\[ R = R_\text{universal}/\overline{M} \]

The speed of sound (\(a\)) is calculated as:

\[ a = \sqrt{\gamma R T} \]

Parameters:

  • gamma (float) –

    Specific heat ratio.

  • MW (float) –

    Molecular weight [g/mol].

Other Parameters:

  • u1 (float) –

    Incident shock velocity [m/s].

  • M (float) –

    Incident shock Mach number.

  • T1 (float) –

    Initial temperature [K].

  • P1 (float) –

    Initial pressure [Pa].

  • T5 (float) –

    Temperature behind the reflected shock [K].

  • P5 (float) –

    Pressure behind the reflected shock [Pa].

Raises:

  • ValueError

    If the system is underconstrained/overconstrained.

from_thermo(thermo: ThermoInterface, **kwargs) classmethod

Alternative constructor from a ThermoInterface object.

For an ideal gas, the specific heat at constant volume (\(c_v\)) is related to the specific heat at constant pressure (\(c_p\)) by the gas constant (\(R\)):

\[ c_p = c_v + R \]

therefore, the specific heat ratio (\(\gamma\)) is calculated from the available properties as:

\[ \gamma = \frac{c_p}{c_p - R} \]

Note

\(c_p\) is evaluated at the current state of the thermo object; therefore, the calculated \(\gamma\) may differ from the nominal value.

incident_pressure_ratio(M: float, gamma: float) -> float staticmethod

Calculates the pressure ratio across the incident shock:

\[ \frac{P_2}{P_1} = \frac{2\gamma M^2-(\gamma-1)}{\gamma+1} \]

Parameters:

  • M (float) –

    Incident shock Mach number.

  • gamma (float) –

    Specific heat ratio.

incident_temperature_ratio(M: float, gamma: float) -> float staticmethod

Calculates the temperature ratio across the incident shock:

\[ \frac{T_2}{T_1} = \frac{ \left(\gamma M^2 - \frac{\gamma-1}{2}\right) \left(\frac{\gamma-1}{2}M^2+1\right) }{ \left(\frac{\gamma+1}{2}\right)^2 M^2 } \]

Parameters:

  • M (float) –

    Incident shock Mach number.

  • gamma (float) –

    Specific heat ratio.

incident_density_ratio(M: float, gamma: float) -> float staticmethod

Calculates the density ratio across the incident shock:

\[ \frac{\rho_2}{\rho_1} = \frac {(\gamma+1)M^2} {(\gamma-1)M^2+2} \]

which is also the velocity ratio across the incident shock:

\[ \frac{u_1}{u_2} = \frac{\rho_2}{\rho_1} \]

Parameters:

  • M (float) –

    Incident shock Mach number.

  • gamma (float) –

    Specific heat ratio.

reflected_pressure_ratio(M: float, gamma: float) -> float staticmethod

Calculates the ratio of the reflected shock pressure to the initial pressure:

\[ \frac{P_5}{P_1} = \left[\frac{2\gamma M^2-(\gamma-1)}{\gamma+1}\right] \left[\frac{(3\gamma-1)M^2-2(\gamma-1)}{(\gamma-1)M^2+2}\right] \]

Parameters:

  • M (float) –

    Incident shock Mach number.

  • gamma (float) –

    Specific heat ratio.

reflected_temperature_ratio(M: float, gamma: float) -> float staticmethod

Calculates the ratio of the reflected shock temperature to the initial temperature:

\[ \frac{T_5}{T_1} = \frac{\left[2(\gamma-1)M^2+(3-\gamma)\right] \left[(3\gamma-1)M^2-2(\gamma-1)\right]} {(\gamma+1)^2M^2} \]

Parameters:

  • M (float) –

    Incident shock Mach number.

  • gamma (float) –

    Specific heat ratio.

reflected_velocity_ratio(M: float, gamma: float) -> float staticmethod

Calculates the ratio of the reflected shock velocity to the incident shock velocity:

\[ \frac{V_R}{V_S} = \frac{2+\frac{2}{\gamma-1}\frac{P_1}{P_2}} {\frac{\gamma+1}{\gamma-1}-\frac{P_1}{P_2}} \]

Parameters:

  • M (float) –

    Incident shock Mach number.

  • gamma (float) –

    Specific heat ratio.

incident_Mach_number(gamma: float, T5: float, T1: float = 1) staticmethod

Calculates the incident shock Mach number from the ratio of the reflected shock temperature to the initial temperature. Expanding the equation for the reflected temperature ratio yields an equation of the form:

\[ aM^4 + bM^2 + c = 0 \]

where

\[ a = 2(3\gamma-1)(\gamma-1) \]
\[ b = (3\gamma-1)(3-\gamma) - 4(\gamma-1)^2 - \frac{T_5}{T_1}(\gamma+1)^2 \]
\[ c = -2(3-\gamma)(\gamma-1) \]

Solving the above equation for \(M^2\) using the quadratic formula, then taking the square root of the non-negative solution, yields the incident shock Mach number for the given temperature ratio:

\[ M = \sqrt{\frac{-b + \sqrt{b^2-4ac}}{2a}} \]

Parameters:

  • gamma (float) –

    Specific heat ratio.

  • T5 (float) –

    Reflected shock temperature [K].

  • T1 (float, default: 1 ) –

    Initial temperature [K].

Note

If T1 is not specified, it is assumed that the temperature ratio \({T_5}/{T_1}\) is given as T5.