This repository contains the source code ucns3d Computational Fluid Dynamics (CFD) solver and instructions on how to use it with representative examples.
UCNS3D is an open-source computational solver for compressible flows on unstructured meshes. State-of-the-art high-order methods are are available in a versatile 2D and 3D unstructured CFD framework for a wide-range of compressible flow problems.
The 2022 "whitepaper" contains a detail overview of the methods, capabilities and application of the solver.
The ucns3d
solver is portable to Linux
operating systems and MacOS
(Catalina or newer) as well as on Windows 10
using Windows Subsystem for Linux (WLS-2
). The parallel CFD code employing MPI+OpenMP for distributed memory machines.
ucns3d can deal with triangular, quadrilateral,tetrahedral,pyramidal, prismatic, and hexahedral elements.
There are two main methods to locally install the solver and run the solver.
Install Docker Desktop on any operating system you are working. For Windows 10 or 11 you would need WSL ideally WSL2 installed, follow Microsoft's instructions.
In your bash terminal build the ucns3d image, you would need invoke docker build
from the repository root directory:
docker build . -t ucns3d -f Dockerfile
docker run -ti ucns3d
The current Dockerfile contains an example case under tests. Alternatively, you can mount a tmp directory and copy other uses cases when you run the image like so:
docker run -v $PWD/tmp/:/tmp/ -ti ucns3d
The source code is written in Fortran and can be compiled in various environment. The following OS options are available.
The source code requires compilation and linking both static and dynamic libraries. The source code can be compiled with the following compilers.
The solver makes use of BLAS libraries that are required for the compilation and running of the solver.
The mesh is partitioned using metis software.
Open a terminal window in the src directory
Ensure that you have selected the desirable compiling options in the Makefile, by specifying the appropriate fortran compiler (ftn, ifort etc) and ensure that you have copied the static libraries from the lib directory. Always compile with full debug options when developing something new, and then proceed to the more optimised compiler options.
For a clean installation
make -f Makefile clean all
For recompiling changed files and their dependencies
make -f Makefile
the name of the executable is ucns3d_p
.
For running ucns3d you will need the following files in a directory of your choice:
export OMP_NUM_THREADS=N
N being the number of threads to be used (use 1 for MPI only mode)
mpirun -np M ./ucns3d_p
M being the number of MPI processes (at least 2 are required), for running at different HPC systems sample scripts and libraries are provided.
The solver outputs to different formats enable post-processing and visualisation through the folowing software
Representative tests can be downloaded from
and a detailed description is provided in the file TESTS.md
The ucns3d
solver is distributed under the GNU General Public Licence v3
See the LICENSE file for details.
Please get in touch and let us know how we can make this project better ucns3d@gmail.com