From acd138b5893d7dcdb1ad7cc199653ca5596a8f4c Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Fri, 10 Dec 2004 20:43:40 +0000 Subject: [PATCH] *** empty log message *** --- Cantera/python/Cantera/OneD/CounterFlame.py | 14 +++++++------- Cantera/python/Cantera/OneD/StagnationFlow.py | 12 ++++++------ Cantera/python/Cantera/__init__.py | 19 ------------------- 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/Cantera/python/Cantera/OneD/CounterFlame.py b/Cantera/python/Cantera/OneD/CounterFlame.py index 8acce2a8f..e22bc2292 100644 --- a/Cantera/python/Cantera/OneD/CounterFlame.py +++ b/Cantera/python/Cantera/OneD/CounterFlame.py @@ -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) diff --git a/Cantera/python/Cantera/OneD/StagnationFlow.py b/Cantera/python/Cantera/OneD/StagnationFlow.py index 55c0054dd..d422bcda0 100644 --- a/Cantera/python/Cantera/OneD/StagnationFlow.py +++ b/Cantera/python/Cantera/OneD/StagnationFlow.py @@ -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) diff --git a/Cantera/python/Cantera/__init__.py b/Cantera/python/Cantera/__init__.py index c62fca32b..4e3ca59d8 100755 --- a/Cantera/python/Cantera/__init__.py +++ b/Cantera/python/Cantera/__init__.py @@ -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