30.2 The exact algebra evaluated by the code

Let

Symbol

Implementation quantity

s

scale, set by SetScale

ν

kinvis, set by SetKinvis

R

rhs, the extrapolated explicit contribution passed to Update

V

velocity, the extrapolated velocity quantity used by the curl–curl operator

P

predictor, the complete implicit-stage right-hand side

uD(t)

discrete Dirichlet velocity: the boundary expressions at the target time, set by SetTime, projected onto the boundary expansion of the velocity, as the velocity solve imposes them

C(V )

∇  × (∇  × V )

Update evaluates

g = sn ⋅[R - νC (V )],
(30.4)

where g = ∂p∕∂n.

UpdateWithAcceleration, which VelocityCorrectionScheme calls, adds the acceleration to the flux of Update:

Fbase = s[R  - νC (V )], (30.5)
Facc = s[P  - R ]. (30.6)

Their explicit contributions cancel exactly, so it takes the predictor P and not R. It then subtracts the discrete Dirichlet velocity, producing

|------------------------------|
-g-=-sn-⋅[P---uD-(t)--νC-(V-)].|
(30.7)

The velocity solve imposes the Dirichlet data of a region as its projection uD onto the boundary expansion of the velocity, not the expression ueDxact itself, so the velocity history from which P is formed holds uD on the boundary. The part of s(P - uD ) that P takes from that history is then a backward difference of uD, the discrete - ∂u  ∕∂t
     D, which vanishes at a steady state. Subtracting uexact
  D instead would leave             exact
s n ⋅(uD  - uD   ) in the flux: the projection error divided by the implicit step size, which grows as Δt decreases wherever the data is not representable on the boundary expansion.

A velocity component d that is not Dirichlet on a region, such as a Neumann component of a slip wall or of an inflow, has no prescribed boundary velocity and takes no acceleration there: its term in the flux is s nd[Rd - νCd(V )]. On such a region the operator takes uD,d = 0 and subtracts s nd[Pd - Rd] from (30.7), so UpdateWithAcceleration also reads R. VelocityCorrectionScheme keeps the history of the explicit forcing from which R is extrapolated only on a rank holding such a region, as HasNonDirichletVelocity reports.

UpdateWeak evaluates the flux of the weak pressure form (PressureFormulation=Weak, Section 29.2.3), which takes the predictor, the explicit advection and the forcing into its volume term (∇ϕ,sP ). Its flux is that of UpdateWithAcceleration less s n ⋅P:

gweak = - sn ⋅[uD (t)+ νC (V )],
(30.8)

the boundary acceleration and the viscous term alone. On a velocity component d that is not Dirichlet the boundary velocity is Pd - Rd, the velocity the predictor carries, as in UpdateWithAcceleration, so its term is - snd [Pd - Rd + νCd (V )], and UpdateWeak reads R and P only on a rank holding such a region. The predictor is not gathered into the restricted volume flux, which the combine kernel sets to - sνC (V ) alone, and the remaining steps are those of UpdateWithAcceleration.

In the current solver call,

s = --1-,
    γ Δt
(30.9)

with γΔt the implicit step size of the stage. The predictor contains time-integrator-scaled explicit terms. VelocityCorrectionScheme keeps histories of the velocity and of the explicit forcing, and combines them into V and R with the coefficients ck of the explicit contributions of the stage, scaled to sum to γΔt:

      γΔt  ∑                   γΔt  ∑
V  = ∑-----   cku (k),    R =  ∑-----   ckr(k).
       k ck  k                   kck  k
(30.10)

For a multistep IMEX scheme the ck are γ times the extrapolation weights and sum to γ, so the scaling is Δt. For a later stage of an IMEXdirk scheme, such as the startup of a multistep scheme, they are quadrature weights whose sum is not γ; without the scaling, sV would not reduce to the velocity, and even a steady solution would get a wrong flux. Accordingly, s(P - uD ) supplies the discrete negative acceleration in (30.3), while - sνC (V ) supplies the consistently extrapolated rotational viscous term. Keeping (30.7) in terms of the actual stage quantities is important: P, R, and V are not all unscaled instantaneous physical fields.