Skip to content

Commit

Permalink
Remove unnecessary FlowReactor constructor arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
speth authored and ischoegl committed Jun 14, 2023
1 parent 824b627 commit 8fd6ba6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 24 deletions.
21 changes: 0 additions & 21 deletions interfaces/cython/cantera/reactor.pyx
Expand Up @@ -445,27 +445,6 @@ cdef class FlowReactor(Reactor):
"""
reactor_type = "FlowReactor"

def __init__(self, *args, **kwargs):
area = kwargs.pop('area', None)
sa_to_vol = kwargs.pop('surface_area_to_volume_ratio', None)
ss_atol = kwargs.pop('steady_state_atol', None)
ss_rtol = kwargs.pop('steady_state_rtol', None)
ss_max_steps = kwargs.pop('steady_state_max_steps', None)
ss_max_fail = kwargs.pop('steady_state_max_error_failures', None)
super(FlowReactor, self).__init__(*args, **kwargs)
if area is not None:
self.area = area
if sa_to_vol is not None:
self.surface_area_to_volume_ratio = sa_to_vol
if ss_atol is not None:
self.steady_state_atol = ss_atol
if ss_rtol is not None:
self.steady_state_rtol = ss_rtol
if ss_max_steps is not None:
self.steady_state_max_steps = ss_max_steps
if ss_max_fail is not None:
self.steady_state_max_error_failures = ss_max_fail

property mass_flow_rate:
""" Mass flow rate [kg/s] """
def __set__(self, double value):
Expand Down
3 changes: 2 additions & 1 deletion samples/python/reactors/surf_pfr.py
Expand Up @@ -47,7 +47,8 @@ class and the SUNDIALS IDA solver, in contrast to the approximation as a chain o
mass_flow_rate = velocity * gas.density * area * porosity

# create a new reactor
r = ct.FlowReactor(gas, energy='off', area=area)
r = ct.FlowReactor(gas)
r.area = area
r.surface_area_to_volume_ratio = cat_area_per_vol * porosity
r.mass_flow_rate = mass_flow_rate
r.energy_enabled = False
Expand Down
3 changes: 2 additions & 1 deletion samples/python/surface_chemistry/1D_pfr_surfchem.py
Expand Up @@ -37,7 +37,8 @@
Ac = np.pi * D**2 / 4 # cross section of the tube [m]
u0 = 11.53 # m/s initial velocity of the flow

reactor = ct.FlowReactor(gas, area=Ac)
reactor = ct.FlowReactor(gas)
reactor.area = Ac
reactor.mass_flow_rate = gas.density * u0 * Ac
reactor.energy_enabled = False

Expand Down
2 changes: 1 addition & 1 deletion test/python/test_reactor.py
Expand Up @@ -1447,7 +1447,7 @@ def test_catalytic_surface(self):
gas.TPX = T0, P0, X0
surf.TP = T0, P0

r = ct.FlowReactor(gas, energy='off')
r = ct.FlowReactor(gas)
r.area = 1e-4
porosity = 0.3
velocity = 0.4 / 60
Expand Down

0 comments on commit 8fd6ba6

Please sign in to comment.