OpenFOAM里的DILU(Simplified Diagonal-based Incomplete LU preconditioner)实现数学细节

Simplified Diagonal-based Incomplete LU (DILU) Preconditioner in OpenFOAM

The DILU (Diagonal-based Incomplete LU) preconditioner in OpenFOAM is a simplified variant of the incomplete LU factorization preconditioner that’s computationally efficient while maintaining reasonable effectiveness for solving linear systems.

Mathematical Formulation

For a matrix A, the DILU preconditioner approximates the LU decomposition as:

M = (D + L_A) D⁻¹ (D + U_A)

Where:

  • D is the diagonal matrix constructed during the factorization
  • L_A is the strictly lower triangular part of A
  • U_A is the strictly upper triangular part of A

Key Implementation Details in OpenFOAM

  1. Diagonal Calculation:
    The diagonal entries Dᵢᵢ are computed to satisfy:

    Dᵢᵢ = Aᵢᵢ - Σ_{j<i} (L_Aᵢⱼ/Dⱼⱼ) U_Aⱼᵢ
    

    This is computed in a single pass through the matrix.

  2. Forward and Backward Substitution:
    The preconditioning operation M⁻¹r involves:

    • Forward substitution: (D + L_A)y = r
    • Diagonal scaling: z = D⁻¹y
    • Backward substitution: (D + U_A)x = z
  3. Matrix Storage:
    OpenFOAM uses its compressed sparse row (CSR) format to store only the non-zero elements, making the operations memory efficient.

  4. Simplifications:

    • No fill-in is allowed (compared to ILU(k))
    • The diagonal is modified to ensure M is as close to A as possible while maintaining the triangular structure

Algorithm Pseudocode

// Preconditioner setup
for i = 1 to n:
    D[i] = A[i,i]
    for all j < i where A[i,j] ≠ 0:
        for all k < j where A[j,k] ≠ 0:
            if A[i,k] ≠ 0:
                D[i] -= A[i,j] * (1/D[j]) * A[j,k] * A[k,i]
    D[i] = 1/D[i]  // Store inverse for efficiency

// Preconditioner application (solve Mx = r)
// Forward substitution (L)y = r
for i = 1 to n:
    y[i] = r[i]
    for all j < i where A[i,j] ≠ 0:
        y[i] -= A[i,j] * y[j]
    y[i] *= D[i]  // Using precomputed inverse

// Backward substitution (U)x = y
for i = n downto 1:
    x[i] = y[i]
    for all j > i where A[i,j] ≠ 0:
        x[i] -= A[i,j] * x[j]

Practical Considerations in OpenFOAM

  1. The DILU preconditioner is particularly effective for symmetric matrices but can be used with asymmetric ones as well.

  2. It’s often used with the GAMG (Geometric Agglomerated Multi-Grid) solver or as a preconditioner for Krylov subspace methods like BiCGStab.

  3. The computational cost is O(nnz) where nnz is the number of non-zeros, making it suitable for large sparse systems.

  4. Compared to full ILU, DILU has lower memory requirements and faster setup time, at the cost of somewhat reduced effectiveness as a preconditioner.

The DILU implementation in OpenFOAM is optimized for the matrix structures typically encountered in CFD simulations, particularly those arising from finite volume discretizations.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值