Thanks to the help of this wonderful group, my project has reached its critical stage where I'm to solve a coupled equation of the following structure (equation attached):
[1] TransientTerm(phi) = advection-diffusion of (phi) with advection coefficient (constant / psi) pointing towards the origin [2] TransientTerm(psi) = phi + constant * phi * psi So far, I've encountered 2 major problems and hopefully it's okay if I list both here (script attached). 1. In Equation [1], when I set the coefficient of the ConvectionTerm to a function of psi, it returns *TypeError*: unsupported operand type(s) for *: 'binOp' and 'unOp' I gather this may due to me multiplying a FaceVariable to a CellVariable as a consequence of me using a position-dependent convection term. However, when I tested what happens if I remove the space-dependence, I get *VectorCoeffError*: The coefficient must be a vector value. Of course, when I take out the dependence on psi altogether, everything's fine. Very confused.. 2. In Equation [2], what is the proper way to assign the variables? I could have eq2 = (TransientTerm(var=psi) == ImplicitSourceTerm(var=phi) + > ImplicitSourceTerm(coeff=c**phi*, var=*psi*) or, equally, eq2 = (TransientTerm(var=psi) == ImplicitSourceTerm(var=phi) + > ImplicitSourceTerm(coeff=c**psi*, var=*phi*) Does it even make any difference? Can't say it enough, but thank you again for all your kind and generous help. Cheers, Yun -- Graduate Group of Ecology Doctoral Candidate Department of Environmental Science and Policy Center for Population Biology University of California, Davis
<<attachment: Screen shot 2012-07-02 at 2.58.50 AM.png>>
ccc.py
Description: Binary data
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
