How to code the 2D Navier-Stokes equations for incompressible flow without body force in Matlab or Python
Governing equation
Assume that the flow is two-dimensional, and incompressible. The governing equations are as follows:
βu/βt + uβu/βx + vβu/βy = -1/Ο βp/βx + Ξ½(β^2u/βx^2 + β^2u/βy^2)
βv/βt + uβv/βx + vβv/βy = -1/Ο βp/βy + Ξ½(β^2v/βx^2 + β^2v/βy^2)
βu/βx + βv/βy = 0
βΞΈ/βt + uβΞΈ/βx + vβΞΈ/βy = ΞΊ(β^2ΞΈ/βx^2 + β^2ΞΈ/βy^2)
Here u and v are the velocity components in the x and y directions, respectively. P denotes the pressure, Ο is the passive scalar. Ξ½ and ΞΊ are kinematic viscosity and passive-scalar diffusion coefficients, respectively. The boundary conditions are as follows.