navier_stokes_2d_exact
    
    
    
      navier_stokes_2d_exact,
      a MATLAB code which
      evaluates exact solutions to the incompressible time-dependent
      Navier-Stokes equations (NSE) over an arbitrary domain in 2D.
    
    
      
        - 
          cavity: steady, polynomial in space, 
          zero velocity boundary conditions on sides and bottoms, 
          variable velocity on "top".  This is NOT the standard
          "driven cavity" example;
        
 
        - 
          exppoly: time dependent, exponential growth in time,
          zero velocity boundary conditions on unit square;
        
 
        - 
          exptrig: time dependent, trigonometric in space, exponential growth in time,
          zero velocity boundary conditions on unit square; at t=1, this flow forms a spiral.
          At later times, the exponential growth seems to make the solution physically
          absurd and computationally intractable.
        
 
        - 
          GMS: time dependent, vortices do not decay to zero;
        
 
        - 
          Lukas: steady, zero pressure;
        
 
        - 
          NoFlow: steady, zero velocity, nonzero pressure;
        
 
        - 
          Poiseuille: steady, zero vertical velocity, zero source term;
        
 
        - 
          Spiral: time dependent, zero velocity on the unit square;
        
 
        - 
          Taylor: time dependent, zero source term, solution decays exponentially.
        
 
        - 
          Vortex: steady, same velocity pattern as Taylor.
        
 
      
    
    
      Licensing:
    
 
    
      The information on this web page is distributed under the MIT license.
    
    
      Languages:
    
    
      navier_stokes_2d_exact is available in
      a C version and
      a C++ version and
      a Fortran77 version and
      a Fortran90 version and
      a MATLAB version and
      an Octave version and
      a Python version.
    
    
      Related Data and Programs:
    
    
      
      navier_stokes_2d_exact_test
    
    
      
      matlab_exact,
      a MATLAB code which 
      evaluates exact solutions to a few selected examples of
      ordinary differential equations (ODE) and partial differential
      equations (PDE).
    
    
      Reference:
    
    
      
        - 
          Jean-Luc Guermand, Peter Minev, Jie Shen,
          An overview of projection methods for incompressible flows,
          Computer methods in applied mechanics and engineering,
          Volume 105, pages 6011-6045, 2006.
         
        - 
          Xiaoli Li, Jie Shen,
          Error analysis of the SAC-MAC scheme for the Navier-Stokes equations,
          arXiv:1909.05131v1 [math.NA] 8 Sep 2019
         
        - 
          Maxim Olshanskii, Leo Rebholz,
          Application of barycenter refined meshes in linear elasticity
          and incompressible fluid dynamics,
          ETNA: Electronic Transactions in Numerical Analysis,
          Volume 38, pages 258-274, 2011.
         
        - 
          Tien-Mo Shih, C H Tan, B C Hwang,
          Effects of grid staggering on numerical schemes,
          International Journal for Numerical Methods of Fluids,
          Volume 9, Number 2, pages 193-212, February 1989.
         38, pages 258-274, 2011.
        
        - 
          Geoffrey Taylor,
          On the decay of vortices in a viscous fluid,
          Philosophical Magazine,
          Volume 46, 1923, pages 671-674.
         
        - 
          Geoffrey Taylor, Albert Green,
          Mechanism for the production of small eddies from large ones,
          Proceedings of the Royal Society of London, 
          Series A, Volume 158, 1937, pages 499-521.
         
      
    
    
      Source Code:
    
    
      
        - 
          all_cavity.m,
          evaluates all the cavity variables.
        
 
        - 
          all_exppoly.m,
          evaluates all the exppoly variables.
        
 
        - 
          all_exptrig.m,
          evaluates all the exptrig variables.
        
 
        - 
          all_gms.m,
          evaluates all the GMS variables.
        
 
        - 
          all_lukas.m,
          evaluates all the lukas variables.
        
 
        - 
          all_noflow.m,
          evaluates all the noflow variables.
        
 
        - 
          all_poiseuille.m,
          evaluates all the poiseuille variables.
        
 
        - 
          all_spiral.m,
          evaluates all the spiral variables.
        
 
        - 
          all_taylor.m,
          evaluates all the taylor variables.
        
 
        - 
          all_vortex.m,
          evaluates all the vortex variables.
        
 
        - 
          grid_2d.m, 
          returns a regular 2D grid.
        
 
        - 
          pressure_gnuplot.m, 
          writes the pressure field to files for GNUPLOT.
        
 
        - 
          r8vec_uniform_ab.m, 
          returns a scaled pseudorandom R8VEC.
        
 
        - 
          resid_c.m,
          evaluates the cavity residuals.
        
 
        - 
          resid_exppoly.m,
          evaluates the exppoly residuals.
        
 
        - 
          resid_exptrig.m,
          evaluates the exptrig residuals.
        
 
        - 
          resid_gms.m,
          evaluates the GMS residuals.
        
 
        - 
          resid_lukas.m,
          evaluates the Lukas Bystricky residuals.
        
 
        - 
          resid_noflow.m,
          evaluates the noflow residuals.
        
 
        - 
          resid_poiseuille.m,
          evaluates the Poiseuille residuals.
        
 
        - 
          resid_spiral.m,
          evaluates the spiral residuals.
        
 
        - 
          resid_taylor.m,
          evaluates the Taylor residuals.
        
 
        - 
          resid_vortex.m,
          evaluates the Vortex residuals.
        
 
        - 
          rhs_cavity.m,
          evaluates the cavity source terms.
        
 
        - 
          rhs_exppoly.m,
          evaluates the exppoly source terms.
        
 
        - 
          rhs_exptrig.m,
          evaluates the exptrig source terms.
        
 
        - 
          rhs_gms.m,
          evaluates the GMS source terms.
        
 
        - 
          rhs_lukas.m,
          evaluates the Lukas Bystricky source terms.
        
 
        - 
          rhs_noflow.m,
          evaluates the noflow source terms.
        
 
        - 
          rhs_poiseuille.m,
          evaluates the Poiseuille source terms.
        
 
        - 
          rhs_spiral.m,
          evaluates the spiral source terms.
        
 
        - 
          rhs_taylor.m,
          evaluates the Taylor source terms.
        
 
        - 
          rhs_vortex.m,
          evaluates the vortex source terms.
        
 
        - 
          uvp_cavity.m,
          evaluates the cavity flow variables.
        
 
        - 
          uvp_exppoly.m,
          evaluates the exppoly flow variables.
        
 
        - 
          uvp_exptrig.m,
          evaluates the exptrig flow variables.
        
 
        - 
          uvp_gms.m,
          evaluates the GMS flow variables.
        
 
        - 
          uvp_lukas.m,
          evaluates the Lukas Bystricky flow variables.
        
 
        - 
          uvp_noflow.m,
          evaluates the noflow flow variables.
        
 
        - 
          uvp_poiseuille.m,
          evaluates the Poiseuille flow variables.
        
 
        - 
          uvp_spiral.m,
          evaluates the spiral flow variables.
        
 
        - 
          uvp_taylor.m,
          evaluates the Taylor flow variables.
        
 
        - 
          uvp_vortex.m,
          evaluates the Vortex flow variables.
        
 
        - 
          velocity_gnuplot.m, 
          writes the velocity vector field to files for GNUPLOT.
        
 
      
    
    
    
      Last revised on 21 September 2025.