dbirch997 / cantera

Automatically exported from code.google.com/p/cantera
1 stars 0 forks source link

No attribute 'mdot' at FlowReactor class for Python #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create one reactor of type 'FlowReactor'.
2. Set its mass flow rate using 'setMassFlowRate' function or attribute 'mdot' 
of the own 'FlowReactor' class. 

What is the expected output? What do you see instead?
The expected output is a reactor object of type 'FlowReactor' and with a 
specific mass flow rate. Instead python console returns a error message: 

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...cantera/python/lib/python2.7/site-packages/Cantera/Reactor.py", line 435, in setMassFlowRate
    _cantera.flowReactor_setMassFlowRate(self.__reactor_id, mdot)
AttributeError: FlowReactor instance has no attribute '_FlowReactor__reactor_id'

What version of the product are you using? On what operating system?
Cantera 2.1a1. Linux 64-bit with Python 2.7.2.

Please provide any additional information below.
Piece of code in python:

>>> from Cantera import *
>>> from Cantera.Reactor import *
>>> gas = GRI30
>>> r = FlowReactor(contents=gas, mdot=1.0) ##ERROR!
>>> r = FlowReactor(contents=gas)
>>> r.setMassFlowRate(1.0) ##ERROR!

Original issue reported on code.google.com by rodolfo.enq on 2 Aug 2012 at 3:16

GoogleCodeExporter commented 9 years ago
Fixed in r1741.

Original comment by yarmond on 2 Aug 2012 at 4:13

GoogleCodeExporter commented 9 years ago
Hello Cantera team,

I replaced modified Reactor.py (code after r1741) but I observed mentioned 
error. 
I am using Cantera-1.8.0.win32-py2.6 version. Is there any compatibility 
problem?

Thanks, Tuks

Original comment by tuks...@gmail.com on 22 Aug 2012 at 5:32

GoogleCodeExporter commented 9 years ago
Tuks: I would recommend upgrading to Cantera 2.0 and applying the r1741 patch 
to that version.

Original comment by yarmond on 23 Aug 2012 at 2:30