We considered the Navier Stokes equations, used to model the mechanics of fluids, whose numerical solution is universally believed to be a serious and difficult task. For sake of simplicity, we decided to focus on planar, stationary and incompressible fluid motions disregarding turbulence.

We worked out some Scilab functions which opportunely called allowed us to solve three different benchmarks proposed very often in literature to test solvers. The agreement between the obtained results and the reference solutions is always very good, showing the reliability of our solver.

For the model set-up (geometry, construction, meshing, managing boundary conditions, etc…) we used gmsh (, another useful open source software.

Nonlinear system to solve:



  • benchmark_nonlinear_system1 is the diffusivity contribution, a (6 x 6) symmetric matrix
    The matrix Q(2 x 6) collects the first derivatives in the two directions of the quadratic
    shape functions.
  • benchmark_nonlinear_system2 is the convective non-linear contribution, a (6 x 6) unsymmetric matrix. The vector N collects the quadratic shape functions.
  • benchmark_nonlinear_system3 is the pressure contribution, a (6 x 3) matrix. The vector L collects the first derivatives of the linear shape functions in the specified direction.
  • benchmark_nonlinear_system4 is the term coming from the incompressibility condition, a (3 x 6) matrix. The vector M collects the linear shape functions while Q collects the first derivatives of the quadratic shape functions in the specified direction.





The six-noded finite element used to discretize the fluid domain. The velocity field is modeled using quadratic shape functions and two unknowns at each black node are considered (Vx and Vy), while the pressure (P) is modeled using linear shape functions and only three unknowns are used at the corner nodes (the red ones).


1. Benchmark computations of a laminar flow around a cylinder

2. Cavity flow problem

3. Thermo-fluid simulation of an heat exchanger