Abstract
The pressure-velocity formulation of the incompressible Navier-Stokes equations is solved using high-order finite difference operators satisfying a summation-by-parts property. Two methods for imposing Dirichlet boundary conditions (one strong and one weak) are presented and proven stable using the energy method. Additionally, novel diagonal-norm second-derivative finite difference operators are derived with highly improved boundary accuracy. Accuracy and convergence measurements are presented and verified against theoretical expectations. Numerical experiments also show that subtle effects close to solid walls are more efficiently captured with strong boundary condition imposition methods rather than weak (less degrees of freedom required).
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Multiple numerical methods for the incompressible Navier-Stokes equations have been suggested in the past. Among the popular ones are fractional step projection methods [1,2,3], where an approximation of the velocity field is computed and then corrected in a following step to impose the divergence free condition. Used together with staggered grids [4] this type of method has achieved great success and is probably the most commonly used today. However, although flexible (in principle any method can be used for the spatial discretization) and efficient (the velocity and pressure computations are decoupled), it exhibits some issues in terms of temporal accuracy and boundary conditions. Another common approach is to rewrite the problem in terms of the streamfunction and vorticity of the velocity field, which results in the streamfunction-vorticity formulation [5]. This approach has achieved efficient and stable incompressible flow simulations in two spatial dimensions. However, the benefits are not retained in three dimensions, particularly due to computational costs and the complexity of boundary conditions [6]. In this paper we consider the velocity-pressure formulation of the incompressible Navier-Stokes equations. The main benefit of this formulation is that there are no theoretical order barriers and that it is equally applicable in two and three spatial dimensions. The downsides to the velocity-pressure formulation are that special care needs to be taken with regards to the incompressibility constraint and that additional pressure boundary conditions have to be derived.
It is well known that high-order methods can be used to more efficiently resolve fine structures in flow simulations, compared to more widely used low-order (first and second-order accurate) methods. The main difficulty when constructing high order schemes is the imposition of boundary conditions such that the discretization is stable for long-time simulations. One way to achieve this is to use high-order finite difference methods satisfying a summation-by-parts (SBP) property [7,8,9], together with either the simultaneous approximation term (SAT) or the projection (P) method to impose boundary conditions. Using either SBP-SAT or SBP-P allows one to prove stability using the energy method. Examples of the SBP-SAT and SBP-P methods can be found in [10,11,12] and [13,14,15] respectively. Furthermore, the SBP-SAT approach have successfully been applied to problems with complex and non-smooth geometries, see for example [16, 17].
The primary focus of this paper is to compare SBP-SAT and SBP-P for imposing Dirichlet boundary conditions in general, and no-slip wall boundary conditions in particular. We present stable SBP-P and SBP-SAT discretizations of the incompressible Navier-Stokes equations with Dirichlet boundary conditions, including procedures for enforcing the divergence free condition and deriving consistent pressure boundary data. Numerical experiments show that the two methods are similar in terms of accuracy and convergence, but that fluid dynamical effects close to walls require less grid-points to develop if the homogeneous Dirichlet boundary conditions are imposed strongly (SBP-P) rather than weakly (SBP-SAT).
Recent developments have shown that a significant improvement of accuracy can be gained by employing so-called optimal first derivative SBP operators over traditional SBP operators for hyperbolic problems [12, 18]. The optimal operators are optimized for boundary accuracy by allowing a non-equidistant distribution of grid points close to the boundaries. In this paper we derive novel narrow-stencil second-derivative SBP operators that are compatible with the optimal diagonal-norm first-derivative SBP operators presented in [18]. The new operators are compared numerically to traditional SBP operators and shown to be highly superior in terms of accuracy, convergence, and efficiency. This is the second main result of the present study.
The paper is organized as follows: in Sect. 2 we present the continuous analysis including derivation of the velocity-pressure formulation and energy stability of the momentum equation. Section 3 covers the corresponding analysis in the semi-discrete setting and describes the divergence and pressure boundary procedures with SBP-P and SBP-SAT. The new narrow-stencil optimal second-derivative SBP operators are also presented in Sect. 3. In Sect. 4 the numerical experiments and results are presented. Conclusions are drawn in Sect. 5.
2 Continuous Analysis
The dimensionless incompressible Navier-Stokes equations are given by
where \({{\mathbf {V}}}\) is the velocity field, p the pressure, \({\mathrm {Re}}\) the Reynolds number, \({{\mathbf {G}}}\) the boundary data and \({{\mathbf {H}}}\) the initial data. In two spatial dimensions we have \({{\mathbf {V}}} = (u,v)^T\), where u and v are the velocities in the x- and y-direction, respectively. The boundary operator B and boundary data \({{\mathbf {G}}}\) determine the boundary conditions. The spatial domain is \(\Omega \in {\mathbb {R}}^2\) and its boundary \(\partial \Omega \). We refer to the first equation in (1) as the momentum equation and the second equation as the divergence free condition.
Taking the divergence of the momentum equation leads to
where \(\phi = \nabla \cdot {{\mathbf {V}}}\). Here subscripts denote partial differentiation. Substituting the divergence free condition \(\phi = 0\) leads to the pressure Poisson equation (PPE),
Note that (3) by itself is not enough to replace the divergence free condition. This is seen by substituting (3) in (2) and not imposing \(\phi = 0\). We get
i.e. the divergence satisfies an advection-diffusion equation. For \(\phi \) to be non-growing boundary conditions for the divergence are required, here we use homogeneous Dirichlet boundary conditions. See [19] for a derivation of maximally dissipative boundary conditions to this problem. Additionally, for the divergence to be zero for all time the initial divergence has to be zero. Finally, we arrive at the velocity-pressure formulation of (1):
Note that the divergence free condition in (1) has been replaced by the PPE and a homogeneous Dirichlet boundary condition for the divergence.
2.1 Energy of the Momentum Equation
Let \((u,v) = \int _\Omega u v\) denote the \(L^2\)-inner product of two real-valued functions u, v and \(\vert \vert u \vert \vert ^2 = (u,u)\) the corresponding norm. Taking the inner product of \({{\mathbf {V}}}\) and the momentum Eq. in (5) (the energy method) leads to
where E is an energy defined by \(E = \vert \vert u \vert \vert ^2 + \vert \vert v \vert \vert ^2\) and the boundary terms are given by
where \(n = (n^{(x)},n^{(y)})\) is the normal vector to the boundary. To arrive at (6) the following identities are used:
From (6) it is clear that the energy is decreasing if the boundary terms are taken care by suitable (i.e. the correct number of) boundary conditions such that \(BT \le 0\) (for homogeneous data) and the divergence free condition \(\nabla \cdot {{\mathbf {V}}} = 0\) is fulfilled.
2.2 Characteristic Boundary Conditions
In this paper we use characteristic boundary conditions (CBC) as non-reflecting outflow boundary conditions and as interface conditions for the backwards facing step problem in Sect. 4.3. They are derived for the incompressible Navier-Stokes equations in [19], look there for more details.
Boundary characteristic variables to the incompressible Navier-Stokes equations are given by
where
and \(V_n = u n_x + v n_y\) denotes the normal velocity and \(V_t = -un_y + v n_x\) the tangential velocity. Since \(\lambda _{2,5} < 0\) the CBC are
where \(g_{2}\) and \(g_5\) are boundary data. With these boundary conditions the energy Eq. (6) becomes
where
With \(g_{2,5} = 0\) it is clear that these boundary conditions leads to additional energy dissipation.
2.3 Dirichlet Boundary Conditions
If we use Dirichlet boundary conditions for no-slip walls and inflow boundaries, then an energy estimate can easily be obtained if the divergence free condition is fulfilled. Assuming zero data or a wall (\({{\mathbf {V}}} = {{\mathbf {G}}} = 0\)) the boundary terms (7) are zero and the energy Eq. (6) becomes
3 Discrete Analysis
3.1 Definitions
The spatial discretization is done using high order finite difference SBP operators. Here we include a short description of the operators required for this problem. For more details on SBP finite differences, see [8, 9, 20, 21].
The two-dimensional domain is discretized using m points in each dimension (the extension to rectangular domains is straightforward):
where \({{\mathbf {x}}}\) and \({{\mathbf {y}}}\) are vectors containing the grid points. For an equidistant grid we have
where \(h_{x,y}\) are the grid sizes and \(x_{l,r}, y_{l,r}\) are the domain limits. Let v denote a semi-discrete solution vector so that \(v^T = [v^{(1)},v^{(2)},\ldots ,v^{(m)}]\), where \(v^{(i)} = [v_1^{(i)},v_2^{(i)},\ldots ,v_m^{(i)}]\) contains the solution points at \(x_i\) along the y-axis, see Fig. 1. Here we have three such solution vectors: u, v and p corresponding to the discrete values of x-velocity, y-velocity and pressure respectively. Note that u, v and p previously denoted the space-continuous solutions, to avoid cluttered notation we use the same symbols for the semi-discrete solution vectors in the coming sections.
The incompressible Navier-Stokes equations require first and second derivative SBP operators, the following definitions are central:
Definition 1
A difference operator \(D_1 = H^{-1} Q\) approximating \(\partial /\partial x\), using a pth-order accurate narrow-stencil, is said to be a pth-order accurate narrow-stencil diagonal-norm first derivative SBP operator if H is diagonal and positive definite and \(Q + Q^T = B = diag(-1, 0,\ldots , 0, 1)\).
Definition 2
A difference operator \(D_2 = H^{-1}(-M + BS)\) approximating \(\partial ^2/\partial x^2\), using a pth-order accurate narrow-stencil, is said to be a pth-order accurate narrow-stencil diagonal-norm second derivative SBP operator if H is diagonal and positive definite, M is symmetric and positive semi-definite, S approximates the first derivative operator at the boundaries and \(B = diag(-1, 0,\ldots , 0, 1)\).
The matrix B can be expressed in terms of the frequently used vectors
as \(B = -e_1 e_1^T + e_m e_m^T\). Additionally, the matrix S is often written in terms of one sided first-derivative operators \(d_1\) and \(d_m\), approximating the first derivative at the left and right boundary respectively, as \(BS = -e_1 d_1 + e_m d_m\). The extension of the one-dimensional SBP operators to two dimensions is done using the following relationships:
where \(\otimes \) denotes the Kronecker product and \(I_m\) is the \(m \times m\) identity matrix. The discrete Laplace operator is given by
We also define the following discrete inner products and corresponding norms:
where \({\bar{H}} = H_x H_y = (H \otimes H)\) and \(\bar{{\bar{H}}} = \begin{bmatrix} {\bar{H}} &{} 0 \\ 0 &{} {\bar{H}} \end{bmatrix}\). In this paper we consider two types of narrow-stencil diagonal-norm SBP operators: traditional and optimal. The main difference is in the distribution of grid points. The traditional operators are designed to act on standard equidistant Cartesian grids. And the optimal operators on non-equidistant grids where the distribution of grid points near the boundaries are chosen to maximize the accuracy of the operators. See [12, 18] for more details. Note that we do not map the PDE in the usual sense, we simply discretize it on different grids and use operators designed for those grids. In the present study we use 6th and 8th order accurate operators of both types.
3.2 Compatible Second Derivative Operators
The derivation of the discrete PPE (see Sect. 3.5) necessitates that the discrete Laplace operators in the momentum equation are given by the discrete divergence of the discrete gradient operator, i.e.
The superscript in (21) indicates that this is a wide operator (wide internal stencil) constructed from the wide second derivative operator \(D_2^{(w)} = D_1 D_1\). However, since central first derivative operators do not resolve the highest frequency mode (the \(\pi \)-mode) that can exist on the grid, the induced second derivative operator \(D_2^{(w)}\) will not either. This can lead to odd-even decoupled oscillations in the solution [22]. To rectify this we combine \(D_2^{(w)}\) with artificial dissipation to obtain narrow-stencil second derivative operators that are compatible. The following definition, first introduced in [22], is central:
Definition 3
Let \(D_1\) and \(D_2^{(n)}\) be pth-order accurate narrow-stencil diagonal-norm first- and second-derivative SBP operators. If
and the remainder \(R^{(p)}\) is positive semi-definite, \(D_1\) and \(D_2^{(n)}\) are called compatible.
The narrow discrete Laplace operator \(D_L^{(n)}\), constructed according to (19) using \(D_2^{(n)}\), is given by
where
The remainders \(R^{(p)}\) for \(p = 6,8\) were first derived for constant coefficient traditional operators in [22]. To find them for the optimal operators we take inspiration from [23], where narrow-stencil variable coefficient second-derivative SBP operators were derived, and make the ansatz
The internal stencils in \(D_i^{(p)}\) are narrow-stencil approximations of the ith derivative using the same non-equidistant grid point distribution as \(D_1\). Note that \(R^{(p)}\) is symmetric and positive semi-definite by construction and that the term \(-H^{-1} R^{(p)}\) in (22) constitutes artificial dissipation (since it is an even derivative approximation in the interior). To achieve non-stiff second derivative SBP operators, we zero out the first few rows in \(D_i^{(p)}\). For more details see [22, 23]. See also [24], where a similar technique is used to construct general artificial dissipation operators for SBP operators.
The optimal SBP operators, including the new second-derivative operators, are available online at https://github.com/guer7/sbp.
Remark
The compatible second derivative SBP operators can be made more or less narrow by including or excluding terms in (25), each term corresponds to canceling out one additional value on each side of the inner stencil. The choices in (25) are those that yield second-derivative operators with minimal stencil width, referred to as narrow-stencil second-derivative operators. Numerical experiments have shown that excluding the terms corresponding to the lowest order derivatives in (25) has some favorable properties. Compared to the minimally narrow scheme, this choice was found to be slightly more accurate and allow for slightly larger time steps. Presently, the reason for this is not fully understood. It may be related to the accuracy of the boundary closures, but a thorough investigation is out of scope of the current work. The numerical results presented in Sect. 4 utilize this slightly wider operator, since it leads to a more efficient scheme.
3.3 Semi-discrete Momentum Equation
Let
define the semi-discrete velocity field. Ignoring boundary conditions for now, a consistent semi-discrete approximation of the momentum equation is given by
where the right-hand-side is given by
Here
are the skew-symmetric split advection operators (see (8)) and \({\bar{u}}\), \({\bar{v}}\), \({\bar{u}}_x\) and \({\bar{v}}_y\) denote diagonal matrices with the elements of u, v, \(D_x u\) and \(D_y v\) respectively on the diagonal.
3.4 Discrete Energy Estimate
To make the stability analysis more readable, we only present boundary terms corresponding to the western and eastern boundaries. The southern and northern boundaries are done analogously. Taking the inner product of w and (27) and using Definitions 1 and 2 gives
where
is the discrete energy,
the dissipation (the second row in (32) is due to the artificial dissipation \(AD^{(p)}\)),
the boundary terms where \({\bar{u}}_{w,e}\) denote diagonal matrices with the elements of \(u_{w,e}\) on the diagonal and
the remainder terms proportional to the discrete divergence.
The energy Eq. (30) is the discrete equivalent to the continuous Eq. (6). To obtain a discrete energy estimate we need to fulfill two things: (i) impose the correct number of boundary conditions such that \(BT \le 0\) (with zero boundary data); and (ii) ensure that the discrete divergence converges towards zero as the grid is refined, so that \(RT = 0\) as \(h \rightarrow 0\).
3.5 Semi-discrete Pressure Poisson Equation
Regarding the PPE one has two options: (i) derive the continuous PPE (3) first and then discretize; or (ii) discretize the momentum equation first and then derive a discrete PPE. To ensure that the semi-discrete momentum equation and PPE are compatible, we take the second approach.
As in the continuous analysis, the first step in deriving a semi-discrete PPE is to multiply (27) by \(\begin{bmatrix} D_x&D_y \end{bmatrix} \) from the left (take the discrete divergence of the semi-discrete momentum equation). We get
where \(\phi = D_x u + D_y v\) denotes the discrete divergence and
The following lemma is one of the main results of this paper:
Lemma 3.1
The norm of the discrete divergence \(\phi \) is non-increasing if the semi-discrete momentum Eq. (27) holds, the discrete divergence satisfies
and the pressure satisfies the discrete PPE
Proof
Taking the inner product of \(\phi \) and (35) and using Definitions 1 and 2 lead to
where
If \(\phi _{w,e,s,n} = 0\) and \(D_L^{(w)} p = F\) the right-hand-side of (39) is zero and
\(\square \)
Lemma 3.1 shows that the H-norm of the discrete divergence will decrease over time if the boundary condition (37) holds. For the discrete divergence to be zero at all times, we also require that the initial condition satisfies
Remark
The derivation of the discrete PPE leads to a wide Laplace operator in (38). One may consider using the narrow operator instead since it includes dissipation that does not allow for \(\pi \)-mode oscillations. However, numerical experiments have shown that this has no clear benefits in practice. Compared to the narrow options, the scheme with the wide operators is slightly more accurate and allows for slightly larger time steps. As for the Laplace operator in the momentum equation, the differences are minor and an extensive study of the reasons for this is beyond the scope of the current work. But we point out that the derivation of the discrete PPE presented in Sect. 3.5 directly leads to a wide Laplace operator. Adding the dissipative term to construct the narrow operator makes the discrete PPE in one sense inconsistent with the discrete momentum equation. Which could be a reason for the small decrease in accuracy.
3.6 Semi-Discrete Problem
We are now ready to formulate the semi-discrete problem:
Here D(u, v, p) is given by (28), F is given by (36) and \({\hat{B}}\), \({{\hat{\mathbf {G}}}}\) and \({{\hat{\mathbf {H}}}}\) define the discretized boundary and initial conditions. In this paper we consider two methods to solve (43) with Dirichlet boundary conditions: projection and SAT. Both methods augment the momentum equation and PPE to impose the boundary conditions, resulting in provably stable systems of ODEs. In Sects. 3.7 and 3.8 the two methods are presented separately, including procedures for deriving and imposing consistent pressure boundary conditions.
Remark
We use CBC as outflow and interface conditions for the numerical experiments on the backwards facing step problem (presented in Sect. 4.3). An SBP-SAT discretization of these conditions including energy estimates is presented in [19].
3.7 Projection Method
In this section SBP-P discretizations of the momentum and pressure Poisson equations are presented. In Sect. 3.7.3 the method is summarized step-by-step for wall boundary conditions.
3.7.1 Momentum Equation
The Dirichlet velocity and divergence boundary conditions can be represented discretely as
where
with
Here \(L_{w,e} w = g_{w,e}\) corresponds to the Dirichlet boundary conditions and \(L_{div} w = 0\) to the divergence boundary condition on the western and eastern boundaries. A consistent semi-discrete approximation of the momentum equation with (44) imposed using the projection method is given by
where \(\begin{bmatrix} {{\hat{u}}} \\ {{\hat{v}}} \end{bmatrix} = {{\hat{w}}} = P w + (I - P) {\tilde{g}}\). Here
is a projection operator, \({\tilde{g}}\) satisfies \(L {\tilde{g}} = g\) and I is the identity matrix. Note that P is self-adjoint with respect to the inner product \((\cdot ,\cdot )_{\bar{{\bar{H}}}}\), i.e.
and that \({\tilde{g}}\) never has to be computed explicitly since it only appears as \(L {\tilde{g}}\) in the equations (the same is true for \({\tilde{g}}_t\)). See [13] for more details on the projection method.
The following lemma is one of the main results in this paper:
Lemma 3.2
The system (47) is a stable approximation of the momentum equation with Dirichlet boundary conditions if the projection operator P is given by (48).
Proof
Taking the inner product of w and (47) with zero data, using Definitions 1 and 2 and using (49) leads to boundary terms
where \({\bar{u}}_{w,e}\) denote diagonal matrices with the elements of \({\hat{u}}_{w,e}\) on the diagonal. Since \(L {{\hat{w}}} = L P w = 0\), and thus \({{\hat{u}}}_{w,e} = {{\hat{v}}}_{w,e} = 0\), we get \(BT = 0\). \(\square \)
Note that with the projection method both the velocity and divergence boundary conditions are imposed simultaneously, thus solving (47) with a pressure satisfying \(D_L p = F\) is sufficient to ensure that the divergence is zero.
Remark
The projection method can be used to project zero divergence everywhere (not only on the boundaries), this may be useful as pre- or post-processing step. Then the divergence boundary operator becomes
3.7.2 Pressure Equation
If no pressure boundary data is available, consistent pressure values have to be derived numerically. Here we extract the gradient of the pressure on the boundaries from the normal component of the momentum equation. For example, on the western boundary we have
The validity of these boundary conditions has been a topic of discussion for a long time, see for example [25,26,27,28,29]. In our view no consistency requirements are violated as long as the velocities in (52) satisfy the divergence boundary conditions. The Neumann pressure boundary conditions are given by \(L p = g_p\), where
The PPE with Neumann boundary conditions imposed using the projection method is given by
where \(\sigma \) is a positive scalar, \(L {\tilde{g}}_p = g_p\) and
The term \(\sigma {\bar{H}} (I - P) (p - {\tilde{g}}_p)\) in (54) is required to remove zero eigenvalues due to the projection. A similar term is used in [13] to rectify inconsistent initial and boundary data for PDEs. The parameter \(\sigma \) should be chosen proportional to \((h_x h_y)^{-1}\) so that the term \(\sigma {\bar{H}} (I - P) (p - {\tilde{g}}_p)\) does not go to zero as we grid refine. From numerical experiments (not presented here) we found that
is a good choice in terms of accuracy and robustness.
By rearranging (54) we get the system
where
Note that \(A_N\) is singular (even with \(\sigma \ne 0)\). Since any constant vector p is a solution to \(A_N p = 0\) (since \(D_L^{(w)} p = Lp = 0\)), any solution to (57) is unique up to an arbitrary constant. To avoid this singularity we impose the additional constraint that the average pressure across the whole domain is zero. A simple numerical formulation of the resulting system is
where \({{\mathbf {1}}}\) is a vector with all components equal to one [30].
3.7.3 Summary
We summarize the projection approach by describing the procedure for computing the right-hand side of (47) with wall boundary conditions:
-
1.
Project the velocities so that (37) holds.
-
2.
Compute the pressure normal derivative using (52).
-
3.
Solve the pressure Eq. (59) using the pressure normal derivative as data.
-
4.
Compute (47).
3.8 SAT Method
In this section SBP-SAT discretizations of the momentum and pressure Poisson equations are presented. In Sect. 3.8.3 the method is summarized step-by-step for wall boundary conditions
3.8.1 Momentum Equation
The ODE system (27) augmented with Dirichlet boundary conditions imposed using SAT is given by
where
and
Here \({\bar{\sigma }}_{w,e}^{(u,v)} \in {\mathbb {R}}^{m \times m}\) are chosen so that an energy estimate is obtained. Note that the pressure terms in (61) are necessary to obtain an energy estimate due to the pressure terms in (33). The following lemma is one of the main results of this paper:
Lemma 3.3
The system (60) is a stable approximation of the momentum equation with Dirichlet boundary conditions if the discrete divergence free condition is fulfilled (so that \(RT = 0\)),
Proof
Taking the inner product of w and (60) with zero data and using Definitions 1 and 2 leads to boundary terms
Choosing
yields \(BT = 0\). Thus, if \(RT = 0\), an energy estimate is obtained and (60) is a stable ODE system. \(\square \)
To impose the divergence boundary conditions with SAT we employ the same technique as in [19]. With this approach the boundary values of the velocity in the normal direction are modified so that the divergence free condition (37) is fulfilled exactly. For example, using Matlab index notation, on the western boundary we strongly enforce
3.8.2 Pressure Equation
An issue with the SAT method for Dirichlet velocity boundary conditions is the pressure data required in (61). As a consequence (52) can not be used directly as pressure boundary data since it only provides the normal derivative. Here we use a numerical trick where the current pressure is used to compute the boundary pressure values so that the normal derivative equals \(g_w^{(p_x)}\) given by (52). For example, using Matlab notation, on the western boundary we use
The PPE with Dirichlet boundary conditions imposed using SAT is given by
where
We get the system
where
3.8.3 Summary
We summarize the SAT approach by describing the procedure for computing the right-hand side of (60) with wall boundary conditions:
4 Numerical Experiments
To verify and compare the projection and SAT methods for Dirichlet boundary conditions we apply the methods to two problems: (i) The Taylor-Green vortex flow (analytical solution) and (ii) the lid-driven cavity problem. The first problem focuses on the accuracy and convergence properties of the methods and SBP operators. The second problem compares SAT and projection for wall boundary conditions in particular. Additionally, we solve the backwards-facing step problem and compare the results to experimental benchmark data. To integrate the ODE systems (47) and (60) in time we use the classical 4th order explicit Runge-Kutta method with time step \(\Delta t \propto \frac{h^2}{{\mathrm {Re}}}\), where h is the minimum spatial grid interval. The pressure systems (59) and (70) are solved using LU-factorization.
4.1 Convergence Study
An analytical solution to the incompressible Navier-Stokes equations in two dimensions is the Taylor-Green vortex flow:
where \((x_0,y_0)\) are the starting coordinates of the vortices, \(\theta \) is the angle at which they are moving and \(u_\infty \) is their speed. We use a square domain \(x,y \in [-1,1]\) with total degrees of freedom \(N = m^2\) where m is the number of grid points in each dimension. The problem parameters in (72) are chosen to \({\mathrm {Re}}=100\), \(u_\infty =1\), \((x_0,y_0)=(0,0)\) and \(\theta = \frac{\pi }{4}\). The initial and boundary data are given by the analytical solution (72) (for this problem we use exact pressure data). The errors of the approximations are measured in the H-norms given by (20) of the difference between approximated and analytical solution, denoted \(\epsilon ^{(w,p)}\), at \(t = 1\). The convergence rate is estimated as
where \(N_1 \ne N_2\) are the degrees of freedom of two separate solutions and d is the spatial dimension, here \(d = 2\).
The theoretical rate of convergence for this problem is \(\min {(p,r+2)}\), where p is the internal stencil order and r the boundary closure order of the least accurate SBP operator in the scheme [31]. With a diagonal norm the closure order of the first derivative operator is half that of the internal order, \(r = p/2\). Furthermore, the wide-stencil second derivative operator \(D_2^{(w)}\) yields a scheme with one order of accuracy less at the boundaries, \(r = p/2-1\) [9]. The decreased boundary order of the second derivative operators is not rectified by the artificial dissipation discussed in Sect. 3.2, and thus it limits the convergence rates of the full schemes to \(\min {(p,p/2+1)}\) for both the traditional and optimal SBP operators. We get for the 6th and 8th order operators (\(p = 6,8\)) the theoretical convergence rates 4 and 5 respectively.
In Fig. 2 the velocity and pressure errors are plotted versus grid resolution for Dirichlet boundary conditions imposed using projection and SAT. The results show that projection and SAT are very similar in terms of accuracy and achieve close to or slightly above the expected convergence rates. Furthermore, the results demonstrate a significant difference in efficiency between the traditional and optimal SBP operators. For example, the optimal 8th order SBP operators yield a more accurate solution with \(51 \times 51\) grid points than the traditional 8th order SBP operators with \(151 \times 151\) grid points. We also emphasize that the gain in accuracy when going from 6th to 8th order operators is much higher with the optimal operators compared to the traditional, this is particularly clear for the pressure.
4.2 Lid-Driven Cavity
The lid-driven cavity is one of the most common benchmark problems for viscous incompressible flows. The problem setup consists of a two-dimensional unit square domain with walls at each boundary where the top wall is moving at a constant tangential velocity, see Fig. 3. The velocity field and pressure are initiated from zero and simulated until the velocity field has approximately converged towards a steady-state solution. We define the stopping criteria as
where \(w^{n}\) is the velocity field at time step n and \(\epsilon = 10^{-8}\). To avoid temporal discontinuities the non-zero boundary condition at the top wall is smoothly brought into the domain using a hyperbolic tangent function of time. All results presented here are obtained using the optimal 8th order SBP operators with m grid points in each dimension.
In Fig. 5 the streamlines of steady state solutions to the lid-driven cavity problem with Dirichlet boundary conditions imposed using projection (left column) and SAT (right column) are plotted. With the projection method the secondary corner vortices are visible already at \(m = 31\), whereas with the SAT method the corner vortices require significantly more degrees of freedom to develop, even with \(m = 151\) the vortex in the bottom left corner is not clear. This suggests that strong enforcement of physical boundary conditions (projection) is preferable over weak enforcement methods (SAT) when effects close to the boundaries are of primary interest. We hypothesize that this is a consequence of these effects requiring a clear distinction between boundary and inner domain to develop. Therefore, since the accuracy of the boundary conditions with SAT scales with the spatial resolution, one has to grid refine until this distinction is sufficiently large. Grid refinement with projection this is not required since the boundary conditions are fulfilled exactly, independently of grid resolution, and thus the distinction is always there.
To verify the accuracy of the SAT and projection methods for the lid-driven cavity problem we compare the results with \(m = 151\) to benchmark solutions provided in [32]. In Fig. 4 the velocities in the x- and y-directions along the vertical and horizontal centerlines of the cavity are plotted, indicating good agreement with the benchmark data for both methods.
Remark
We do not stretch the grid by mapping the PDE, which is usually done with finite difference methods to better resolve the boundary layer. The non-equidistant grid point distribution inherent to the optimal operators is in this case enough to capture the boundary effects.
4.3 Backward-Facing Step
The third problem we consider is the backward-facing step problem. The domain consists of an inflow pipe connected to an outflow pipe with larger radius, forming a step where the flow is disrupted and interesting effects occur, see Fig. 6. Here we use \(H_i = 0.5\) and \(H_o = 0.97\) which determines the expansion ratio of the step to \(\frac{H_o}{H_i} = 1.94\). To solve this problem with the SBP finite difference operators used here the computational domain has to be split into at least three rectangular blocks (one for the inflow and at least two for the outflow). Here we couple the blocks together by weakly imposing (using SAT) that the ingoing characteristic variables are equal on each side of the interfaces. This procedure has proven to be accurate and stable in the past, see for example [17].
Since we solve a local PPE in each block we benefit greatly in terms of efficiency by utilizing many smaller blocks as compared to a few larger ones. Therefore we set a fixed block size in the outflow channel of width 4 and height 0.5 or 0.47 (for top and bottom block respectively) with \(168 \times 21\) grid points in each direction. The length of the outflow channel is determined by the number of such blocks. The inflow consists of one block of width 1 and height 0.5 with \(42 \times 21\) grid points in each direction. As boundary conditions for the inflow we specify the normal velocity to be the theoretical solution of fully developed laminar flow in an infinitely long pipe, given by
where \(V_{max}\) is the velocity in the center of the pipe and R is its radius. Homogeneous characteristic boundary conditions imposed using SAT are used at the outflow. The Dirichlet boundary conditions (inflow and walls) are imposed using the projection method. In Fig. 7 the boundary and interface conditions are presented for a five-block domain. As for the lid-driven cavity problem we use the optimal 8th order SBP operators and a stopping criteria given by (74).
In Fig. 8 the velocity field of the steady-state solution to the backwards-facing step problem with \(Re = 600\) is shown. The primary and secondary vortices are clearly visible in the streamlines plot. Additionally, one can see the tendencies towards a parabolic flow in the outflow channel.
We verify the accuracy by comparing the reattachment and detachment lengths, denoted \(x_{1,2,3}\) in Fig. 6, of our results to experimental data provided in [33]. For these results the outflow pipe is chosen sufficiently long so that the considered lengths are unaffected. In Fig. 9 the comparison is presented for Reynold’s numbers up to \(Re = 1000\) with good agreement up until the secondary vortex is developed at around \(Re = 400\). As pointed out in [33], above approximately this Reynold’s number the flow becomes three-dimensional and thus the modeling error of the two-dimensional equations becomes dominant.
5 Conclusions
A high-order SBP finite difference method is developed for the velocity-pressure formulation of the incompressible Navier-Stokes equations. Two boundary procedures for imposing Dirichlet boundary conditions are presented based on the projection and SAT methods. The resulting schemes are proven to be stable using the energy method. Furthermore, new optimal second-derivative SBP operators are derived and shown to be highly efficient compared to traditional SBP operators.
The methods are evaluated on three benchmark problems: the Taylor-Green vortex flow, the lid-driven cavity and the backwards-facing step. The accuracy and convergence properties of the schemes are verified for the traditional and novel optimal SBP operators. For the lid-driven cavity and backwards-facing step problems good agreement with benchmark data is achieved. Additionally, imposing wall boundary conditions strongly (projection) rather than weakly (SAT) is shown to be more efficient in the sense that corner vortices for the lid-driven cavity problem requires less degrees of freedom to appear.
Interesting future extensions include expanding the methods to curvilinear grids in three spatial dimensions and proving multiblock stability using the projection method.
Data Availability
Enquiries about data availability should be directed to the authors.
References
Chorin, A.J.: The numerical solution of the Navier-Stokes equations for an incompressible fluid. Bull. Am. Math. Soc. 73(6), 928–931 (1967). https://doi.org/10.1090/S0002-9904-1967-11853-6
Chang, W., Giraldo, F., Perot, B.: Analysis of an Exact Fractional Step Method. J. Comput. Phys. (2002). https://doi.org/10.1006/jcph.2002.7087
Strikwerda, J.C., Lee, Y.S.: The Accuracy of the Fractional Step Method. SIAM J. Numer. Anal. (2000). https://doi.org/10.1137/s0036142997326938
Kim, J., Moin, P.: Application of a fractional-step method to incompressible Navier-Stokes equations. J. Comput. Phys. (1985). https://doi.org/10.1016/0021-9991(85)90148-2
Rimon, Y., Cheng, S.I.: Numerical Solution of a Uniform Flow over a Sphere at Intermediate Reynolds Numbers. Phys. Fluids (1969). https://doi.org/10.1063/1.2163685
Weinan, E., Liu, J.-G.: Finite Difference Methods for 3D Viscous Incompressible Flows in the Vorticity-Vector Potential Formulation on Nonstaggered Grids. J. Comput. Phys. (1997). https://doi.org/10.1006/jcph.1997.5815
Kreiss, H.-O., Scherer, G.: Finite Element and Finite Difference Methods for Hyperbolic Partial Differential Equations. Mathematical Aspects of Finite Elements in Partial Differential Equations (1974). https://doi.org/10.1016/b978-0-12-208350-1.50012-1
Strand, B.: Summation by Parts for Finite Difference Approximations for d/dx. J. Comput. Phys. (1994). https://doi.org/10.1006/jcph.1994.1005
Mattsson, K., Nordström, J.: Summation by parts operators for finite difference approximations of second derivatives. J. Comput. Phys. (2004). https://doi.org/10.1016/j.jcp.2004.03.001
Hicken, J.E.: Output error estimation for summation-by-parts finite-difference schemes. J. Comput. Phys. (2012). https://doi.org/10.1016/j.jcp.2012.01.031
Mattsson, K., Nordström, J.: High order finite difference methods for wave propagation in discontinuous media. J. Comput. Phys. (2006). https://doi.org/10.1016/j.jcp.2006.05.007
Mattsson, K., Almquist, M., Carpenter, M.H.: Optimal diagonal-norm SBP operators. J. Comput. Phys. (2014). https://doi.org/10.1016/j.jcp.2013.12.041
Mattsson, K., Olsson, P.: An improved projection method. J. Comput. Phys. (2018). https://doi.org/10.1016/j.jcp.2018.06.030
Olsson, P.: Summation by parts, projections, and stability. I. Mathematics of Computation (1995). https://doi.org/10.1090/s0025-5718-1995-1297474-x
Olsson, P.: Summation by parts, projections, and stability. II. Mathematics of Computation (1995). https://doi.org/10.1090/s0025-5718-1995-1308459-9
Mattsson, K., Ham, F., Iaccarino, G.: Stable and accurate wave-propagation in discontinuous media. J. Comput. Phys. 227(19), 8753–8767 (2008). https://doi.org/10.1016/j.jcp.2008.06.023
Mattsson, K., Svärd, M., Carpenter, M., Nordström, J.: High-order accurate computations for unsteady aerodynamics. Comput. Fluids (2007). https://doi.org/10.1016/j.compfluid.2006.02.004
Mattsson, K., Almquist, M., van der Weide, E.: Boundary optimized diagonal-norm SBP operators. J. Comput. Phys. 374, 1261–1266 (2018). https://doi.org/10.1016/j.jcp.2018.06.010
Nordström, J., Mattsson, K., Swanson, C.: Boundary conditions for a divergence free velocity-pressure formulation of the Navier-Stokes equations. J. Comput. Phys. (2007). https://doi.org/10.1016/j.jcp.2007.01.010
Svärd, M., Nordström, J.: Review of summation-by-parts schemes for initial-boundary-value problems. Journal of Computational Physics (2014) arXiv:1311.4984. https://doi.org/10.1016/j.jcp.2014.02.031
Del Rey Fernández, D.C., Hicken, J.E., Zingg, D.W.: Review of summation-by-parts operators with simultaneous approximation terms for the numerical solution of partial differential equations (2014). https://doi.org/10.1016/j.compfluid.2014.02.016
Mattsson, K., Svärd, M., Shoeybi, M.: Stable and accurate schemes for the compressible Navier-Stokes equations. J. Comput. Phys. (2008). https://doi.org/10.1016/j.jcp.2007.10.018
Mattsson, K.: Summation by Parts Operators for Finite Difference Approximations of Second-Derivatives with Variable Coefficients. J. Sci. Comput. (2012). https://doi.org/10.1007/s10915-011-9525-z
Craig Penner, D., Zingg, D.: High-order artificial dissipation operators possessing the summation-by-parts property. (2018). https://doi.org/10.2514/6.2018-4165
Gresho, P.M., Sani, R.L.: On pressure boundary conditions for the incompressible Navier-Stokes equations. Int. J. Numer. Meth. Fluids (1987). https://doi.org/10.1002/fld.1650071008
Strikwerda, J.C.: Finite Difference Methods for the Stokes and Navier-Stokes Equations. SIAM J. Sci. Stat. Comput. (1984). https://doi.org/10.1137/0905004
Rempfer, D.: On Boundary Conditions for Incompressible Navier-Stokes Problems. Appl. Mech. Rev. (2006). https://doi.org/10.1115/1.2177683
Sani, R.L., Shen, J., Pironneau, O., Gresho, P.M.: Pressure boundary condition for the time-dependent incompressible Navier-Stokes equations. Int. J. Numer. Meth. Fluids (2006). https://doi.org/10.1002/fld.1062
Petersson, N.A.: Stability of Pressure Boundary Conditions for Stokes and Navier-Stokes Equations. J. Comput. Phys. (2001). https://doi.org/10.1006/jcph.2001.6754
Henshaw, W.D., Petersson, N.A.: A split-step scheme for the incompressible navier-stokes equations. In: Numerical Simulations of Incompressible Flows, pp. 108–125 (2003). https://doi.org/10.1142/9789812796837_0007
Svärd, M., Nordström, J.: On the convergence rates of energy-stable finite-difference schemes. J. Comput. Phys. 397, 108819 (2019). https://doi.org/10.1016/j.jcp.2019.07.018
Ghia, U., Ghia, K.N., Shin, C.T.: High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method. J. Comput. Phys. (1982). https://doi.org/10.1016/0021-9991(82)90058-4
Armaly, B.F., Durst, F., Pereira, J.C.F., Schönung, B.: Experimental and theoretical investigation of backward-facing step flow. J. Fluid Mech. 127(1), 473 (1983). https://doi.org/10.1017/S0022112083002839
Acknowledgements
Most of the computations were enabled by resources in project [SNIC 2021/22-70] provided by the Swedish National Infrastructure for Computing (SNIC) at UPPMAX, partially funded by the Swedish Research Council through grant agreement no. 2018-05973.
Funding
Open access funding provided by Uppsala University. The authors did not receive support from any organization for the submitted work.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors have no conflicts of interest to declare that are relevant to the content of this article.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Eriksson, G., Mattsson, K. Weak Versus Strong Wall Boundary Conditions for the Incompressible Navier-Stokes Equations. J Sci Comput 92, 81 (2022). https://doi.org/10.1007/s10915-022-01941-5
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s10915-022-01941-5