Semtex is a 'classical' quadrilateral spectral element
incompressible direct numerical simulation code that uses the standard
nodal GLL basis functions to provide two-dimensional solutions and
(optionally) Fourier expansions in a homogeneous direction to provide
three-dimensional solutions. If your fluid mechanics problem is
two-dimensional or 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. One noteworthy distinction is
that semtex supports cylindrical as well as Cartesian
coordinates, and with full spectral convergence in all directions.
The user is able to include a range of distributed body forces, such
as Euler and Coriolis forces, and to include advection of a scalar. 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, as well as for a linear stability
analysis and optimal transient growth solver.
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, Lee, Albrecht and Singh
(2019), where the numerical methods and use of semtex are
described. If you also used the linear stability/optimal transient
growth solver dog, the appropriate reference
is Barkley, Blackburn & Sherwin
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. As
of semtex release 9, you can optionally use cmake to automate
the build and testing process.
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 the basics do not
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. For many investigations, a simple logically rectangular
structured mesh that you could quickly make using rectmesh and,
if required, mapmesh, might well be adequate.
In addition there are a number of example meshes/session files
supplied in the 'mesh' subdirectory of the source distribution.
We supply two utilities that work with 3rd-party mesh generators, and
a link to a 3rd-party converter for Fluent meshes.
Gmsh2sem, a python script that will
produce semtex session files from quad meshes generated
by gmsh (open-source: see
http://www.geuz.org/gmsh/). This utility is included in the
current source code distribution.
Gambit2semtex, a FORTAN-based
converter from Fluent Inc's gambit mesh generator format
to semtex session file format. Written by Erik Torres
Stiller from the ILR group at TU-Dresden, has user guides in
German and English. With the deletion of gambit from the Ansys
code suite, note that the Ansys workbench Fluent .msh format is
the same as gambit's, albeit 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.
is a python script for converting a fluent mesh (.msh) to a session
file file that can be read by semtex (alternatively also .rea
Mortensen at University of Oslo.
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.
I suggest that for simple isosurface visualisation tasks, the most
convenient and quickest way to examine 3D semtex solution files
is with the
sview utility, coded in openGL,
which works directly with semtex mesh and 3D field file dumps.
Scriptable and/or interactive, sview can also generate TIFF
current semtex release can be accessed as a git
https://gitlab.com/semtex-base/semtex. Use the "master" branch or
specific tagged releases.
Semtex release 10.1 (November 2022). As of this release, the
enumerate utility has been removed and global assembly mappings are
computed when needed, at runtime (session.num files are no longer
required). A new utility called assemble will print out the
assembly maps if you wish to examine them, or compare them to the
output of enumerate from previous releases. Please access this
release from the gitlab repository via tag
Semtex release 9.4 (January
2022). This release now additionally contains the source for
linear stability analysis code dog.
Semtex release 9.2 (December
2020). This version includes optional coupled advection of a
single scalar field, optional compilation using cmake, source
code for the user guide, Doxygen configuration, a PostScript mesh
previewer, and various minor bug fixes.
Dog release 2.1 (May
2020). Linear flow stability analysis package that builds with
semtex release 9.2 (but does not yet support cmake). Unpack at
same level as semtex (not within it).
Sview tarball: openGL-based isosurface
visualisation tool, works directly with semtex mesh and 3D
field file dumps. Scriptable and/or interactive, generate TIFF
output. This is typically the quickest way to visualise 3D solutions.
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. Note that source of this user guide is
now part of the standard base distribution - and is likely to be more
Dog user guide (PDF).
Slides (PDF) from 2015
Crete-VI summer school on global flow stability analysis.
Brief guide on how to install and
use semtex on a Linux machine (PDF). Contributed by Trevor