返回词条

等离子体壁相互作用 · 历史版本

版本编辑者时间修改说明
第 4 版站方导入2026/11/9 07:08:20百科字段核查:fields.content
第 3 版站方导入2026/10/15 23:53:06按统一模板整理并保留字段来源
第 2 版站方导入2026/10/10 19:10:46根据原始来源更新词条
第 1 版站方导入2026/10/10 19:00:12根据原始来源更新词条

第 2 版

等离子体壁相互作用

Multigrid Line Smoothers for Higher Order Upwind Discretizations of Convection-Dominated Problems

C. W. Oosterlee,<sup>∗</sup> F. J. Gaspar, T. Washio, and R. Wienands<sup>∗</sup>

<sup>∗</sup>GMD, Institute for Algorithms and Scientific Computing, D-53754 Sankt Augustin, Germany; C.P.S. University of Zaragoza, 50008 Zaragoza, Spain; C&C Research Laboratories, NEC Europe Ltd., D-53757 Sankt Augustin, Germany E-mail: oosterlee@gmd.de

Received March 4, 1997; revised September 18, 1997

In this paper we present new multigrid line smoothers for the solution of higher order discretizations of convection-dominated problems directly. The behavior of the smoothers is analyzed theoretically with Fourier smoothing and two-grid analysis. A parallel tri-line variant is presented and evaluated. The smoothers are applied to scalar convection-diffusion problems, discretized with limiters and systems of incompressible Navier–Stokes and Euler equations. °c 1998 Academic Press

Key Words: multigrid; line smoothers; higher order discretizations; convection domination.

Listing 1.6. GPP with OpenMP 4.5 directives

#pragma omp target teams distribute
    map(to...) map(from:output_re[0:3], output_im[0:3])
for(X){
    #pragma omp parallel for
    for(N){
    for(M){
    for(int iw = 0; iw < 3; ++iw){
    //Store in local variables
    }
    }
    for(int iw = 0; iw < 3; ++iw){
    #pragma omp atomic
    output_re[iw] += ...
    #pragma omp atomic
    output_im[iw] += ...
    }
    }
}

The target directive on line 1 ofloads the code block that follows the directive onto the accelerator. The teams distribute directives divide the loop iterations into teams and distribute them among the threadblocks. The parallel for on line 4 will distribute the loop among the threads within a threadblock. We inline all function calls from inside the kernel region to avoid additional overhead caused by kernel calls from the device. Array reductions are not supported inside target regions by the xl compilers and therefore we resorted to our atomic update approach. We furthermore need to manage the data accessed inside the target region. This information is passed to the framework via the map clauses and their use is shown in Listing 1.6:

– map(to:input[0:N]) - copy the values in the data structure to the device at the start of the target region.

– map(tofrom:input-output[0:N]) - copy the values in the data structure to-and-from the device

– map(from:output[0:N]) - copy the values in the data structure from the device at the end of the target region

– map(alloc:input[0:N]) - A corresponding storage space for input is created on the device

– map(delete:input[0:N]) - Delete the allocated data on the device

Our initial implementation shown in Listing 1.6 did not make the optimal use of available resources. It generated a kernel with 1280 threadblocks and 354 threads per block. Even though the X loop has only 512 iteration space, xl implementation of OpenMP 4.5 directives generated approximately twice the necessary threadblocks. The xl compilers distributed the N loop following the parallel for directive among the threads of a threadblock. Based on the iteration space and assuming all iterations take similar runtime, every thread would execute 4 iterations of the N loop and in every iteration the M loop is executed sequentially. This implies that the 3rd3 ^ { \mathrm { r d } } loop which has an iteration space of O(33K) are not parallelized. After experimentation with diferent combinations of work distribution Listing 1.7 shows our best implementation (without replacing atomic) of GPP.

9.3 Explicit Upwind Diferencing

Suppose we are concerned with solving a simple one-dimensional conservation equation such as the continuity equation,

∂ρ∂t+∂∂x(ρu)=0.(9.28)\frac {\partial \rho}{\partial t} + \frac {\partial}{\partial x} (\rho u) = 0.\tag{9.28}

This is of the form of Eq. (9.1) if we identify U=ρ,F=ρu,A=u.\mathbf { U } = \rho , \mathbf { F } = \rho u , \mathbf { A } = u . An explicit, two-time-level method which is conditionally stable involves the use of one-sided, rather than space-centered, diferencing. Backward spatial diferences are used if the velocity u is positive, and forward spatial diferences are used if u is negative.

The basic method is then

ρjn+1−ρjnδt=−[(ρu)jn−(ρu)j−1nδx]foru>0=−[(ρu)j+1n−(ρu)jnδx]foru<0.(9.29)\begin{array}{r c l} \frac {\rho_ {j} ^ {n + 1} - \rho_ {j} ^ {n}}{\delta t} & = & - \left[ \frac {(\rho u) _ {j} ^ {n} - (\rho u) _ {j - 1} ^ {n}}{\delta x} \right] \text {for} u > 0 \\ & = & - \left[ \frac {(\rho u) _ {j + 1} ^ {n} - (\rho u) _ {j} ^ {n}}{\delta x} \right] \text {for} u < 0. \end{array}\tag{9.29}

This method is known as “upwind,” “upstream,” or “donor cell” diferencing. It has a truncation error TΔ=O(δt,δx)T _ { \Delta } = \mathcal { O } ( \delta t , \delta x ) , and is stable for δt ≤ δx/u\delta t \ \leq \ \delta x / u . It is instructive to examine the leading order truncation error for the constant u case. Expanding in Taylor series and using Eq. (9.28) to eliminate time derivatives in favor of space derivatives gives for the truncation error

TΔ=(12∣u∣δx−12u2δt)∂2ρ∂x2+O(δx2,δt2).(9.30)T _ {\Delta} = \left(\frac {1}{2} | u | \delta x - \frac {1}{2} u ^ {2} \delta t\right) \frac {\partial^ {2} \rho}{\partial x ^ {2}} + \mathcal {O} (\delta x ^ {2}, \delta t ^ {2}).\tag{9.30}

We see that the upwind diference method introduces an artificial (or numerical) difusion term which makes the method stable if δt≤δx/u\delta t \le \delta x / u so that the efective difusion coeficient in brackets is positive.

To gain further insight as to why the upwind method works and is robustly stable, let us apply it to the simplified case where the velocity u is constant and positive, u>0u > 0 . Eq. (9.29) then reduces to

ρjn+1=sρj−1n+(1−s)ρjn,(9.31)\rho_ {j} ^ {n + 1} = s \rho_ {j - 1} ^ {n} + (1 - s) \rho_ {j} ^ {n},\tag{9.31}

where s≡uδt/δxs \equiv u \delta t / \delta x . This is illustrated schematically in Figure 9.3. We see that for s≤1s \leq 1 , the new value ρjn+1\rho _ { j } ^ { n + 1 } is obtained by following the characteristic curve back to the previous time level n and using linear interpolation to evaluate the intersection point. This also implies that there will be no new minima or maxima since the interpolated value will aways be bounded by the values at the two endpoints. This guarantees stability of the upwind method for s≤1s \leq 1


FIGURE 9.3: The upwind method corresponds to linear interpolation for the point where the characteristic curve intersects time level n as long as s≡uδt/δx≤1s \equiv u \delta t / \delta x \le 1

As a generalization of Eq. (9.31), we see that it can be written in the form

ρjn+1=ρjn+∑j≠kCj,k(ρkn−ρjn),(9.32)\rho_ {j} ^ {n + 1} = \rho_ {j} ^ {n} + \sum_ {j \neq k} C _ {j, k} \left(\rho_ {k} ^ {n} - \rho_ {j} ^ {n}\right),\tag{9.32}

where the coeficients are all non-negative and are zero except for nearest neighbors, i.e.,

Cj,k={≥0k=j±1=0else(9.33)C _ {j, k} = \left\{ \begin{array}{l l} \geq 0 & k = j \pm 1 \\ = 0 & \text {else} \end{array} \right.\tag{9.33}

If ρjn\rho _ { j } ^ { n } is a local maximum, then (ρkn−ρjn)≤0\left( \rho _ { k } ^ { n } - \rho _ { j } ^ { n } \right) \leq 0 , and so ρjn+1≤ρjn\rho _ { j } ^ { n + 1 } \leq \rho _ { j } ^ { n } . Conversely, if ρjn\rho _ { j } ^ { n } is a local minimum, then (ρkn−ρjn)≥0\left( \rho _ { k } ^ { n } - \rho _ { j } ^ { n } \right) \ge 0 , and so ρjn+1≥ρjn\rho _ { j } ^ { n + 1 } \geq \rho _ { j } ^ { n } . The scheme is therefore local extremum diminishing. It is clear that a method built on these principles can readily be extended to multiple dimensions.

The diference method described by Eq. (9.29) is conservative if the velocity u doesn’t change sign in the computational domain. If it does change sign, there will be a non-conservative error which introduces an artificial source or sink of mass, although it will be proportional to the local u which would be small since it is passing through zero near that point.

There is a variant of the upwind diferencing method which is fully conservative. We first define average interface velocities on each of the mesh points.

The sign of these velocities determines, by upwind diferencing, which cell values of ρ\rho to use. The method can be expressed as

ρjn+1−ρjnδt=−[uj+12nρj+12n−uj−12nρj−12nδx],(9.34)\frac {\rho_ {j} ^ {n + 1} - \rho_ {j} ^ {n}}{\delta t} = - \left[ \frac {u _ {j + \frac {1}{2}} ^ {n} \rho_ {j + \frac {1}{2}} ^ {n} - u _ {j - \frac {1}{2}} ^ {n} \rho_ {j - \frac {1}{2}} ^ {n}}{\delta x} \right],\tag{9.34}

where

uj+12=12[uj+1+uj],uj−12=12[uj+uj−1].(9.35)\begin{array}{l} {u _ {j + \frac {1}{2}} = \frac {1}{2} \left[ u _ {j + 1} + u _ {j} \right],} \\ {u _ {j - \frac {1}{2}} = \frac {1}{2} \left[ u _ {j} + u _ {j - 1} \right].} \end{array}\tag{9.35}

Alternatively, because of the staggered locations, the uj+12u _ { j + \frac { 1 } { 2 } } may be the fundamental variables. In either case, we would define the ρ\rho values as follows:

ρj+12=ρjforuj+12>0,=ρj+1foruj+12<0,ρj−12=ρj−1foruj−12>0,=ρjforuj−12<0.\begin{array}{r c l} \rho_ {j + \frac {1}{2}} & = & \rho_ {j} \quad \text {for} u _ {j + \frac {1}{2}} > 0, \\ & = & \rho_ {j + 1} \text {for} u _ {j + \frac {1}{2}} < 0, \\ \rho_ {j - \frac {1}{2}} & = & \rho_ {j - 1} \text {for} u _ {j - \frac {1}{2}} > 0, \\ & = & \rho_ {j} \quad \text {for} u _ {j - \frac {1}{2}} < 0. \end{array}

Because the method of Eq. (9.34) is conservative and also takes centered derivatives of u,u , it is generally preferred to that of Eq. (9.29).

参考资料