Topic: SUPG has broken time integration
I have been working on getting SUPG to properly use a primary field (dofdistributedprimaryfield).
I think it's vitally important that we are very clear on how time is discretized and what we are solving for.
After quite a lot of digging, I've convinced myself that the SUPG solver is trying to do
v = v_{n} * alpha + v_{n-1} * (1-alpha) (VM_Intermediate)
p = p_{n} (VM__Total)
a = (v_{n} - v_{n_1})/dt (VM_Velocity (velocity of velocities -> acc))
The iterations solve for a and dp. OK, straight forward, and, in my rewrite of the code, where I only store v_{n}, v_{n-1}, p_{n} (the other value modes are computed by the primary field, which now carries responsibility for time integration)
But entering the second time-step (of scctest01.in) I see that the SUPG doesn't save the v_{n} value, but the intermediate, v, which it now treats as the previous value. So, in sorts, you get an intermediate of intermediates. And well, frankly, It's almost impossible to follow the code paths in supg.C.
Based on the values, and side-by-side comparisons, I think the second iteration becomes
v = v_{n} * alpha + (v_{n-1} * alpha + v_{n-2} * (1-alpha)) * (1-alpha)
This doensn't just affect convergence, it affects the solution.
This all stems from not having a clear enough distinction between VM_Total and VM_Intermediate, which, consdering VM_Intermediate wasn't even available when SUPG was written, shouldn't be that surprising.
I have a working SUPG solver, which, as far as I can see, does a consistent (correct) time integration. It also simplifies the code significantly, and is what is needed to prepare for the changes to BC/IC/dof handling as we have discussed before.
It's also significantly simpler, with a 200-300 lines less code, with another 100 that can be removed after a few other things have been fixed.