Hi Nils,

Could you possible post your code so I can play around with it? I
can't think offhand what could be the issue or exactly what the error
is that you're calculating, it seems like the normalized residual or
something. This is a linear equation so I'm not entirely sure why the
non-linear residual wouldn't be very close to zero if the linear
solver is converging. Probably best just to see the code rather than
speculate.

Cheers,

Daniel

On Mon, Aug 1, 2016 at 7:50 AM, Nils Becker
<nils.bec...@bioquant.uni-heidelberg.de> wrote:
> hi,
>
> i scanned the list and the documentation but have not been able to make
> this work properly yet:
>
> i have a 2D pde of the form
>
> \[
>
> \partial_t \rho =  \nabla \cdot (\rho \nabla \phi) + D \nabla^2 \rho +
> \lambda \rho
>
> \]
>
> where phi is a potential field and lambda is a source field, both are
> constant in time and smoothly varying in space.
>
> i have been solving this with fipy, using
>
> DiffusionTermCorrection(coeff=[D,]) for the diffusion
> PowerLawConvectionTerm(coeff=v ) where v = -phi.grad for the advection
> ImplicitSourceTerm(coeff=lambda) for the source
>
> the boundary conditions are either no-flux or dirichlet. i think
> advection is dominant, although i can't say i have actually tried to
> quantify that.
>
> i am testing the solution by subtracting the rhs and lhs of the equation
> and comparing that to \partial_t \rho in magnitude. i am having trouble
> making this error smaller than around 10%: at points where the density
> grows strongly, the solution deviates.
>
> at the moment i am using a loop like this:
>
>     for (st, stnext) in zip(Solve.sample_t, Solve.sample_t[1:]):
>         for tt in nx.arange(st, stnext, Solve.step):
>             rho.updateOld()
>             res = 1.
>             while res > Solve.tolerance:
>                 res = eq.sweep(var=rho, dt=Solve.step)
>
> i've played around with making the mesh smaller -- did not seem to make
> any difference; reducing the tolerance -- some effect, and reducing the
> temporal step size, which did not help much.
>
> should i be doing something differently?
>
> thanks for any help!
>
> n.
> _______________________________________________
> fipy mailing list
> fipy@nist.gov
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]



-- 
Daniel Wheeler
_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to