Greetings FiPy list,

I am trying to make a 1D transient convection/diffusion problem, involving
flow towards a source at the center of a cylindrical domain.  I started
working with a linear  1D mesh, then converted to CylindricalMesh1D, and I
get errors related to the convection term.

I have reduced my problem to the following script, which runs fine when
using the Grid1D, but hangs up with CylindricalGrid1D with the error listed
after the script.  If I take out the convection term, the remaining
transient diffusion problem works fine with the cylindrical grid. Different
types of convection terms behave the same.

I am using numpy 1.6.1 on a recent Kubuntu system.  Any help or comments
regarding what I am doing wrong are appreciated.

Thanks,

Kris

----

from fipy import *
L = 10.0
nx = 100
dx = L/nx

#m = Grid1D(nx=nx, dx=dx)                            # works with this grid
m = CylindricalGrid1D(nx=nx, dx=dx, origin=(0.1,)) # fails with this grid

c0 = numerix.zeros(nx, 'd')
c0[40:60] = 1.0

cf = CellVariable(name="$c_f$", mesh=m, value=c0)
cf.constrain(0.0, m.facesLeft)
cf.faceGrad.constrain([0.0,], m.facesRight)

CeqF = (TransientTerm(1.0,var=cf) == DiffusionTerm(1.0,var=cf) -
        ExponentialConvectionTerm((-1.0,),var=cf))

Cviewer = Viewer(vars=(cf),datamax=1.0,datamin=-0.05)
Cviewer.plot()

timeStep = 3.0E-2
for j in range(300):
    CeqF.solve(dt=timeStep)
    Cviewer.plot()

------

$ python test-case2.py
Traceback (most recent call last):
  File "test-case2.py", line 28, in <module>
    CeqF.solve(dt=timeStep)
  File
"/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/term.py",
line 209, in solve
    solver = self._prepareLinearSystem(var, solver, boundaryConditions, dt)
  File
"/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/term.py",
line 171, in _prepareLinearSystem
    buildExplicitIfOther=self._buildExplcitIfOther)
  File
"/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/binaryTerm.py",
line 68, in _buildAndAddMatrices
    buildExplicitIfOther=buildExplicitIfOther)
  File
"/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/binaryTerm.py",
line 68, in _buildAndAddMatrices
    buildExplicitIfOther=buildExplicitIfOther)
  File
"/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/unaryTerm.py",
line 97, in _buildAndAddMatrices
    diffusionGeomCoeff=diffusionGeomCoeff)
  File
"/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/abstractConvectionTerm.py",
line 188, in _buildMatrix
    b += numerix.reshape(self.constraintB.value, ids.shape).sum(0).ravel()
AttributeError: 'NotImplementedType' object has no attribute 'sum'
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to