mirror of
https://github.com/Cantera/cantera.git
synced 2026-08-08 20:18:24 -05:00
[Reactor] Handle constant temperature case in solveSteady
This commit is contained in:
@@ -3165,3 +3165,24 @@ class TestSteadySolver:
|
||||
|
||||
assert r.mass == approx(m0)
|
||||
assert r.thermo.T == approx(2407.35011)
|
||||
|
||||
@pytest.mark.parametrize("reactor_class",
|
||||
[ct.IdealGasReactor, ct.IdealGasMoleReactor])
|
||||
def test_energy_disabled(self, reactor_class):
|
||||
gas = ct.Solution("h2o2.yaml", transport_model=None)
|
||||
gas.set_equivalence_ratio(1.2, "H2:1.0", "O2:1.0, N2:3.76")
|
||||
T0 = 1700
|
||||
gas.TP = T0, 5 * ct.one_atm
|
||||
|
||||
upstream = ct.Reservoir(gas)
|
||||
gas.equilibrate("TP")
|
||||
downstream = ct.Reservoir(gas)
|
||||
V0 = 1e-3
|
||||
r = reactor_class(gas, volume=V0)
|
||||
r.energy_enabled = False
|
||||
inlet = ct.MassFlowController(upstream, r, mdot=120)
|
||||
ct.PressureController(r, downstream, primary=inlet)
|
||||
net = ct.ReactorNet([r])
|
||||
net.solve_steady()
|
||||
assert r.thermo.T == approx(T0)
|
||||
assert r.thermo["H2O"].Y[0] == approx(0.2161327927)
|
||||
|
||||
Reference in New Issue
Block a user