Hello Fipy experts,

previously i sent in some test/validation cases for the linear burgers eqn, 
etc..  those cases were implicitly for fipy v. 1.2 (CURRENT tag).
attached are versions that will run under fipy 1.2 or 2.0 (trunk). there is 
also a new test case (requires v. 2.0) for the nonlinear burgers eqn (thanks 
much, Daniel).  results look good.

for the nonlinear case, i have tried to add a source term involving a gradient 
to the equation, but sweep throws an exception. the source term does not 
involve the dep var, so it is explicitly coded.  not sure whether this may be a 
feature which is not (re)implemented in trunk, or just a user error. (other 
forms of source terms work well, as expected. attempts to use getFaceGrad, 
etc., cause problems in the eqn definition itself, as might be expected).

thanks in advance for any suggestions.  (no urgency, as i'll be offline for a 
couple weeks).

regards,

dean

----------------------------------------------------------

#fipy convterm var u
#need fipy >=v2.0 for "rank" attrib
u = CellVariable(name="u", mesh=mesh, value=0.5*u0, hasOld=1, rank=1)
#depvar ux
ux = CellVariable(name="ux", mesh=mesh, value=0.5*u0, hasOld=1, rank=0)
#fake var to test source
sv = CellVariable(name="sv", mesh=mesh, value=0.01*u0, hasOld=1, rank=0)
#
# the src term is analogous to that in the stokes eqns (user manual [v1.2] 
chap. 12.1)
# intended to be a cell (rather than face) value, as per chap 6.6.
eqsrc = sv.getGrad().dot([1,])
#(note: above line throws a "...ValueError'>: invalid return array shape" at 
sweep).
eqn =  TransientTerm() + VanLeerConvectionTerm(coeff=c+0.5*b*u) - \
       ImplicitDiffusionTerm(coeff=mu) + eqsrc
..
       for sweep in range(sweeps):
          u[0] = ux
          resid = eqn.sweep(var = ux, dt = dt, 
                      solver = LinearLUSolver(),boundaryConditions=BC)



Attachment: vnlr.2.tar.gz
Description: GNU Zip compressed data

Reply via email to