htrdr The Monte-Carlo radiative transfer simulator

htrdr 0.8.1 is available

htrdr evaluates the intensity at any position (probe) of the scene, in any direction, in the presence of surfaces and an absorbing and diffusing semi-transparent medium, for both longwave radiation sources (internal to the medium) and shortwave radiation sources (external to the medium). The intensity is calculated using the Monte-Carlo method: a number of optical paths are simulated backward, from the probe position and into the medium. Various algorithms are used, depending on the specificities of the nature and shape of the radiation source.

Related articles

Applications are theoretically possible to any configuration. However, it all eventually comes down to the possibility of using the physical data of interest, in their most common formats, in each scientific community. htrdr is currently suitable for two main application fields:

  1. Atmospheric radiative transfer: the clear-sky atmosphere is vertically stratified, cloud thermodynamic data is provided on a regular 3D rectangular grid, and surface optical properties can be provided for an arbitrary number of materials. Internal radiation and solar radiation are taken into account.

  2. Combustion processes: thermodynamic data is provided at the nodes of an unstructured tetrahedral mesh, while surface properties can still be provided for various materials. The radiation source is only external: a monochromatic laser sheet illuminates the inside of the combustion chamber for diagnostic purposes.

Since any observable radiative transfer is expressed as an integral of the intensity, and since there is a strict equivalence between the integral to be solved and the underlying Monte-Carlo algorithm (each integral results in the sampling of a random variable), the algorithms that calculate the radiance are used for computing various quantities:

Rendering of a 4D cloud field produced by the Meso-NH (Lafore et al 1998, Lac et al 2018) Large Eddy model. Each frame was rendered with htrdr-atmosphere using 4096 samples per pixel component. The resulting images are then postprocessed with the htpp program. Refer to the video for a complete description of how it was produced.

Related projects

CLEMENT
Image rendered with htrdr-atmosphere of a 10003 cloud field produced by the Meso-NH (Lafore et al 1998, Lac et al 2018) Large Eddy Model. The initial conditions and model set-up for the simulation are described in Strauss et al. (2019).

htrdr is currently used, developped and extended in the following research projects.

A straight interface

CLEMENT_lw
Infrared rendering in [9, 10] micrometers of the 5003 cloud field of Strauss et al. (2019). The color map displays the brightness temperature in Kelvin.

htrdr is a command-line tool that performs computations on input data, writes the rendered image and nothing more. No assumption is made on how input data are created excepted that they have to follow the expected file formats. In the same spirit, the output image is written in plain text, as a list of raw pixel estimations, making easier the processing of its data.

This thin interface is, by nature, particularly well suited to be extended and integrated into any workflow. For instance, one can save the cloud properties used by htrdr-atmosphere directly in the htcp file format or use the les2htcp tool to convert cloud properties from NetCDF to htcp. In the same way, the output image can be post-treated through gnuplot or converted in a regular PPM image by the htpp program, and then visualised in an image viewer as for instance feh or display.

Quick start

anim_laser_sheet
anim_laser_sheet_pview
This animation (left) simulates a scanning of a combustion medium by the laser sheet that emits from the left part of the medium, and propagates to the right. Each frame is computed by htrdr-combustion for a different position of the laser sheet, that subsequently intersects with different zones of the medium. Each image represents what is perceived by the camera for this particular position of the laser. The configuration used for this simulation is the one retained for the validation of the algorithm (the corresponding data set is provided in the starter-pack for combustion processes): as shown in the representation of the medium data (right), the volumic fraction of soot follows an axisymmetric profile, with the main axis centered in the cubic chamber, and a maximum at the back.

No pre-compiled version of htrdr is provided; it must be compiled directly from its source tree. A simple way is to rely on the htrdr branch of the Star-Engine project: it provides CMake scripts that automate the download, the compilation and the installation of htrdr and its dependencies. This build procedure assumes the following prerequisites:

Build

Assuming that the aforementioned prerequisites are available, the build procedure is summed up to:

~ $ git clone -b htrdr-0.8.1 \
  https://gitlab.com/meso-star/star-engine.git htrdr-0.8.1
~ $ mkdir htrdr-0.8.1/build
~ $ cd htrdr-0.8.1/build
~/htrdr-0.8.1/build $ cmake ../cmake
~/htrdr-0.8.1/build $ make

Tune the build

By default, the whole htrdr project is built but you may prefer to deploy htrdr only for a specific application, i.e. only for atmospheric radiative transfer or combustion processes. In this case, only activate the desired application during the CMake configuration step. For example, to install only the atmospheric part of htrdr:

~ $ git clone -b htrdr-0.8.1 \
  https://gitlab.com/meso-star/star-engine.git htrdr-0.8.1
~ $ mkdir htrdr-0.8.1/build
~ $ cd htrdr-0.8.1/build
~/htrdr-0.8.1/build $ cmake ../cmake \
  -DHTRDR_BUILD_ATMOSPHERE=On \
  -DHTRDR_BUILD_COMBUSTION=Off
~/htrdr-0.8.1/build $ make

Visit the Star-Engine git repository of htrdr for a complete description of the build process and available options.

~ $ source ~/htrdr-0.8.1/local/etc/htrdr.profile
~ $ htrdr --help
downward_flux_sw
downward_flux_lw
Shortwave (left) and longwave (right) downward flux density maps in W/m2 computed by htrdr-atmosphere at 1 meter height with the DZVAR cloud field. The shortwave and longwave spectral integration ranges are [0.38, 4] micrometers and [4, 100] micrometers, respectively. Their spatially-avaraged flux is 879.349 W/m2 in shortwave and 425.159 W/m2 in longwave. In both cases, the spatial position is the sub-solar point, meaning that the sun is located at the zenith. In the shortwave map we observe the contrast between the shadows of the clouds and fully illuminated areas. In longwave, we can see the effect of clouds (higher values, due to the emission by the base of the cloud at higher temperatures than for a clear-sky zone) and also a "ripple" effect that is due to the spatial variations of water vapor concentration, as provided by the LES simulation.

Run

By default htrdr is installed in the local subdirectory of htrdr-0.8.1. Source the provided htrdr.profile file to register htrdr against the current shell.

If the AsciiDoc tool suite was installed on make invocation, the reference documentation of the htrdr program and its associated file formats should be available through man pages. Use the man command-line to consult them. For example:

~ $ man htrdr
~ $ man htrdr-atmosphere
~ $ man htrdr-combustion

Refer to the Starter Packs to quickly run a htrdr rendering; these archives provide input data and scripts that are good starting points to use htrdr.

Package

Once built, the htrdr installation can be packaged in an archive that can then be deployed on compatible systems, i.e. systems whose C library, NetCDF library and MPI implementation are compatibles with the ones available on the system used to build htrdr.

~/htrdr-0.8.1/build $ make pkg
~/htrdr-0.8.1/build $ ls package/htrdr-0.8.1*

Release notes

Version 0.8.1

Sets the required version of Star-SampPling to 0.12. This version fixes compilation errors with gcc 11 but introduces API breaks.

Version 0.8

Version 0.7

Adds the simulation of radiative transfer in combustion media

The new htrdr-combustion command performs radiative transfer computations in a scene representing a semi-transparent medium enlightened by a laser sheet. It uses Monte-Carlo to calculate a monochromatic image of the medium or the radiative flux density. Both computations are performed in the visible at a given frequency.

The medium data are defined on the vertices of an unstructured tetrahedral mesh that may be surrounded by a triangular surface mesh representing the inner limits of the combustion chamber.

Updates the htrdr command

The previous htrdr command is renamed to htrdr-atmosphere. htrdr becomes a proxy for the htrdr-atmosphere command or the htrdr-combustion command: calling htrdr with the <atmosphere|combustion> options is equivalent to directly calling the htrdr-<atmosphere|combustion> commands.

Miscellaneous

Version 0.6.1

Version 0.6

New features

Fix

Version 0.5.1

Version 0.5

New feature

Add support of shortwave integration with respect to the Planck function for a reference temperature whose default value is the blackbody temperature of the sun. Actually this is the counterpart of the longwave integration introduced by the "infrared rendering" in the 0.4 version. The main difference is that the source of radiation is the sun rather than the medium and its boundaries.

The option -l that enabled the infrared rendering is now replaced by the new -s option that controls the spectral integration that can be CIE XYZ (i.e. regular image rendering), longwave or shortwave.

Fixes

Version 0.4

New features

Fixes

Version 0.3

Version 0.2

Version 0.1

Version 0.0.4

Version 0.0.3

Copyright notice

Copyright © 2018, 2019, 2020, 2021 |Meso|Star>.
Copyright © 2018, 2019, 2021 CNRS.
Copyright © 2018, 2019 Université Paul Sabatier.

License

htrdr is free software released under the GPL v3+ license: GNU GPL version 3 or later. You are welcome to redistribute it under certain conditions; refer to the COPYING file for details.