关于《Efficient and Reliable Schemes...》中1D非线性扩散方程离散化的疑问
Let's break down how the authors derived that discrete scheme step by step—this is a standard conservative finite difference approach for diffusion equations with variable coefficients, and it's easier to follow if we unpack the continuous equation first.
Step 1: Start with the Continuous Equation
We're working with the 1D nonlinear diffusion equation:
$$\partial_tu = \partial_x\left[g \times \partial_xu\right]$$
This is a conservation-law style equation: think of it as the time rate of change of $u$ equals the divergence of a flux term $q = g \cdot \partial_x u$.
Step 2: Discretize the Time Derivative
First, we handle the left-hand side (time derivative) using a forward Euler scheme (explicit in time, since we're using values from time step $k$ to compute $k+1$):
$$\partial_t u \bigg|_i^k \approx \frac{u_i^{k+1} - u_i^k}{\tau}$$
Here, $\tau$ is the time step size, $u_i^k$ is the value of $u$ at spatial index $i$ and time step $k$.
Step 3: Discretize the Spatial Flux Divergence
The right-hand side is $\partial_x q$, where $q = g \cdot \partial_x u$. We use a central difference for the divergence, which is conservative and stable for such equations:
$$\partial_x q \bigg|i^k \approx \frac{q{i+1/2}^k - q_{i-1/2}^k}{h}$$
- $h$ is the spatial grid spacing
- $q_{i+1/2}^k$ is the flux at the midpoint between grid points $i$ and $i+1$ (same for $q_{i-1/2}^k$)
Step 4: Compute the Midpoint Flux $q_{i+1/2}^k$
Now we need to calculate $q_{i+1/2}^k = g_{i+1/2}^k \cdot (\partial_x u)_{i+1/2}^k$:
- For the diffusion coefficient $g$ at the midpoint, we use the average of neighboring grid values (this is a standard way to approximate variable coefficients at midpoints):
$$g_{i+1/2}^k = \frac{g_i^k + g_{i+1}^k}{2}$$ - For the spatial derivative $\partial_x u$ at the midpoint, we use a central difference:
$$(\partial_x u){i+1/2}^k \approx \frac{u{i+1}^k - u_i^k}{h}$$
Multiply these together to get the midpoint flux:
$$q_{i+1/2}^k = \frac{g_i^k + g_{i+1}^k}{2} \cdot \frac{u_{i+1}^k - u_i^k}{h}$$
Do the same for $q_{i-1/2}^k$ (between $i-1$ and $i$):
$$q_{i-1/2}^k = \frac{g_{i-1}^k + g_i^k}{2} \cdot \frac{u_i^k - u_{i-1}^k}{h}$$
Step 5: Combine Everything
Substitute the midpoint fluxes back into the divergence discretization:
$$\partial_x q \bigg|i^k \approx \frac{1}{h} \left( \frac{g_i^k + g{i+1}^k}{2} \cdot \frac{u_{i+1}^k - u_i^k}{h} - \frac{g_{i-1}^k + g_i^k}{2} \cdot \frac{u_i^k - u_{i-1}^k}{h} \right)$$
Simplify the denominator and rearrange terms:
$$= \frac{1}{2h^2} \left[ (g_i^k + g_{i+1}k)(u_{i+1}k - u_i^k) - (g_{i-1}^k + g_ik)(u_ik - u_{i-1}^k) \right]$$
Notice that the second term can be rewritten as:
$$- (g_{i-1}^k + g_ik)(u_ik - u_{i-1}^k) = (g_{i-1}^k + g_ik)(u_{i-1}k - u_i^k)$$
Since $\mathcal{N}(i)$ (the neighbors of $i$) are exactly $i-1$ and $i+1$, we can write this as a sum over the neighbors:
$$= \sum_{j \in \mathcal{N}(i)} \frac{g_j^k + g_ik}{2h2}(u_j^k - u_i^k)$$
Step 6: Final Discrete Scheme
Set the time derivative equal to the spatial divergence, and you get exactly the scheme from the paper:
$$\frac{u_i{k+1}-u_ik}{\tau} = \sum_{j\in \mathcal N(i)}\frac{g_jk+g_ik}{2h2}(u_jk-u_i^k)$$
The key idea here is using a conservative midpoint flux with averaged coefficients—this ensures the scheme preserves important properties like mass conservation, which is critical for diffusion problems.
内容的提问来源于stack exchange,提问作者Yola

