On Apr 21, 2006, at 1:42 PM, Daniel Wheeler wrote:

2) Thanks for this example. It has highlighted two separate problems. Firstly, the ConvectionTerm is assuming that the DiffusionTerm is on the same side
of the equation and that the diffusion term is being added to the right hand side. The following fixes the problem, though it is somewhat ugly, by changing

    >>> eq = diffTerm + PowerLawConvectionTerm(coeff = convCoeff, diffusionTerm = diffTerm)

to:

    >>> from fipy.terms.transientTerm import TransientTerm
    >>> eq = TransientTerm(1e-100) == diffTerm + PowerLawConvectionTerm(coeff = convCoeff, diffusionTerm = diffTerm)

I had to add the TransientTerm(1e-100) because:

    >>> eq = 0 == diffTerm + PowerLawConvectionTerm(coeff = convCoeff, diffusionTerm = diffTerm)

doesn't currently work. I have to fix the Peclet number calculation so it is independent of LHS or RHS, but can't see a clean way just yet.
We are hoping to remove the need to pass the DiffusionTerm to the ConvectionTerm, so at that point we will try and get the problem ironed out.

The above is complete nonsense. FiPy works fine no matter how the terms are combined. I was running the wrong example. Sorry for the confusion.

The only correction that needs to be made is the following (from the original file that you sent). The solve method needs to be changed from:

    >>> eq.solve(var = var,boundaryConditions = boundaryConditions)

to:

    >>> from fipy.solvers.linearLUSolver import LinearLUSolver
    >>> eq.solve(var = var,boundaryConditions = boundaryConditions, solver = LinearLUSolver())

The problem is with LinearCGSSolver. Not sure why it isn't working.

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

Daniel Wheeler

Telephone: (301) 975-8358


Reply via email to