Ejemplo n.º 1
0
def test_shockwave_Rho():
    assert sw.Rho_ratio(1.) == 1.
    assert sw.Rho_ratio(1.1) == pytest.approx(1.1690821256038648)
    assert sw.Rho_ratio(2.) == pytest.approx(2.666666666666667)
    assert sw.Rho_ratio(1., gamma=1.3) == 1.
    assert sw.Rho_ratio(1.1, gamma=1.3) == pytest.approx(1.1777401608125266)
    assert sw.Rho_ratio(2., gamma=1.3) == pytest.approx(2.875)
Ejemplo n.º 2
0
	def _rankinehugoniot_from_ushock(self, ushock):
		"""
			returns Rankine-Hugoniot state, given a shock velocity
		
			..warning:: this function is made private because there is no test about upstream/downstream consistency
			nor the right ushock range (greater than u+a or lesser than u-a
		"""
		loc_Mn    = (self.u-ushock)/self.asound()          # this Mach number is signed
		rho_ratio = sw.Rho_ratio(loc_Mn, self._gamma)
		return unsteady_state(self.rho * rho_ratio,
		             ushock + (self.u-ushock)/rho_ratio,
		             self.p * sw.Ps_ratio(loc_Mn, self._gamma),
	 	             gamma=self._gamma)