You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

二维拉普拉斯方程有限体积法求解推导步骤疑问

Step-by-Step Derivation for Laplace's Equation in 2D Finite Volume Method

You’re off to a great start with the divergence theorem! Let’s walk through the rest of the derivation step by step, using your rectangular grid setup with uniform square control volumes.

1. Grid and Control Volume Setup

First, let’s formalize the grid to make things concrete:

  • Domain: $\Omega = [0,1] \times [0,1]$ with homogeneous Dirichlet boundary conditions ($u=0$ on $\partial\Omega$).
  • Uniform grid spacing: $h = \frac{1}{N+1}$, where $N$ is the number of interior cells in each direction.
  • Control volume $\Omega_{ij}$: Centered at $(x_i, y_j)$ where $x_i = i \cdot h$, $y_j = j \cdot h$ (for interior $i,j$ from 1 to $N$). The volume spans $x \in [x_i - h/2, x_i + h/2]$ and $y \in [y_j - h/2, y_j + h/2]$.
  • Neighboring cells: East $(i+1,j)$, West $(i-1,j)$, North $(i,j+1)$, South $(i,j-1)$.

2. Split the Boundary Integral

From the divergence theorem, we know:
$$\int_{\Omega_{ij}} \Delta u , d\Omega = \int_{\partial\Omega_{ij}} \nabla u \cdot \mathbf{n} , dS = 0$$
Since $\Delta u = 0$, the left-hand side vanishes. Now split the boundary integral into the four faces of $\Omega_{ij}$:
$$\int_{\text{East}} \nabla u \cdot \mathbf{n}e dS + \int{\text{West}} \nabla u \cdot \mathbf{n}w dS + \int{\text{North}} \nabla u \cdot \mathbf{n}n dS + \int{\text{South}} \nabla u \cdot \mathbf{n}_s dS = 0$$

3. Approximate Fluxes on Each Face

Each face has an outward normal vector, and we need to approximate the flux $\nabla u \cdot \mathbf{n}$ through it. For interior faces (not on the domain boundary), we use central differences; for boundary faces, we leverage the known Dirichlet value.

East Face ($x = x_i + h/2$)

  • Outward normal: $\mathbf{n}_e = (1,0)$, so $\nabla u \cdot \mathbf{n}_e = \frac{\partial u}{\partial x}$.
  • Approximate the derivative at the face using neighboring cell centers: $\frac{\partial u}{\partial x} \approx \frac{u_{i+1,j} - u_{i,j}}{h}$.
  • Integral over the face (length $h$): $\frac{u_{i+1,j} - u_{i,j}}{h} \cdot h = u_{i+1,j} - u_{i,j}$.

West Face ($x = x_i - h/2$)

  • Outward normal: $\mathbf{n}_w = (-1,0)$, so $\nabla u \cdot \mathbf{n}_w = -\frac{\partial u}{\partial x}$.
  • For interior $i>1$: Approximate derivative as $\frac{u_{i,j} - u_{i-1,j}}{h}$, so integral becomes $-\frac{u_{i,j} - u_{i-1,j}}{h} \cdot h = u_{i-1,j} - u_{i,j}$.
  • For boundary $i=1$ (west domain boundary, $u=0$): Derivative is $\frac{u_{1,j} - 0}{h}$, so integral becomes $-\frac{u_{1,j}}{h} \cdot h = -u_{1,j}$.

North Face ($y = y_j + h/2$)

  • Outward normal: $\mathbf{n}_n = (0,1)$, so $\nabla u \cdot \mathbf{n}_n = \frac{\partial u}{\partial y}$.
  • Approximate derivative: $\frac{u_{i,j+1} - u_{i,j}}{h}$.
  • Integral: $\frac{u_{i,j+1} - u_{i,j}}{h} \cdot h = u_{i,j+1} - u_{i,j}$.

South Face ($y = y_j - h/2$)

  • Outward normal: $\mathbf{n}_s = (0,-1)$, so $\nabla u \cdot \mathbf{n}_s = -\frac{\partial u}{\partial y}$.
  • For interior $j>1$: Approximate derivative as $\frac{u_{i,j} - u_{i,j-1}}{h}$, integral becomes $-\frac{u_{i,j} - u_{i,j-1}}{h} \cdot h = u_{i,j-1} - u_{i,j}$.
  • For boundary $j=1$ (south domain boundary, $u=0$): Integral becomes $-u_{i,j}$.

4. Assemble the Discrete Equation

Sum all four face integrals and set to zero to get the equation for $u_{i,j}$.

Interior Cells ($2 \leq i,j \leq N-1$)

Adding the four interior face integrals:
$$(u_{i+1,j} - u_{i,j}) + (u_{i-1,j} - u_{i,j}) + (u_{i,j+1} - u_{i,j}) + (u_{i,j-1} - u_{i,j}) = 0$$
Simplify to get the classic 5-point stencil:
$$u_{i,j} = \frac{1}{4}\left(u_{i+1,j} + u_{i-1,j} + u_{i,j+1} + u_{i,j-1}\right)$$

Boundary-Adjacent Cells

For cells next to one boundary (e.g., west boundary $i=1$, interior $j$):
$$(u_{2,j} - u_{1,j}) + (-u_{1,j}) + (u_{1,j+1} - u_{1,j}) + (u_{1,j-1} - u_{1,j}) = 0$$
Simplify:
$$u_{1,j} = \frac{1}{4}\left(u_{2,j} + u_{1,j+1} + u_{1,j-1}\right)$$
This is equivalent to substituting the boundary value $u=0$ for the missing west neighbor.

Corner Cells (e.g., $i=1,j=N$, north-west corner)

$$(u_{2,N} - u_{1,N}) + (-u_{1,N}) + (-u_{1,N}) + (u_{1,N-1} - u_{1,N}) = 0$$
Simplify:
$$u_{1,N} = \frac{1}{4}\left(u_{2,N} + u_{1,N-1}\right)$$

5. Final System of Equations

Collect all these discrete equations for every interior cell (including boundary-adjacent and corner cells) to form a linear system $A\mathbf{u} = 0$, where $\mathbf{u}$ is the vector of cell center values. Solving this system gives the finite volume approximation of $u$ on your grid.

内容的提问来源于stack exchange,提问作者ronalddb89

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:40:23