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.
-
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:
- Incident shock Mach number (\(M\)), or incident shock velocity (\(u_1\)), and initial conditions (\(T_1\), \(P_1\))
- 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:
where \(R\) is the specific gas constant:
The speed of sound (\(a\)) is calculated as:
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\)):
therefore, the specific heat ratio (\(\gamma\)) is calculated from the available properties as:
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:
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:
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:
which is also the velocity ratio across the incident shock:
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:
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:
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:
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:
where
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:
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
.