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

SUPG stabilization

0 votes

In demo_advection-diffusion.py the velocity is constant along the time integration. In the problem I am trying to solve the stabilization parameter is tau = tau(h,velocity, timestep) where the velocity and timestep are themselves computed along the time. I would like to avoid creating a new variational form for each time step (I have zillions of them) but can not figure out how to do it .

Thanks in advance for any help.

Heitor

asked Sep 18, 2013 by hpina FEniCS Novice (140 points)

1 Answer

+3 votes

You do not need to recreate the variational form, provided you used a Function or Expression
to define your "velocity" and "dt".
In the advection-diffusion example, "velocity" is already a Function, so if you change it,
you can solve for a different velocity field, without recompiling the form.
To change dt, you could do something like:

dt = Expression("dtvalue", dtvalue=0.1)

instead of

dt = 0.1

Later on, when you want to change it, just do:

dt.dtvalue = 0.2

and it will be updated in the form.

You will need to put the assembly of A inside your loop, too.

answered Sep 18, 2013 by chris_richardson FEniCS Expert (31,740 points)
SUPG stabilization
...