Testing r3d2

Should be simple tests of r3d2 in the notebook.


In [1]:
from r3d2 import State, RiemannProblem, eos_defns, wave
from IPython.display import display, display_png, display_svg

In [2]:
q_unburnt = 0.1
gamma = 5/3
Cv = 1.0
t_i = 2
eos_burnt = eos_defns.eos_gamma_law(gamma)
eos_unburnt = eos_defns.eos_gamma_law_react(gamma, q_unburnt, Cv, t_i, eos_burnt)
q_left = State(1, 0, 0, 2, eos_burnt)
q_right = State(1, 0, 0, 3, eos_unburnt)

In [3]:
rp = RiemannProblem(q_left, q_right)

In [4]:
rp


Out[4]:

In [5]:
display_png(rp)


Inert tests


In [6]:
eos = eos_defns.eos_gamma_law(5.0/3.0)
test_1_w_left = State(10.0, 0.0, 0.0, 2.0, eos, label="L")
test_1_w_right = State(1.0, 0.0, 0.0, 1.5e-6, eos, label="R")
test_1_rp = RiemannProblem(test_1_w_left, test_1_w_right)
test_2_w_left = State(1.0, 0.0, 0.0, 1500.0, eos, label="L")
test_2_w_right = State(1.0, 0.0, 0.0, 1.5e-2, eos, label="R")
test_2_rp = RiemannProblem(test_2_w_left, test_2_w_right)
test_3_w_left = State(1.0, 0.0, 0.0, 1500, eos, label="L")
test_3_w_right = State(1.0, 0.0, 0.99, 0.015, eos, label="R")
test_3_rp = RiemannProblem(test_3_w_left, test_3_w_right)
test_4_w_left = State(1.0, 0.0, 0.9, 1500, eos, label="L")
test_4_w_right = State(1.0, 0.0, 0.9, 0.015, eos, label="R")
test_4_rp = RiemannProblem(test_4_w_left, test_4_w_right);

In [7]:
for i in test_1_rp, test_2_rp, test_3_rp, test_4_rp:
    display(i)
    display_png(i)


Burning tests


In [8]:
eos = eos_defns.eos_gamma_law(5.0/3.0)
eos_reactive = eos_defns.eos_gamma_law_react(5.0/3.0, 0.1, 1.0, 1.0, eos)

# a single detonation wave
test_5_U_reactive = State(5.0, 0.0, 0.0, 2.0, eos_reactive)
test_5_U_burnt = State(8.113665227084942, -0.34940431910454606, 0.0, 
                2.7730993786742353, eos)
test_5_rp = RiemannProblem(test_5_U_reactive, test_5_U_burnt)

# a single deflagration wave
test_6_U_reactive = State(5.0, 0.0, 0.0, 2.0, eos_reactive)
test_6_U_burnt = State(0.10089486779791534, 0.97346270073482888, 0.0, 
                0.14866950243842186, eos)
test_6_rp = RiemannProblem(test_6_U_reactive, test_6_U_burnt)

In [9]:
for i in test_5_rp, test_6_rp:
    display(i)
    display_png(i)



In [ ]: