Synthetic X-Ray Radiograph Generation Using Ray Tracing in COMSOL Multiphysics

Daliya Aflyatunova1, Carsten Welsch1
1The University of Liverpool
Published in 2026

X-ray imaging is widely used in nondestructive testing, industrial inspection, and medical diagnostics. Virtual radiography enables rapid evaluation of imaging configurations, object visibility, and material-dependent contrast without requiring repeated physical experiments. While Monte Carlo methods are frequently employed for detailed radiation transport simulations, and can be used for generation 2D X-ray images, they may be computationally intensive for rapid prototyping and parametric studies which are required for design radiographic imaging devices such as Digital Tomosynthesis. This work presents a physics-based framework for generating synthetic X-ray radiographs in COMSOL Multiphysics using deterministic ray tracing and Beer–Lambert attenuation.

The model was developed using the Ray Optics Module. X-rays are represented as rays emitted from a configurable source and propagated through three-dimensional geometries containing one or more materials. Material-dependent attenuation is evaluated along each ray path according to the Beer–Lambert law, allowing transmitted intensity to be calculated as a function of object thickness and attenuation coefficient. The workflow supports arbitrary geometries imported into COMSOL as well as parameterized models created directly within the software environment.

A detector plane is positioned downstream of the object and used to record transmitted ray intensities. The detector grid is used to calculate ray positions, which are stored in .txt file and used for Release from Data File to release rays in the efficient way as one ray per pixel. The Beer-Lambert Law is modelled via Optical Attenuation model "Attenuation coefficient", where the attenuation coefficient is assigned based on the material. Two methods for generation images have been tested and compared: 1) Accumulator (boundary); 2) Spot diagram. Custom postprocessing operations are employed to accumulate intensity contributions and reconstruct two-dimensional grayscale radiographic images. This approach enables direct visualization of attenuation patterns and internal structural features. Parametric studies can be performed to investigate the influence of source location, detector position, object orientation, material composition, and geometric complexity on image formation and contrast. The generated images from series of X-ray sources positions are exported and ready be processed with image reconstruction software.

The developed framework leverages COMSOL’s geometry handling, ray-tracing capabilities, and postprocessing tools to provide an integrated environment for virtual radiography. In contrast to more computationally intensive particle-transport approaches, the deterministic implementation enables rapid generation of synthetic projections suitable for design studies and sensitivity analyses. The workflow can also be readily extended to support automated parameter sweeps and integration with larger multiphysics models.

Representative simulations demonstrate successful generation of synthetic radiographs for multi-material structures and complex geometries. Figure 1 shows a simple example of the model setup and simulated image in COMSOL. The resulting images reproduce expected attenuation behavior and clearly illustrate the relationship between material distribution, path length, and detector resolution.

The presented methodology demonstrates how COMSOL Multiphysics can be used to create a flexible virtual radiography framework for engineering and imaging applications. Potential use cases include inspection planning, imaging-system prototyping, educational demonstrations, and synthetic dataset generation. Future work will focus on incorporating energy-dependent attenuation models, detector-response effects, and experimental validation against measured radiographic data.

ダウンロード