Skip to main content

diffusion_2d_explicit_step

Function diffusion_2d_explicit_step 

Source
pub fn diffusion_2d_explicit_step(
    u: &[f64],
    nx: usize,
    ny: usize,
    dx: f64,
    dy: f64,
    dt: f64,
    alpha: f64,
) -> Vec<f64>
Expand description

One explicit 2D diffusion step using the FTCS scheme.

Solves ∂u/∂t = α (∂²u/∂x² + ∂²u/∂y²). Boundary nodes are not updated.