← Back to team overview

dolfin team mailing list archive

Re: Strangeness in advection-diffusion demo

 

There does seem to be a typo in the variational problem.  The 'Fenics
Tutorial' by H. P. Langtangen loses a factor of \delta t between equations
66 and 68, (though reappears by eqn 71).   The \delta t also seems to be
missing in the demo.  I tried to derive the expressions for the demo again
and get such forms:

# Variational problem
a = v*u*dx + 0.5*k*(v*dot(velocity, grad(u))*dx + 0.5*k*c*dot(grad(v),
grad(u))*dx)
L = v*u0*dx - 0.5*k*(v*dot(velocity, grad(u0))*dx - 0.5*k*c*dot(grad(v),
grad(u0))*dx) + k*v*f*dx

I think the signs on the diffusion term and the force field term should be
the same here.  Typically they are opposite (when on the same side of the
diffusion equation) but the separation by parts procedure brings in a minus
sign.  However, running the demo with such form gives negative
probabilities, which is raising doubts in my calculation.  In my experience
with diffusion problems that problem goes away with a finer resolution grid
and the 'steady state' seems to be at least trying to go flat so it may
still be reasonable.  What exactly was the typo you were seeing?
Thanks,
   Nathan Borggren




On Tue, May 11, 2010 at 9:48 AM, Anders Logg <logg@xxxxxxxxx> wrote:

> The advection-diffusion demo (both C++ and Python versions) says in
> the comment that a stabilized method is used, but the stabilization
> seems to be missing.
>
> I think I remember this being added at some point, by either Hake or
> Garth. Any clue where this went?
>
> There also seems to be a typo for the diffusive term which appears in
> both LHS and RHS.
>
> --
> Anders
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkvpYBQACgkQTuwUCDsYZdEIMwCfcY8o1l6Q0HJQIsYH7fvmRJ/2
> FnAAn1IoVooWjJV3ACFfdGSknmmxB/oz
> =upPs
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin<https://launchpad.net/%7Edolfin>
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin<https://launchpad.net/%7Edolfin>
> More help   : https://help.launchpad.net/ListHelp
>
>

References