We will deal with the solution of the non-stationary diffusion equation with the variable
We define the final moment of time as
In the problem, we will use the diagonal tensor
где
Also set:
Building a parallelepiped discretization of our region.
Set
We will describe the discrete function
We discretize our equation in space by the finite difference method, and in time by the explicit Euler scheme.
Note that for such a discretization, the time step must satisfy the Courant condition:
Introduce discrete operators of the second spatial derivatives:
Also, let
Then we have the following numerical scheme: $U_{ijk}^{(n+1)} = U_{ijk}^n + Δt·(f_{ijk}^n + d_x·Lx_{ijk} U^n + d_y·Ly_{ijk} U^n + d_z·Lz_{ijk} U^n),
if
1 ⩽ i ⩽ Nx-2, 1 ⩽ j ⩽ Ny-2, 1 ⩽ k ⩽ Nz-2$
- Choose clip and cut