Semtex is a 'classical' quadrilateral spectral element DNS code that uses the standard nodal GLL basis functions and (optionally) Fourier expansions in a homogeneous direction to provide three-dimensional solutions. If your problem has a natural periodic coordinate direction in 3D (a cylindrical coordinate system is perhaps the most obvious example), semtex could be a good choice. For 3D problems of this kind, the code can run in parallel using MPI to distribute jobs over a number of processes; semtex is equally at home on Unix machines from laptop to supercomputer.

The code's lineage can be traced back through Ron Henderson's prism code and ultimately to the original spectral element code nekton — in many ways the implementation is similar to prism (see Henderson & Karniadakis (1995) J Comput Phys 122: 191–217) but without mortar element patching or mesh adaptation. One noteworthy difference is that semtex supports cylindrical as well as Cartesian coordinates, and with full spectral convergence in all directions: see Blackburn & Sherwin (2004) J Comput Phys 197: 759–778 for a detailed description of the method. In addition to an incompressible Navier–Stokes solver, source is also provided for an elliptic solver that will deal with Laplace, Poisson and Helmholtz problems.

Please note that semtex is a research code and is provided 'as-is' with the understanding that it will be used mainly by other computer-literate researchers in computational fluid dynamics. It is not guaranteed to work or to provide correct results, and neither I or any employer accept any liability for detriment or loss consequent on your use of the code. Please see the terms of the Gnu General Public License (GPL) under which the code is released for public use. On the other hand, I'd be happy to hear of your experiences with using the code and your types of applications and results.

If through your use of the code you manage to obtain publishable results, I would be pleased if you could cite Blackburn & Sherwin (2004), where the numerical method is described in some depth, particular to the cylindrical-coordinate formulation.

(September 2015) Release of accompanying Dog linear flow stability analysis software package. This enables eigenmodal flow stability analysis of two-dimensional flows with either two- or three-component velocity fields which may either be steady or periodic in time. Additionally the package will compute optimal initial conditions for finite-time transient growth. See description of the method in Barkley, Blackburn & Sherwin (2008), and the user guide below.

(September 2015) Release of accompanying Scat scalar transport extension to standard Semtex DNS. Includes Bousinnesq buoyancy. See description of the method in Hartl, Blackburn & Smits (2014).


Semtex has been compiled and run on a variety of Unix systems. Consult the user guide for system requirements and compilation steps. As a minimum, your system will need C++, C and F77 (or later FORTRAN) compilers, the Gnu version of make, yacc (or bison), as well as BLAS and LAPACK libraries and their associated header files. For parallel compilation you'll need MPI libraries and headers. Most of these things are readily available on modern Unix systems. The starting point if you have difficulty compiling (after consulting the user guide) is src/Makefile — quite likely you will find a set of compiler flags for a machine similar to the one you have, and reading it may help you diagnose and fix the problem.

I'm afraid that I do not have much time to answer routine questions about making semtex compile, running examples, etc. Please consult the user guide for information on these matters. I will be happy to hear of bugs, and even better, suggestions about how to fix them, although I cannot promise to remedy problems on a timely basis (and a big thank you to those who have contributed fixes to some niggling bugs). The source code distribution is occasionally updated, however, the code is quite mature now and does not often change.

Mesh generation

Mesh generation can be a significant hurdle to new users. The source distribution provides two utilities that can be used as a starting point: rectmesh that generates semtex structured rectangular meshes and mapmesh which will map such a mesh (or any other semtex mesh) according to functions supplied on the command line. In addition there are a number of example meshes supplied in the 'mesh' subdirectory of the source distribution (most of which were generated by hand).

We supply two utilities that work with 3rd-party mesh generators, and a standalone isosurface visualisation tool.

Python script that will produce semtex session files from quad meshes generated by gmsh (open-source: see This utility is included in the current source code distribution.

Converter from Fluent Inc's gambit mesh generator to semtex session file format. Written by Erik Torres and Jörg Stiller from the ILR group at TU-Dresden. With user guides in German and English. Source code. With the deletion of gambit from the Ansys code suite, note that the Ansys workbench Fluent .msh format is the same as gambit's, albiet in binary. To get an ASCII .msh file (the starting point for gambit2semtex), set environment variable AWP_WRITE_FLUENT_MESH_ASCII=1 before using workbench.

Postprocessing and visualisation

A number of tools are distributed with the code (in the utilities directory) that will aid in postprocessing. These include tools for addition of derived fields such as vorticity and energy, data extraction on points, lines or planes, data projection/interpolation and computation of Reynolds stresses.

While the user guide shows a number of visualisations made with the commercial Tecplot code, both VisIt and Paraview should be able to read Tecplot .plt files too. One can alternatively convert output data files to VTK format, also readable by VisIt or Paraview.


Semtex release 8.2 (December 2015). This version implements the robust outflow boundary condition of Dong, Karniadakis and Chryssostomides (JCP 261, 2014) that allows stable simulation of open flows which have severely truncated outflow regions. Bugfix update to release 8.1.

Dog release 2.0 (September 2015). Linear flow stability analysis package that builds with Semtex release 8. Unpack at same level as Semtex (not within it).

Scat release 6.0 (September 2015). Extension of DNS code in Semtex to include transport of a single scalar field. Includes Boussinesq buoyancy term — check the README guide for further explanation. Builds with Semtex release 8.1. Unpack at same level as Semtex (not within it).

Semtex release 7_4 (October 2013). Spectral Vanishing Viscosity (SVV) has been added to the standard DNS code, but is inactive by default.

Semtex release 7_3 (October 2013). This version employs the "alternating skew symmetric" form of the nonlinear terms in the Navier–Stokes equations (for speed and robustness) by default (though other forms are also available), and does not employ any form of dealiasing (in the interests of simplicity for potential users of the API). Also it includes code for a variety of spatially-varying body forces, including localised damping (sponge regions) and Coriolis effects, coded by Thomas Albrecht.

Semtex final Release 6 (2013).

Gambit2semtex tarball: postprocess Gambit output to produce semtex session files.

Sview tarball: openGL-based isosurface visualisation tool, works directly with semtex mesh and field file dumps. Scriptable and/or interactive, generate TIFF output.

User guides and notes

Semtex user guide (PDF) including decription of generalised body forces, a simple introduction to using semtex to study DNS of turbulent channel flow, and some information on the API.

Dog user guide (PDF).

Slides from 2015 Crete-VI summer school (PDF).


Hugh Blackburn's home page.

Semtex-related publications.

Nektar++ spectral element code project (Spencer Sherwin and Mike Kirby).

Nek5000 spectral element code (Paul Fischer).