[Reactor] Handle constant temperature case in solveSteady

This commit is contained in:
Ray Speth
2025-06-25 18:54:40 -04:00
committed by Ray Speth
parent 64fd82f6ba
commit 11d5f02bcb
8 changed files with 55 additions and 4 deletions
+21
View File
@@ -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)