Hello Jonathan, It turns out that my spatial discretization was too fine, so Python ran out of memory. After decreasing my spatial discretization and trying the PowerLawConvectionTerm that you suggested, I still get the "IndexError: id1 does not have the same size as b" error.
Best, Edwin On Thu, Mar 21, 2013 at 11:59 PM, Edwin Sze Lun Khoo <[email protected]>wrote: > Hello Jonathan, > > I tried both PowerLawConvectionTerm(coeff=([[-alpha]]/C**2, ), var=C) and > PowerLawConvectionTerm(coeff=([[-alpha]]/C.faceValue**2, ), var=C) and > Python froze without giving any error messages. I am not sure what happened. > > Best, > Edwin > > > On Mon, Mar 18, 2013 at 8:38 AM, Jonathan Guyer <[email protected]> wrote: > >> >> 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 >> [email protected] >> http://www.ctcms.nist.gov/fipy >> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] >> > >
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
