29.2 Governing equations and time discretisation

The solver integrates

∂u-                   2
 ∂t = N (u )- ∇p + ν∇  u,     ∇ ⋅u = 0,    N (u ) = - (u ⋅∇)u + f,
(29.1)

with kinematic viscosity ν (Kinvis) and body forcing f from the session FORCING block. Only the convective form of the advection term is implemented. With SPECTRALHPDEALIASING (on by default) it is evaluated with the 3/2-rule AdvectionDealiasOp, otherwise with AdvectionOp.

29.2.1 IMEX scheme and the implicit-stage size

The IMEX scheme of order J (METHOD=IMEX, ORDER=J) is the stiffly stable scheme of [44]. The implementation divides it by the coefficient γ0 of un+1, and the implicit callback receives

     J∑-1αq           J∑-1βq                  Δt
u^=     ---un-q + Δt    ---N n-q,    λΔt =  --,
     q=0 γ0           q=0 γ0                  γ0
(29.2)

where λ = 1∕γ0 is m_gamma in IMEXOpImpl. The fourth argument of SolveUnsteadyStokesSystem, dt_inv_gamma, is the implicit-stage size λΔt. The explicit callback stores ΔtN: the advection operator is applied with scale -Δt and the forcing with scale Δt.


order J 1 2 3 4
λ = 1∕γ0 1 2∕3 6∕11 12∕25
weights cq = βq∕γ0 [1] [4, -2]∕3 [18,-18,6]∕11 [48,-72,48,-12]∕25
start-up scheme none IMEXdirk 2_3_2 IMEXdirk 3_4_3 IMEXdirk 3_4_3

Table 29.1 IMEX coefficients (GetIMEXCoefficients in IMEXKernelLaunchers.hpp) and start-up schemes. In every multistep step ∑ qcq = λ.

Start-up. A multistep scheme of order J > 1 has no history at the first step. While fewer than J steps have been taken, IMEXOpImpl::v_Apply advances one step with an IMEXdirk scheme of order min(3,J) (Table 29.1), to which it copies its callbacks. For J = 2 this is IMEXdirk 2_3_2 with two implicit stages, both of size λsΔt with λs = 1 -1∕√2- ≈0.2929. The history is not written to checkpoints, so the start-up step is repeated after every restart (Section 29.5).

Explicit-contribution extrapolation. The VCS needs extrapolations of quantities other than the solution, combined with the same weights as the explicit term of the active step or stage. IMEX and IMEXdirk derive from IMEXBaseOp, with which the solver registers callbacks that take an ExplicitWeights as their last argument when it needs these extrapolations. The time operator fills it in: the history id of the scheme and the number of explicit contributions its implicit solves combine in both callbacks, and, in an implicit solve, the active weights ci: the first J IMEX coefficients in a multistep step, or the explicit stage coefficients of the current DIRK stage. The solver keeps up to three history deques per history id, as deep as that number, refreshed in EvaluateAdvection_SetPressureBCs:

Every start-up scheme has a history id of its own; its histories are freed in the first step after the start-up steps (FreeStartupHistories). CombineExplicitContributions forms X* = ∑ ici hi from a history h. The advection history is combined with the weights ci themselves, so that it matches the explicit contribution held in ^u. For the boundary data, the velocity and pressure-BC RHS histories are combined with the weights scaled to sum to λΔt, the scale being λΔt∕∑ ici with ∑ ici from GetCoefficientSum, so that with s = 1∕(λΔt) the velocity history gives

 *                 λΔt ∑             *  ∑     ci
u  = sV ,    V  = ∑----   ciui,    u  =     ∑----ui,
                    ici i                 i   j cj
(29.3)

an extrapolation with weights summing to one. In every multistep step ∑ ici = λ (e.g. u* = 2un -un-1 for J = 2), as in DIRK stage 1, and the scale is Δt; in DIRK stage 2 it is not (Section 29.5).

29.2.2 The velocity-correction stage

Given ^u and λΔt, SolveUnsteadyStokesSystem performs the following steps.

  1. Pressure forcing. fp = ∇⋅^u∕(λΔt) with DivergenceOp. The explicit advection stays in ^u for both formulations.

  2. Pressure boundary data. Extrapolate the pressure-BC histories, set the kinematic viscosity, the time tn+1 and the scale s = 1∕(λΔt) on the boundary operators (SetKinvis, SetTime, SetScale), and update the Neumann data of HOPressureBndCondOp (UpdateWithAcceleration, Section 29.3.1) and the Dirichlet data of HOutflowBndCondOp (UpdatePressure, Section 29.3.2).

  3. Singular pressure system. If every pressure boundary is Neumann or periodic on all ranks (v_GetSystemSingularChecks), MeanRemovalOp drives the domain integral of fp to the surface integral of the Neumann pressure data (MeanRemovalOp::SetNeumannBalance), which makes the system compatible also when that data is not zero, such as on a higher-order pressure region (Section 30.7). For a periodic system the integral is zero and the mean is removed.

  4. Pressure solve. Solve the strong pressure Poisson problem

                                  n+1
∇2pn+1 =  -1-∇  ⋅ ^u in Ω,    ∂p----=  g on Γ H,   pn+1 = pD on Γ D,
          λΔt                 ∂n
    (29.4)

    with PoissonSolveOp and a ConjGrad solver, then BwdTransOp and PhysDerivOp for pn+1 and ∇pn+1.

  5. Velocity solve. For the semi-implicit formulation solve, per component,

                            (             )
∇2un+1  - --1--un+1 =  1-∇pn+1  - -^u--
          νλ Δt        ν          λΔt
    (29.5)

    with HelmSolveOp and ConjGrad. For the linear-implicit formulation the extrapolated advection is removed from the right-hand side, ^uL = ^u-∑ icihiadv, and the linearised advection moves to the operator:

                                            (            )
∇2un+1  - 1(U  ⋅∇)un+1 -  --1--un+1 = 1- ∇pn+1 -  ^uL-- ,
          ν               νλΔt        ν           λΔt
    (29.6)

    solved with LinearADRSolveOp and GMRES. The right-hand side lost the explicit advection Δt∑ ici(ui ⋅∇)ui, which the operator puts back linearised about the extrapolated velocity u* of (29.3), as Δt∑ ici (u*⋅∇)un+1. It weights the advection by λΔt, so its advection velocity is

         ∑           ∑
U  = --iciu * = 1-   ciui,
       λ        λ  i
    (29.7)

    formed from the velocity history by CombineExplicitContributions with the scale Δt∕(νλΔt) (m_advVel holds U∕ν); the sum of the weights cancels. In a multistep step ∑ ici = λ and U = u* extrapolates the velocity to tn+1 at the order J of the scheme (2un -un-1 for J = 2). In a DIRK stage the weights have another sum (Section 29.5) and u* is their weighted mean of the earlier stage values, accurate to first order only: every start-up step has a second-order local error, which limits a multistep scheme to second order (Section 29.2.3.0), and an IMEXdirk scheme run on its own advects to first order. Before the solve, SetPressure hands the solved pressure to HOutflowBndCondOp, whose velocity Neumann adapter forms the outflow flux from it when the solve applies it.

The preconditioners of the pressure and semi-implicit velocity systems are cached per value of λΔt, so the start-up stages and the multistep steps each build theirs once. The linear-implicit velocity preconditioner is rebuilt every stage, because U changes.

29.2.3 Weak pressure form

The weak form of the pressure equation is selected with SOLVERINFO PressureFormulation=Weak (case insensitive), independently of FORMULATION. The default is Strong with semi-implicit and Weak with linear-implicit time-stepping. The redesign Poisson operator solves (∇ϕ,∇p)Ω = F + ∫ ΓNϕg dS for a forcing F and a Neumann datum g. The strong form takes F = -(ϕ,∇⋅fw)Ω with fw = ^u∕(λΔt); integrating it by parts,

                           ∫
- (ϕ,∇ ⋅fw)Ω = (∇ ϕ,fw )Ω -     ϕn ⋅f wdS,
                            ∂Ω

and moving the boundary term into the Neumann datum of the HOPBC ((29.10), whose sP is fw) gives

        n+1                  ∫       (un+D1               *)
(∇ ϕ,∇p    )Ω =  (∇ ϕ,f w)Ω -    ϕ n ⋅ -λΔt- + ν∇ ×  ∇ × u  dS.
                             Γ H
(29.8)

The predictor, explicit advection and forcing enter only through the volume term (∇ϕ,fw), computed with MultiRegions::IProductWRTDerivBaseOp<FieldState::Coeff> and passed to PoissonSolveOp::ApplyRhs, which takes the right-hand side in coefficient form, adds the Neumann data and the Dirichlet lift to it and solves; the physical-space Apply forms its right-hand side and then solves the same way. Higher-order pressure regions then need only the viscous term and the boundary acceleration, which HOPressureBndCondOp::UpdateWeak provides: the flux of UpdateWithAcceleration less sn ⋅P, that is g = -sn ⋅(uD + ν∇×∇×V ). A velocity component that is not Dirichlet on a region takes P -R, the velocity the predictor carries, as its boundary velocity, as in the strong form, so its flux there is -snd(νCd(V ) + Pd -Rd); the explicit-forcing history is kept for such regions only, as in the strong form. Further choices:

Linear-implicit formulation: stability and time order

The linear-implicit velocity solve advects with U of (29.7), so its time step may exceed the advective CFL limit. In a multistep step U = u* differs from un+1 by O(ΔtJ); in the IMEXdirk start-up stages it is a mean of stage values, which differs by O(Δt) and limits the formulation to second order in time for J = 3 on a flow whose advection changes in time. The pressure step still treats the advection in fw, the curl–curl term and the HOutflow velocity explicitly. Extrapolating them, as the strong and the semi-implicit weak forms do, brings back a time-step limit: the extrapolated u* = ∑ iciui∕∑ ici amplifies the high-frequency part of the history (by 3 for J = 2 and 7 for J = 3). The weak form takes them at the latest level instead; the price is an O(Δt) error in the explicit terms of its pressure step, which makes the form second order in time for J = 3 on a flow whose advection does not change in time, and leaves its pressure near higher-order pressure regions close to first order on a flow whose advection does (below).

On the manufactured flow HOPressureTimeConvergence2D.xml (8, 16 and 32 steps, Serial and AVX SumFac; its advection vanishes, so only the boundary terms matter) the final rates of u, v, p for J = 3 are 1.98, 1.98, 1.60 with the latest level and 3.22, 3.23, 2.92 with the curl–curl velocity extrapolated; for J = 2 they are 2.06, 2.22, 1.84 and 2.17, 2.22, 1.94. The level of the advection in fw does not change these rates. The strong form is third order for J = 3 (3.23, 3.25, 2.93). The largest stable time step (400 steps from a perturbed or impulsive start, Serial SumFac) is, with the values of the earlier advection velocity U = un in parentheses where they differ:

case, J strong weak weak, curl–curl u*a weak, all extrapolateda
KovasznayFlowHOPBC2D, 2 0.01 0.3 (0.35) 0.35 0.01
KovasznayFlowHOPBC2D, 3 0.005 0.2 (0.25) 0.1 < 0.005
CylinderFlowHOPBC2D, 2 0.6b ≥3 ≥3 0.5
CylinderFlowHOPBC2D, 3 0.25b ≥3 0.75 0.2
HOutflowKovasznay2D, 2 0.01 0.8 (1) 0.02 0.01
HOutflowKovasznay2D, 3 < 0.005 0.35 (0.4)
HOutflowBackflow2D, 2 0.01 0.5 (1) 0.01 0.01
HOutflowBackflow2D, 3 < 0.005 0.4 (0.8)

a measured with U = un; b 0.5 and 0.2 on the coarser grid of time steps used for U = un.

In the HOutflow cases the last column also extrapolates the HOutflow velocity, which shares the history. Extrapolating the curl–curl velocity only would restore third order on the flow above but reduce the stable time step by a factor of 2.5 to more than 4 for J = 3. For J = 2 it costs no stability in the higher-order pressure cases but gains little, so the latest level is kept for every order. Advecting with u* instead of un costs little stability with higher-order pressure regions and up to a factor of two with HOutflow regions. In HOutflowKovasznay2D the weak form with u* also keeps the error of the steady solution only up to a time step of 0.12 (J = 2) and 0.15 (J = 3), and stays bounded but inaccurate above it, where with un it kept that error up to its stability limit. VelocityCorrectionScheme::LoadSessionParameters() warns (on the root rank) when FORMULATION=LinearImplicit is used with a time integration scheme of order three or higher, whose order it cannot reach: the weak form is the more stable, with a lower-order pressure near higher-order pressure regions, and PressureFormulation=Strong the more accurate but much less stable.

Advective time order. The flow above has no advection, so it does not see the advection velocity U of the velocity solve. check_hopbc_time_order.py--manufacturedadvective sets the unsteady flow u = cost(x2,-2xy) + sin t(2xy,-y2) on the same session, with (∂tu⋅∇)u non-zero and not a gradient; it is quadratic, so the spatial error is zero and only the time error remains. The final rates of u, v, p (8, 16 and 32 steps to t = 0.2, Serial and AVX SumFac, NUMMODES 8) are:

formulation, pressure form J = 2 J = 3
semi-implicit, strong 2.22, 2.21, 1.93 2.89, 2.79, 2.95
semi-implicit, weak 2.22, 2.21, 1.93 2.89, 2.78, 2.98
linear-implicit, strong 2.26, 2.32, 1.92 1.98, 2.18, 2.02
linear-implicit, weak 2.03, 1.99, 1.63 1.98, 1.95, 1.48

With U = un every linear-implicit rate was between 0.95 and 1.04. The linear-implicit formulation is second order for J = 3 as well, because of the start-up stages. The weak-form pressure falls towards first order under refinement: from 32 to 64 and from 64 to 128 steps its rates are 1.51 and 1.37 for J = 2, 1.36 and 1.26 for J = 3, while the strong form stays at 1.94 to 2.02. Extrapolating the advection in fw as well raises the weak-form rates from 32 to 64 steps (NUMMODES 6) from 1.30 and 1.19 to 1.80 and 1.31, and extrapolating also the curl–curl velocity gives the rates of the strong form, at the cost of the stable time step above. The ctests IncNavierStokesSolverRedesign_HOPBC_Advective_TimeIntegrationOrders23 (semi-implicit, both forms, at the order of the scheme), _Advective_LinearImplicit_TimeIntegrationOrders23 (strong form, every rate at least 1.7 for J = 2 and 3) and _Advective_WeakPressure_LinearImplicit_TimeIntegrationOrders23 (velocity rates at least 1.7, pressure at least 1.1, which rules out first order) check these rates. An IMEXdirk scheme run on its own advects with stage means in every step, and the linear-implicit velocity is first order on this flow with it (IMEXdirk23 and IMEXdirk34; the pressure of every formulation is first order with these schemes too). The regression cases are steady or use first-order IMEX, for which U = un. The manufactured flow of check_time_order.py, u = (1 + 0.1sin t)u0(x), changes its advection by 0.1cost(u0 ⋅∇)u0 only, at ν = 1 and with 2 and 4 steps, where the error does not show, and check_imexdirk_forced_mms_2d.py checks that four IMEXdirk steps of the same kind of flow run, not a rate.

Legacy VCSImplicit advects with the extrapolated velocity u* by default (SOLVERINFO AdvectionVelocity=Extrapolated; Updated takes a first-order predictor of un+1 instead), as the redesign does, and takes the advection of its weak pressure forcing and the curl–curl velocity of its higher-order pressure flux at the latest level, as the redesign’s linear-implicit weak form does. On this session it is first order in the velocity, with pressure rates of 0.4 to 0.7, for both flows, including the one without advection, so from its higher-order pressure condition; with a Dirichlet pressure on every edge it is second order for J = 2 and J = 3 in both of its advection velocity choices (its semi-implicit scheme is also second order only for J = 3 there). Its stable time steps (legacy VCSImplicit, Extrapolated) are ≥ 2 in KovasznayFlowHOPBC2D and CylinderFlowHOPBC2D, 0.02 and 0.005 in HOutflowKovasznay2D for J = 2 and 3, and 0.01 and below 0.005 in HOutflowBackflow2D.