You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will deal with the solution of the non-stationary diffusion equation with the variable
$U = U(x, y, z, t):$$∂U/∂t - div (D · grad U) = f(x, y, z, t), (x,y,z)$ belongs $Ω = [0; 1]^3$, t on the $[0, T]$
$U(x, y, z, t) = g(x, y, z)$ on the edge of the region $∂Ω$
$U(x, y, z, 0) = 0$ at the initial time
We define the final moment of time as $T = 1$
In the problem, we will use the diagonal tensor $D:$
$f(x, y, z) = (d_x+d_y+d_z)·π²·sin(πx)sin(πy)sin(πz)$
This equation has analytic solution:
$U_analityc = sin(πx)sin(πy)sin(πz)·(1 - exp(-(d_x+d_y+d_z)·π²·t))$
Sampling
Building a parallelepiped discretization of our region.
Set $Nx, Ny, Nz > 1$ - the number of nodes that will fit along the axis $Ox, Oy and Oz$, respectively.
Then we define the grid step $Δx = \frac{1}{(Nx-1)}, Δy = \frac{1}{(Ny-1)}, Δz = \frac{1}{(Nz-1)}. $
Also, define the time step $Δt$.
Define $V_{ijk}$ node of grid with coordinates $x_i = i·Δx, y_j = j·Δy, z_k = k·Δz.$
We will describe the discrete function $[U]^h$ at the time $nΔt$ by its degrees of freedom, which we will place at the nodes of the grid, and the degree of freedom at the node V_ijk will be denoted as
$U_{ijk}^n, 0 ⩽ i ⩽ Nx-1, 0 ⩽ j ⩽ Ny-1, 0 ⩽ k ⩽ Nz-1.$
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: