This package provides routines for computing property changes across shock waves in perfect gases. The ultimate goal is to support a solver that can be used to analyze complex interactions of shock waves in dynamic systems.
The ConservedProps
and PrimitiveProps
types allow for conversion between specifying gas properties as
free_stream = PrimitiveProps(1.225u"kg/m^3", [2.0, 0.0], 300u"K")
u = ConservedProps(free_stream, DRY_AIR)
Property computation and conversion can be done via a myriad of functions. Any arguments given as Float64
are assumed to be in SI base units (e.g. Pa
, not atm
or kPa
), even if the numerical value is unfriendly!
Interrogating ConservedProps
and PrimitiveProps
is easily done via:
density(u)
: Density of stateu
.momentum(u, gas)
: Momentum of stateu
velocity(u, gas)
: Velocity of stateu
mach_number(u, gas)
: Mach number of stateu
temperature(u, gas)
: Temperature of stateu
total_internal_energy_density(u, gas)
: Total (internal + kinetic) energy density of stateu
Other properties can be directly computed:
pressure(u, gas)
: also offers overloads for certain special cases.static_enthalpy_density(u, gas)
: Computes the static enthalpy density ofu
. Does NOT include kinetic energy!total_enthalpy_density(u, gas)
: Computes total enthalpy density ofu
. DOES include kinetic energy!
"Specific" properties are related to the mass of a state, rather than its volume.
specific_internal_energy(u, gas)
specific_static_enthalpy(u, gas)
specific_total_enthalpy(u, gas)
We can compute the change in properties across a shock wave from the shock normal
stream_R = state_behind(free_stream, n̂, t̂)
u_R = state_behind(u_L, n̂, t̂)
The test suite does some basic dimensional analysis -- the speed of sound should be a velocity, pressure should be a pressure, etc. Additionally, it tests the Rankine-Hugoniot conditions for a stable shock and verifies some algebraic properties of the Billig shockwave parametrization.
- Extend this module with routines to compute interactions between shock waves
- Integrate this module into a larger project that can handle time-dependent situations and simulations.
Simply fork this repository and submit a pull request, should you wish.