RadLib
Loading...
Searching...
No Matches
RadLib

Overview

Radlib is an open-source library for computing radiation properties for gases and soot in so-called participating media. The radiation properties computed currently include the absorption coefficient \(\kappa_j\) and weight factors \(a_j\) for use in global models for solution of the radiative transport equation:

\[\frac{dI_j}{ds} = \kappa_jI_j - \kappa_ja_jI_b,\]

where \(I_j\) is the intensity of the \(j^{th}\) gas, and \(s\) is a path length. Three models are implemented:

  1. The Planck Mean (PM) model.
  2. The Weighted Sum of Gray Gases (WSGG) model,
  3. The Rank Correlated Spectral Line Weighted Sum of Gray Gases (RCSLW) model, These models increase in computational cost and complexity and are summarized below.

A common application of radiative heat transfer in participating media is combustion in flames and fires. Combustion is a complex process with many physical phenomena. Understanding and implementing the various physical processes is a challenge, and having access to open-source, documented code libraries to facilitate modeling of these process is important. In particular, the relatively new RCSLW model is accurate, but somewhat complex and time consuming to implement and verify. This library provides straightforward access to this model and others.

Examples

Radlib is written in C++ and includes a Python interface written in Cython and a Fortran interface. Examples are provided of heat flux and/or volumetric heat source in one-dimensional configurations. A one-dimensional solver based on ray tracing is used in these configurations. Seven examples from three papers are provided with the code and these can be run using the Jupyter notebook run_and_plot_examples.ipynb included in the examples/python folder. These examples include comparison to line-by-line data from the corresponding references and the implemented codes have been validated against these references. The examples are described in run_and_plot_examples.ipynb. In addition, a simple interface code is provided in C++, Python, and Fortran to demonstrate initializing the library and calling it for a given gas state.

Models

Planck Mean

The Planck Mean model is a simple model consisting of curve fits to temperature of absorption coefficients for CH4, CO2, CO, H2O, and soot. These are combined to a single absorption coefficient for a single gas (with \(a=1\)). The model is commonly applied to combustion problems because if its simplicity and low computational cost, but it is inaccurate unless applied to optically thin gases with relatively small radiative losses.

WSGG

There are a number of WSGG models that have been published. A particularly attractive version is that by Bordbar et al. (2020) [2], which is an extension of an earlier paper by Bordbar et al. (2014) [1]. This model uses four gray and one clear gas, accounts for arbitrary compositions of CO2 and H2O. The model was extended here to include soot (under Bordbar's guidanance) by adding a single mean soot absorption coefficient to each of the \(\kappa_j\) and leaving the \(a_j\) unchanged. Example ex_Sb1 demonstrates the accuracy of the model with soot.

RCSLW

The RCSLW model is an implementation of the model published by Solovjov et al. (2017) [3]. This is a highly accurate model that improves on the SLW model by relaxing the need of a reference gas. The model can accommodate an arbitrary number of gases and treats arbitrary compositions of CO2, H2O, CO, and soot.

Required software, building, and installing the library

The code is intended to be built on Linux and MacOS systems, (or the Linux subsystem for Windows). The build directory includes a readme file that describes the build and installation process. Required software includes:

  • CMake and a C++ compiler,
  • Doxygen and graphviz to build the (optional) documentation,
  • Python 3 and Cython to build the (optional) Python interface,
  • A Fortran (Fortran 90 or above) compiler to build the (optional) Fortran interface,
  • Matplotlib, Numpy, and Jupyter (optional) to run the Python examples.

To build the code, the user creates and enters a top-level build directory, then runs

cmake ..
make
make install

The top-level CMakeLists.txt file has build options that can be set at the top of the file. These options can also be set at the command line, for instance

cmake -DBUILD_PYTHON_INTERFACE=OFF ..

The default installation directory is radlib/installed, but this can be changed through the CMAKE_INSTALL_PREFIX variable.

To run the python interface, the PYTHONPATH environment variable needs to be updated to include the Python module location. This is detailed upon successful installation of the code, for instance:

export PYTHONPATH="/home/user/codes/radlib/installed/lib/python3.8/site-packages:$PYTHONPATH"

Code Ocean Capsule

A Code Ocean capsule is available that provides a fully executable version of the code.

Video

A Youtube video is provided that demonstrates downloading, installing, and running the examples.