This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to implement galerkin least squares?

+1 vote

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.

asked Nov 2, 2016 by Michaela FEniCS Novice (220 points)
edited Nov 4, 2016 by Michaela

Just apply the G-LS stabilization to the problem semidscretized in time.

Then treat $\frac{1}{\Delta t}u^{n-1}$ as a forcing term.

How does this help with the term $\frac{\partial v}{\partial t}$ that is a part of the stabilization?

...