hello fipy experts, i'm trying to deal with a nonlinear 1d convection term, but assume i am doing something wrong in term description & eqn setup (rather than in particulars of <>ConvectionTerm, etc.,?). here, physicalField.py raises a ValueError exception at the start of the sweep call.
from the example cases, however, i'm not sure whether this type of term is possible in fipy. (thanks in advance Daniel, but i must not be grasping some feature of your example compared to this case - i think it is exactly this case?!). (note: i am using a recent svn version, not the official release). the attached file has the full fipy script (and traceback msg) for a toy problem(!), here is the gist: u = CellVariable(name="u", mesh=m, value=0, hasOld=1) speed = 1.0 linear = False if linear: coeff = (speed,) print '...this will run thru the sweeps' else: coeff = (u,) print '...this will fail, expect: "array dimensions are not compatible for copy"' .. convection = PowerLawConvectionTerm(coeff=coeff,diffusionTerm=diffusion) eqn = transient + convection - diffusion .. resid = eqn.sweep(var = u, dt = dt, boundaryConditions=BC, solver = LinearLUSolver()) #traceback starts from sweep call. can anyone point out the error(s) in my ways? thanks much in advance, dean
trynonl.py.gz
Description: GNU Zip compressed data
