hkmoffat / cantera

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

Reactor Wall Heat Input - Cantera 2.0 Error #145

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm attempting to run a reactor model with polynomial heat input.  The 
following script works with Cantera 1.8 but not Cantera 2.0.  

Code:

#####

import Cantera
from Cantera import *
from Cantera.Func import *
from Cantera.Reactor import *

gas = Air()
env = Air()

gas.set(P = OneAtm, T = 300.0)
env.set(P = OneAtm, T = 300.0)

print 'Inlet T  [K]', gas.temperature()

res_env = Reservoir(env)
res_out = Reservoir(gas)

Reac = Reactor(gas, volume = 1.0, energy = 'on')

f_Q_Reac = Polynomial([1.0e3, 0.0, 0.0, 0.0])

w_pfr = Wall(left = res_env, right = Reac, Q = f_Q_Reac, A = 1.0, K = 1.0)

sim = ReactorNet([Reac])

time = 100

sim.advance(time)

print 'Outlet T [K]', gas.temperature()

#####

What steps will reproduce the problem?
1. Running the Python script using Cantera 2.0/Python 2.7.3

What is the expected output? What do you see instead?

I expect the output to show a higher gas object temperature due to heat input 
through the reactor wall. (As is the case using Cantera 1.8/Python 2.6.6)

Instead I get the following error:

*****

Traceback (most recent call last):
  File "W:\heat_input.py", line 21, in <module>
    w_pfr = Wall(left = res_env, right = Reac, Q = f_Q_Reac, A = 1.0, K = 1.0)
  File "C:\Python27\lib\site-packages\Cantera\Reactor.py", line 917, in __init__
    self.setHeatFlux(Q)
  File "C:\Python27\lib\site-packages\Cantera\Reactor.py", line 975, in setHeatFlux
    n = self.qfunc.func_id()
AttributeError: Wall instance has no attribute 'qfunc'
>>> 

*****

What version of the product are you using? On what operating system?
Working version: Cantera 1.8/Python 2.6.6 - Win XP, 32-bit
Failing version: Cantera 2.0/Python 2.7.3 - Windows 7, 64-bit

Has the input function for heat flux through a reactor wall changed in version 
2.0?

Original issue reported on code.google.com by casey.fu...@gmail.com on 19 Feb 2013 at 9:58

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 19 Feb 2013 at 10:09

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2172.

Original comment by yarmond on 4 Mar 2013 at 5:30

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2189.

Original comment by yarmond on 5 Mar 2013 at 5:04