*** empty log message ***
This commit is contained in:
parent
f5837c0031
commit
acd138b589
3 changed files with 13 additions and 32 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"""A counterflow flame."""
|
||||
|
||||
from onedim import *
|
||||
from Cantera.num import zeros
|
||||
from Cantera.num import zeros
|
||||
import math
|
||||
|
||||
def erfc(x):
|
||||
|
|
@ -87,9 +87,9 @@ class CounterFlame(Stack):
|
|||
phi = s*y0f/y0ox
|
||||
zst = 1.0/(1.0 + phi)
|
||||
|
||||
yin_f = Numeric.zeros(nsp, 'd')
|
||||
yin_o = Numeric.zeros(nsp, 'd')
|
||||
yst = Numeric.zeros(nsp, 'd')
|
||||
yin_f = zeros(nsp, 'd')
|
||||
yin_o = zeros(nsp, 'd')
|
||||
yst = zeros(nsp, 'd')
|
||||
for k in range(nsp):
|
||||
yin_f[k] = self.fuel_inlet.massFraction(k)
|
||||
yin_o[k] = self.oxidizer_inlet.massFraction(k)
|
||||
|
|
@ -123,8 +123,8 @@ class CounterFlame(Stack):
|
|||
x0 = mdotf*dz/(mdotf + mdoto)
|
||||
nz = len(zz)
|
||||
|
||||
y = Numeric.zeros([nz,nsp],'d')
|
||||
t = Numeric.zeros(nz,'d')
|
||||
y = zeros([nz,nsp],'d')
|
||||
t = zeros(nz,'d')
|
||||
for j in range(nz):
|
||||
x = zz[j]
|
||||
zeta = f*(x - x0)
|
||||
|
|
@ -229,7 +229,7 @@ class CounterFlame(Stack):
|
|||
"""Set the state of the object representing the gas to the
|
||||
current solution at grid point j."""
|
||||
nsp = self.gas.nSpecies()
|
||||
y = Numeric.zeros(nsp, 'd')
|
||||
y = zeros(nsp, 'd')
|
||||
for n in range(nsp):
|
||||
nm = self.gas.speciesName(n)
|
||||
y[n] = self.solution(nm, j)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class StagnationFlow(Stack):
|
|||
self.getInitialSoln()
|
||||
gas = self.gas
|
||||
nsp = gas.nSpecies()
|
||||
yin = Numeric.zeros(nsp, 'd')
|
||||
yin = zeros(nsp, 'd')
|
||||
for k in range(nsp):
|
||||
yin[k] = self.inlet.massFraction(k)
|
||||
gas.setState_TPY(self.inlet.temperature(), self.pressure, yin)
|
||||
|
|
@ -55,17 +55,17 @@ class StagnationFlow(Stack):
|
|||
gas.equilibrate('HP')
|
||||
teq = gas.temperature()
|
||||
yeq = gas.massFractions()
|
||||
locs = Numeric.array([0.0, 0.3, 0.7, 1.0],'d')
|
||||
locs = array([0.0, 0.3, 0.7, 1.0],'d')
|
||||
self.setProfile('T', locs, [t0, teq, teq, tsurf])
|
||||
for n in range(nsp):
|
||||
self.setProfile(gas.speciesName(n), locs, [yin[n], yeq[n], yeq[n], yeq[n]])
|
||||
else:
|
||||
locs = Numeric.array([0.0, 1.0],'d')
|
||||
locs = array([0.0, 1.0],'d')
|
||||
self.setProfile('T', locs, [t0, tsurf])
|
||||
for n in range(nsp):
|
||||
self.setProfile(gas.speciesName(n), locs, [yin[n], yin[n]])
|
||||
|
||||
locs = Numeric.array([0.0, 1.0],'d')
|
||||
locs = array([0.0, 1.0],'d')
|
||||
self.setProfile('u', locs, [u0, 0.0])
|
||||
self.setProfile('V', locs, [V0, V0])
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ class StagnationFlow(Stack):
|
|||
def coverages(self):
|
||||
"""The coverages of the surface species."""
|
||||
nsurf = self.surfchem.nSpecies()
|
||||
cov = Numeric.zeros(nsurf,'d')
|
||||
cov = zeros(nsurf,'d')
|
||||
for n in range(nsurf):
|
||||
nm = self.surfchem.speciesName(n)
|
||||
cov[n] = self.value(self.surface, nm, 0)
|
||||
|
|
@ -159,7 +159,7 @@ class StagnationFlow(Stack):
|
|||
"""Set the state of the object representing the gas to the
|
||||
current solution at grid point j."""
|
||||
nsp = self.gas.nSpecies()
|
||||
y = Numeric.zeros(nsp, 'd')
|
||||
y = zeros(nsp, 'd')
|
||||
for n in range(nsp):
|
||||
nm = self.gas.speciesName(n)
|
||||
y[n] = self.solution(nm, j)
|
||||
|
|
|
|||
|
|
@ -11,25 +11,6 @@ from gases import *
|
|||
from set import set
|
||||
from importFromFile import *
|
||||
|
||||
try:
|
||||
from Numeric import array, asarray, zeros, ones
|
||||
except:
|
||||
print """
|
||||
|
||||
ERROR: NumPy not found!
|
||||
|
||||
Cantera uses the NumPy set of numerical extensions to
|
||||
Python. These do not appear to be present on your system, or else
|
||||
the 'Numeric' package is not on your Python path. You can get
|
||||
NumPy from http://sourceforge.net/projects/numpy, or see
|
||||
http://www.python.org/topics/scicomp/numpy.html for more
|
||||
information. If you are working on a Windows PC, an installer
|
||||
program is available from the sourceforge site that will install
|
||||
NumPy for you. The whole process takes less than a minute.
|
||||
|
||||
"""
|
||||
raise "could not import Numeric"
|
||||
|
||||
ctdata = ''
|
||||
try:
|
||||
import cantera_loc
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue