SootLib
|
Sootlib is an open-source C++ library that computes soot source terms using moment-based particle size distribution models for combustion CFD simulations.
The code is intended to be built and used on Linux-like systems, including MacOS and the Linux subsystem for Windows.
Required software:
Optional software:
SOOTLIB_BUILD_TESTS
is true)build
directorycmake ..
make
make install
The default CMake configuration should be adequate for users that do not immediately require the examples, tests, or documentation. CMake configuration options can be set by editing the top-level CMakeLists.txt
file, editing the CMakeCache.txt
file (generated in the build
directory after running CMake at least once), or specifying them on the command line during step 2 as follows:
The following project-specific CMake configuration variables can be specified by the user; their default values are also indicated.
CMake variable | Default | Description |
---|---|---|
CMAKE_INSTALL_PREFIX | top-level project directory | Installation location |
SOOTLIB_BUILD_EXAMPLES | OFF | Builds SootLib examples |
SOOTLIB_BUILD_TESTING | OFF | Builds SootLib tests; uses Catch2 |
SOOTLIB_BUILD_DOCS | OFF | Builds SootLib documentation via Doxygen |
The SootLib library consists of two main object classes that users can interact with: sootModel
and state
, both of which are contained within the soot
namespace. The state
object holds user-specified details about the current thermodynamic state in which the soot chemistry occurs, including variables such as temperature, pressure, and gas species mass fractions. The sootModel
object contains information about the selected models and mechanisms and performs the calculations that generate moment source terms. In the context of a traditional CFD simulation, the state
object would be updated via the setState
function at each individual time step and/or grid point, while the sootModel
parameters only need to be specified once when the object is created, and then its calcSourceTerms
function invoked at each step following the setState
update. The resulting moment source terms and gas species source terms can be accessed via the sootModel
object. Refer to examples/simple_example.cc
for a basic example of setting up the objects, calculating source terms, and retrieving values.
sootModel
object, specifying the desired soot chemistry and PSD mechanism.state
object.state
object with the thermodynamic conditions using the setState
function.calcSourceTerms
function, which takes a reference to a state
object as its input.sootModel
object.In the case of a temporally or spatially evolving simulation, only steps 3–5 need be performed at each individual step. SootLib does not store previously calculated values, so source terms must be retrieved at each step or otherwise lost.
Sootlib is written in C++ and includes two example codes that illustrate its use. The first example simple_example.cc
illustrates the setup and interaction with the soot variable source terms, which are the key output of the model. The second example, burner_flame.cc
integrates soot variables along the length of a flat flame burner with fixed gas variable profiles. This is a simple example that can be used to compare soot model specifications, but does not include soot diffusion, or coupling from the soot phase back to the gas phase.