2009/9/24 Kun-Dar Li <[email protected]>:
> Hello,
>
> I'm testing a simple case only with convection term, no diffusion term, no
> source term. I used exponential, hybrid and Upwind  schemes to describe the
> convection term. But, these all failed to solve this case. It seems only
> VanLeer scheme provides a more reliable result.

Not really surprising. VanLeer is higher order under most
circumstances. In general one should use higher order advection terms
whenever possible, We haven't got round to focusing on these in fipy,
mainly because it has not been critical for our work, but fipy should
really have more choice in this regard,

> I just want to know more
> details in VanLeer scheme which is not included in the FiPy User's Guide.

 Van Leer is a QUICK scheme (second order accurate) under most
circumstances, but reverts to first order to preserve sharp
boundaries. I am not sure how well it works on irregular grids, but
should be fine on a regular grid. The code should give you some
answers, see

Line 
<http://matforge.org/fipy/browser/trunk/fipy/terms/vanLeerConvectionTerm.py#L48>
is where the gradients are calculated and line
<http://matforge.org/fipy/browser/trunk/fipy/terms/vanLeerConvectionTerm.py#L52>
is the bit that does the flux limiting.

Do you need to preserve a sharp interface or are you more interested
in a higher order scheme? The Van Leer term can be modified to not
have the limiting properties and just be a plain old QUICK scheme if
you prefer.

> Another question is: can I describe the convection term as
> convTerm=(convCoeff*var.getArithmeticFaceValue()).getDivergence()
> convCoeff is a vector. What's the difference if I define the convection term
> by myself without using the (default) scheme.

You can certainly do that, but your scheme will be explicit and the
getDivergence operator doesn't know about boundary conditions. You can
of course include boundary conditions by modifying the term
appropriately.

See, "How do I represent a convective source?" in the FAQ in the manual.

Cheers

-- 
Daniel Wheeler

Reply via email to