On Mar 15, 2013, at 5:08 PM, Edwin Sze Lun Khoo wrote: > The term I tried was PowerLawConvectionTerm(coeff=(-alpha/C**2, ), var=C) but > I got an error that said "IndexError: id1 does not have the same size as b". > The rest of the error log can be found at http://pastebin.com/K4hy0GCh.
The coefficient of a convection term must be rank-1 (a vector). A tuple of rank-0 Variables is not the same thing as a rank-1 Variable. Since C is, by definition, scalar, alpha must be a vector, so you should be able to write: PowerLawConvectionTerm(coeff=([[-alpha]]/C**2, ), var=C) or, better yet, PowerLawConvectionTerm(coeff=([[-alpha]]/C.faceValue**2, ), var=C) > I also tried declaring the term explicitly, but the solver could not converge > after when sharp gradients in C appeared. I don't find that altogether surprising. If you go the explicit route, you may need to reduce your timesteps. _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]