Hi.
I am looking at the advection-diffusion-reaction equation given by
$\frac{\partial u}{\partial t} + \nabla \cdot (Au) - \nabla\cdot(D\nabla u) +ku = s$
and I am trying to implement the Galerkin least squares method.
I get the following variational formulation (where backward Euler is used)
$(\frac{u^{n}-u^{n-1}}{\delta t},v) + (\nabla \cdot (A u^n),v)+(D\nabla u^n, \nabla v) + (ku^n,v) + r(u,v) = (s,v)$
where $r(u,v)$ is the stabilization term from the method given by
$r(u,v) = \tau(\frac{u^{n}-u^{n-1}}{\Delta t} +\nabla \cdot (A u^n) + D\nabla u^n + ku^n - s,\frac{v^n-v^{n-1}}{\Delta t}+\nabla(Av^n)$
$ - \nabla\cdot(D\nabla v)+kv)$
and tau is the stability coefficient.
My question is how can I implement the stabilization term in fenics?
The biggest problem is with the test functions $v^n$ and $v^{n-1}$.
I hope you can help me.