30.7 Solvability of a singular pressure system

When every pressure boundary is Neumann or periodic, the pressure is determined only up to a constant: the constant lies in the null space of the stiffness operator, and the system is solvable only when its right-hand side is orthogonal to it. Taking v = 1 in (30.18) gives the compatibility condition

|--------------------|
∫          ∮   ∂p-   |
|Ω fpdΩ  =  Γ  ∂n dS.|
-------------N--------
(30.19)

With ∂p∕∂n = 0 the right-hand side vanishes, and removing the mean of the forcing suffices. With the higher-order flux it does not: the discrete forcing and the discrete boundary flux are evaluated separately, and their integrals agree only up to the discretisation and extrapolation error. The residual is then the component of the right-hand side along the null space, which the linear solver cannot reduce.

VelocityCorrectionScheme flags the pressure system as singular when no rank has a pressure boundary that is neither Neumann nor periodic. Before each pressure solve, after the flux of this condition and the session Neumann values of the pressure system (UpdateBndCoeffs(time)) are updated for the stage, it enforces (30.19) on the forcing of the strong form:

1m_meanRemovalOp->SetNeumannBalance(m_poissonSolveOp.get()); 
2m_meanRemovalOp->Apply(m_wsp_phys[m_pressureIndex]);

The volume term (∇v, f  )
      w of the weak form vanishes for v = 1, so the weak form balances the surface integral with a constant forcing c of that domain integral instead, which enters as - (c,v)Ω = - c(1,v)Ω after the volume term. The integrals (1,ϕj)Ω of the pressure basis are computed once at set-up, so that each solve adds them with one daxpy:

1m_meanRemovalOp->SetNeumannBalance(m_poissonSolveOp.get()); 
2const double balancedMean = m_meanRemovalOp->GetBalancedMean()[0]; 
3m_math.daxpy(-balancedMean, m_pressureBasisIntegrals, 
4             m_wsp_coeff[m_pressureIndex], m_wsp_coeff[m_pressureIndex]);

The pieces are:

NeuBndCondOp::AddNeumannSurfaceIntegral(data, offset)

adds, per component and on this rank, the surface integral of the Neumann values an operator sets to data, in the memory space of the execution space, without reading it back. It is summed from the boundary inner products      ∫
bj = Γ  ϕj g dS
      f the operator already holds, by CGBndCondSurfaceIntegral, defined in CGBndCondSurfaceIntegral.hpp under library/MultiRegions/BndCondOps/ Common. A set of basis functions summing to one gives ∑       ∫
  j bj = Γ f gdS: the vertex modes of a Modified_A basis, or every mode of a Lagrange basis. Each block is summed on the stream that wrote it: a Lagrange or point block whole, its padding being zero, with Math::reduceSumKernel, and a Modified_A block with the masked Math::reduceSumKernel, over a uint8_t mask laid out as one component of the block at its interleave width, one at the vertex modes of every element and zero elsewhere, the padding included. The sum then reads the coefficients contiguously, at any interleave width, with no index arithmetic in the kernel. The mask of a block is built on the host, from the positions of its vertex modes within an element, and uploaded on the block’s stream: at interleave width 1, the width of the boundary fields, when the surface integral is built, and at any other width the first time a field is read at it, and kept. The operator builds it where it builds its boundary fields. NeuBndCondOpImpl sums the coefficients of the session values of the regions and components it applies, and HOPressureBndCondOpImpl those of the flux (30.7) computed by the last update. The velocity Neumann adapter of the outflow condition (chapter 31) adds the integral of the velocity flux of its last Apply(), for the velocity system.

LinearSystemOp::AddNeumannSurfaceIntegral(data, offset)

adds the integrals of the Neumann operators of the system, the default one and those added with AddNeumannBCOp(), which apply the regions the default one leaves out.

MeanRemovalOp::SetNeumannBalance(system)

keeps a pointer to the system whose surface integral each component’s domain integral is driven to. Apply() adds the surface integrals to the reduction of the domain integrals and the volume, so that one reduction across the ranks of the row communicator and one read back to the host serve all three, and then subtracts  ∫
( Ω f d Ω - c)∕|Ω| from component f, with c its surface integral, so that the integral of the result is c instead of zero. Without a system, the default, it removes the mean. GetBalancedMean() returns c∕|Ω|, the mean Apply() drives each component to, with one reduction and one read back of the surface integrals alone; the volume is computed on its first call and kept. The operator is shared with the reported pressure error, which clears the balance before its own mean removal.