From 8f4ab714ac6e756e280e6e6f34c8a16f42f62ebc Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 25 Jul 2014 18:32:34 +0000 Subject: [PATCH] [Samples] Modify surf_pfr to keep pressure constant The structure of this calculation previously led to an apparent increase in pressure along the length of the reactor. This is a good example of when to use a PressureController. --- .../cython/cantera/examples/reactors/surf_pfr.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interfaces/cython/cantera/examples/reactors/surf_pfr.py b/interfaces/cython/cantera/examples/reactors/surf_pfr.py index 53cfab3c2..6fc816446 100644 --- a/interfaces/cython/cantera/examples/reactors/surf_pfr.py +++ b/interfaces/cython/cantera/examples/reactors/surf_pfr.py @@ -94,15 +94,15 @@ for n in range(NReactors): # are included only on the side facing the reactor. w = ct.Wall(upstream, r, A=cat_area, kinetics=[None, surf]) - # We need a valve between the reactor and the downstream reservoir. This - # will determine the pressure in the reactor. Set K large enough that the - # pressure difference is very small. - v = ct.Valve(r, downstream, K=1e-4) - # The mass flow rate into the reactor will be fixed by using a # MassFlowController object. m = ct.MassFlowController(upstream, r, mdot=mass_flow_rate) + # We need an outlet to the downstream reservoir. This will determine the + # pressure in the reactor. The value of K will only affect the transient + # pressure difference. + v = ct.PressureController(r, downstream, master=m, K=1e-5) + sim = ct.ReactorNet([r]) sim.max_err_test_fails = 12