29.3 Boundary conditions

Ordinary Dirichlet, Neumann and Robin conditions on velocity and pressure are imposed by the generic DirBndCondOp, NeuBndCondOp and RobBndCondOp of the linear-system operators: Dirichlet values are set in the coefficient solution, Neumann data is added to the right-hand side as a boundary inner product, and Robin terms enter the operator of the iterative solver. The two solver-specific conditions below are selected with USERDEFINEDTYPE and plug into the same interfaces: m_poissonSolveOp->AddNeumannBCOp, m_poissonSolveOp->AddDirichletBCOp and m_fieldsSolveOp->AddNeumannBCOp in VelocityCorrectionScheme::v_InitialiseOperators. Each operator is built only for a session with a region of its type (HasUserDefinedType, reduced over the ranks). A Neumann operator is added with LinearSystemOp::AddNeumannBCOp(op, userDefinedType), which makes the default Neumann operator of the system leave the regions of that type out (NeuBndCondOp::ExcludeUserDefinedType).

29.3.1 Higher-order pressure condition (HOPBC)

Continuous condition. Writing the viscous term in rotational form, ∇2u = -∇×∇×u for ∇⋅u = 0, and taking the normal component of (29.1) gives

         (                      )
∂p-=  n ⋅ N -  ν∇ × ∇  × u-  ∂u- .
∂n                           ∂t
(29.9)

Time-discrete form. HOPressureBndCondOp::UpdateWithAcceleration receives the extrapolated explicit forcing R, the extrapolated velocity V (both scaled as in (29.3)) and the predictor P = ^u; the scale s = 1∕(λΔt), the viscosity and the time are set beforehand with SetScale, SetKinvis and SetTime. The explicit parts of the base flux s(R -νC) and the acceleration flux s(P -R) cancel, so the operator evaluates

         [                      ]
g = s n ⋅P  - uD (tn+1) - νC (V ),     C(V ) = ∇ × ∇ × V ,
(29.10)

where uD is the discrete Dirichlet velocity: the session expressions evaluated on the boundary (ExpressionOp) and projected onto the boundary expansion of the velocity (FwdTransBCOp, then BwdTransOp), as the velocity solve imposes it. Its coefficients are kept and projected once, unless a Dirichlet velocity condition of the region is time-dependent; a point region takes the expression itself. A set-up ASSERTL0 checks that the velocity and pressure boundary expansions share their points. With a pressure of lower order than the velocity, the projection onto the pressure boundary expansion would differ from this one and leave sn ⋅(uDvel -uDpres) in the flux, which grows as Δt decreases. s(P -uD) is the negative discrete acceleration plus the explicit term, and vanishes at a steady state; sV = u* of (29.3). A velocity component d that is not Dirichlet on a region has no prescribed velocity and takes no acceleration: its flux there is snd[Rd -νCd(V )], which is why R is kept for such regions only. Update, without the predictor, evaluates g = sn⋅[R -νC(V )], and UpdateWeak the flux of the weak form (Section 29.2.3).

Selection. Only pressure Neumann regions tagged USERDEFINEDTYPE="H" receive the computed flux (IsHOPressure), as in the legacy solver; the default Neumann operator of the pressure system leaves them out. An untagged pressure Neumann region keeps its session value.

Data flow. Setup (SetVelocityContext) matches every selected boundary face to its owning velocity element by geometry id and builds a restricted expansion list of the boundary-adjacent elements. Each update then:

  1. gathers V onto the restricted elements (GatherBoundaryElements, an indexed copy) and applies CurlCurlOp there, since the derivatives need the volume polynomial;

  2. forms P-νC on the restricted volume (HOPressureVolumeCombineKernel), using the linearity of the trace;

  3. traces it to the boundary quadrature points with one PhysTraceExtractBndCond per region and contracts with the outward normal (HOPressureBoundaryCombineKernel); on a region with a velocity component that is not Dirichlet it also traces P -R and subtracts its contraction with the normal components of those velocity components;

  4. subtracts sn⋅uD (SubtractBoundaryVelocity);

  5. forms the boundary inner product bf = BfTWfJfgf with IProductWRTBaseOp and reorders it to the pressure block layout (BuildBoundaryCoeffs);

  6. in v_Apply, scatter-adds rp += ∑ fEfTbf with orientation signs into the Poisson right-hand side. Coefficients shared by several boundary pieces are summed in groups, which avoids atomics.

The redesign Poisson operator is positive, so the weak form is (∇p,∇v) = -(fp,v) + ⟨∂p∕∂n,v⟩ΓN and the boundary load is added, not assigned.

29.3.2 Dong outflow condition (HOutflow)

Equations. On an open boundary Γo the condition of Dong, Karniadakis and Chryssostomidis [24] couples a pressure Dirichlet value, evaluated before the pressure solve, with a velocity Neumann value, evaluated after it:

p = ν n⋅(∇u*)n-(E(n,u*) -f b) ⋅n, (29.11)
   n+1
∂u----
  ∂n = 1-
ν{[pn+1 -ν∇⋅u*]n+ E(n,u*) -f b}, (29.12)

with the backflow energy flux and smooth switch

    [                             ]
E =  θ-+-α2|u*|2n + 1---θ +-α1-unu* S0(un),
        2  [            2]
 S (u ) = 1-1- tanh -un- ,    u  = n ⋅u*.
  0  n    2         U0 δ       n
(29.13)

S0 ≈ 1 where the flow locally re-enters (un < 0) and S0 ≈ 0 where it leaves. The vector fb is the velocity VALUE of the region. The divergence term in (29.12) is required.

Scaling. UpdatePressure receives the extrapolated velocity V * of (29.3), with s = 1∕(λΔt) set by SetScale, and applies s to both the traced velocity and its gradient, u* = sV * and ∇u* = s∇V *, so that S0, E, the normal stress and the divergence use the same field.

Stage workflow.

  1. UpdatePressure (before the Poisson solve): gather the outlet-adjacent velocity elements, apply PhysDerivOp, trace u* and ∇u* with PhysTraceExtractBndCond, and evaluate (29.11) pointwise (HOutflowPressureKernel). The kernel keeps G = E-fb and ∇⋅u* on the active backend. The pressure values are projected with FwdTransBCOp and set as Dirichlet coefficients by the pressure Dirichlet adapter (GetPressureDirichletOp), after the default Dirichlet operator has evaluated the placeholder session value.

  2. After the Poisson solve, SetPressure hands the operator pn+1. When the velocity solve applies the velocity Neumann adapter (GetVelocityNeumannOp), the adapter traces pn+1 to Γo, forms h = [(p-ν∇⋅u*)n+ G]∕ν (HOutflowVelocityKernel), projects it with IProductWRTBaseOp and scatter-adds it. The adapter is added with AddNeumannBCOp(op, "HOutflow"), so the default Neumann operator leaves the outlet out and h is the whole load; fb enters through G.

Session. Every velocity component must carry a Neumann condition and the pressure a Dirichlet condition, all tagged USERDEFINEDTYPE="HOutflow":

1<REGION REF="1"> 
2  <N VAR="u" USERDEFINEDTYPE="HOutflow" VALUE="0" /> 
3  <N VAR="v" USERDEFINEDTYPE="HOutflow" VALUE="0" /> 
4  <D VAR="p" USERDEFINEDTYPE="HOutflow" VALUE="0" /> 
5</REGION>


parameter symbol default role
OutflowBC_theta θ 1 weight of the normal kinetic-energy term
OutflowBC_alpha1 α1 0 weight of the unu term
OutflowBC_alpha2 α2 0 added to the normal kinetic-energy term
U0_HighOrderBC U0 1 reference velocity of the switch
Delta_HighOrderBC δ 1∕20 width of the switch

Table 29.2 HOutflow session parameters (read in the HOutflowBndCondOpImpl constructor). U0 and δ must be positive.

The pairing of tags, the positivity of U0 and δ, and the rejection of a tagged pressure Neumann condition are checked with ASSERTL0, so also in release builds.