Hi all,

I have a complete installation of fipy that is working correctly but I'm
having trouble getting my model to work.

I'm modeling langmuir adsorption of a binary gas flowing through a 1D
space. There are four equations that need to be solved

1) gas concentration of component 1
\epsilon_t \frac{\partial y}{\partial t}+\epsilon \vec u \frac{\partial
y}{\partial z}+A \frac{\partial q_1}{\partial t}-A\left( \frac{\partial
q_1}{\partial t}+\frac{\partial q_2}{\partial t}\right)y = 0

2) gas velocity and total mass balance:
\epsilon \frac{\partial u}{\partial z} =-A\left(\frac{\partial
q_1}{\partial t}+\frac{\partial q_2}{\partial t} \right )

3) langmuir adsorption for both species:
q_1=\frac{D_1y}{1+B_1y+C_1\left(1-y \right )}
q_2=\frac{D_2(1-y)}{1+B_2y+C_2\left(1-y \right )}

The code that I'm trying to execute is available at the following link:
http://pastebin.com/CYJkxUd1

Just as a side note, the constants in the expressions above have different
values in the code.

When I try to run the code I get the following error trail:

Traceback (most recent call last):
  File "/home/douwe/adsorption model/build-up.py", line 126, in <module>
    equ.solve(var=u,dt=timeStep)
  File "/usr/local/lib/python2.7/dist-packages/fipy/terms/term.py", line
211, in solve
    solver = self._prepareLinearSystem(var, solver, boundaryConditions, dt)
  File "/usr/local/lib/python2.7/dist-packages/fipy/terms/term.py", line
170, in _prepareLinearSystem
    buildExplicitIfOther=self._buildExplcitIfOther)
  File "/usr/local/lib/python2.7/dist-packages/fipy/terms/binaryTerm.py",
line 68, in _buildAndAddMatrices
    buildExplicitIfOther=buildExplicitIfOther)
  File "/usr/local/lib/python2.7/dist-packages/fipy/terms/unaryTerm.py",
line 99, in _buildAndAddMatrices
    diffusionGeomCoeff=diffusionGeomCoeff)
  File
"/usr/local/lib/python2.7/dist-packages/fipy/terms/abstractConvectionTerm.py",
line 199, in _buildMatrix
    constraintMask = var.faceGrad.constraintMask |
var.arithmeticFaceValue.constraintMask
AttributeError: 'FaceVariable' object has no attribute 'faceGrad'

I think the problem lies with the expression for du/dz, but I'm not sure
how to fix it after trying several approaches. The problem may also be the
linking of the transient terms for q1 and q2 between the expressions.
Should I use a transientTerm for those or should I use a discrete
difference using q1 and q1.old?

I appreciate any input you have.

Kind regards,

Douwe
_______________________________________________
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