On Tue, Oct 12, 2010 at 1:27 PM, BIN ZHANG <zhn...@gmail.com> wrote:
>
> Dear Daniel:
>
> Thanks a lot for your reply. Greatly appreciated.
>
> The trick you used to transform the equation is quite clever ;-). I guess
> now my question is how to represent $\partial_i V$ in the convection term.

Try,

    >>> ConvectionTerm(V.getFaceGrad())

> Though you confirmed to me that it's possible to have a convection term with
> a variable coefficient, like $\partial_i V$, I'm still not clear how to do
> that in Fipy. From the documentation on Convectionterm, I found the
> following:
>
>            >>> cv = CellVariable(mesh = m)
>            >>> __ConvectionTerm(coeff = cv)
>            Traceback (most recent call last):
>                ...
>            TypeError: The coefficient must be a vector value.
>
> It looks to me that only, a scalar, or a constant vector is allowed in this
> term. Any suggestion?

The coeff for ConvectionTerm needs to be a vector. Try,

    >>> cv = CellVariable(mesh = m, rank=1)
    >>> __ConvectionTerm(coeff = cv)

"rank=1" makes the variable a vector value.

-- 
Daniel Wheeler


Reply via email to