I do not know if you've heard of OpenFOAM or not. It is an open source software which does not need any license and you can modify it. There are specific solvers in this software for compressible and incompressible RANS models. You can have a look to their website:
I heard about this software. I also know of many other programs that can run in that direction. I work with SolidWorks 2010 and get good results. However, my research work is required to know the deeper mathematical aspects of the Navier-Stokes equations underlying the majority of CFD-applications. I need to make the program simple case of turbulent gas flow in a circular tube by means of numerical methods (finite differences, finite volumes ...) in the Matlab software environment.
Something like this work but it is too far away from what I need)
Article: Benjamin Seibold 'A compact and fast Matlab code solving the incompressible Navier-Stokes equations on rectangular domains mit18086 navierstokes.m'
I believe you can do all these you mentioned in OpenFOAM. You can modify every thing including the solver which solves the Navier-Stokes equations. I am not sure if you can do this in MATLAB. For example, I have developed my own two-phase flow Eulerian solver in OpenFOAM.
I saw the link you shared. It seems that the code is developed for laminar flow! Is your case laminar or turbulent pipe flow?! In case of turbulent I do not know how you want to develop the code in matlab because you need turbulence models. Any way, OpenFOAM works under linux operating system. Take into consideration all these and decide which one works better for you.