# Modeling a Blackbody Spectrum in FLUKA

**URL:** <https://fluka-forum.web.cern.ch/t/modeling-a-blackbody-spectrum-in-fluka/8204>\
**Category:** Source Definition\
**Created:** [4 March 2026 21:10 UTC](https://fluka-forum.web.cern.ch/t/modeling-a-blackbody-spectrum-in-fluka/8204 "2026-03-04T21:10:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkvac](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/d/d07c76/32.png) [@dkvac](https://fluka-forum.web.cern.ch/u/dkvac)\
**Post date:** [4 March 2026 21:10 UTC](https://fluka-forum.web.cern.ch/t/modeling-a-blackbody-spectrum-in-fluka/8204/1 "2026-03-04T21:10:50Z")

</div>

### Versions

> Please provide the used software versions.

_FLUKA_: 3.4-5.2  
_Flair_:

### Description

Hello all,

I am trying to model a blackbody emitter in flair and score the photon counts on a detector. I think I’ve got the detector modeling down, but how would I model the source? Lets say I am modeling something like the sun’s emission spectrum seen at sea level, is there a way to properly do this in flair? Or do I need to write a source routine or something like that, if so, could I get some literature on that?

Here’s an image to better visualize what I mean by a blackbody spectrum emitted by the sun. I am trying to emit a large, continuous, spectrum of photons over an area.  
(This is to measure UV photons of a specific range for a senior capstone project for background on a detector)

Any help is appreciated! The attached input file is our simulated thorium source and the UV-fluorescence it causes being measured by some PMTs at varying distances, if theres any improvements I can make there let me know!

 ![image](https://fluka-forum.web.cern.ch/uploads/default/original/2X/d/d1120277037fa6886f94b28509f550b45e6aaedd.png)

> Please describe the issue. In case of reporting a bug, please provide step-by-step instructions for reproducing the error.

### Input files

> Please upload all relevant files. (FLUKA input file, Flair project file, user routines, and data files)

[ButtonTH-230.inp](https://fluka-forum.web.cern.ch/uploads/short-url/i44mhSNodxGC1nx3vH2tSokJ2dt.inp) (3.5 KB)

---

<div class="post-metadata">

**Author:** ![tlorenzo](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@tlorenzo](https://fluka-forum.web.cern.ch/u/tlorenzo)\
**Post date:** [10 March 2026 10:02 UTC](https://fluka-forum.web.cern.ch/t/modeling-a-blackbody-spectrum-in-fluka/8204/3 "2026-03-10T10:02:56Z")

</div>

Dear Daniel,

Thank you for your question.

From a conceptual viewpoint, you could write a source routine in which you set the energy of your optical photon according to the desired distribution. If you have a mathematical formulation describing the spectrum, you could use it directly for sampling. Sampling from a histogram of the same distribution would be another possible approach.

Here you will find some material to get started with source routines:

- [Source routine - FLUKA beginner course](https://indico.cern.ch/event/1498636/contributions/6486113/attachments/3067745/5427849/15_Source_routine_2025_JRC.pdf)

- [Source routines - FLUKA advanced course](https://indico.cern.ch/event/1562786/contributions/6701446/attachments/3175090/5646237/04_Source_routine_2025_Advanced_ALBA.pdf)

Regarding the physics of the simulation itself, please make sure to check the current capabilities and limitations of FLUKA for optical photons. The following material should help clarify them:

- [Optical photons - FLUKA manual](https://flukafiles.web.cern.ch/manual/chapters/optical_photons.html)

- [Optical photons - FLUKA advanced course](https://indico.cern.ch/event/1562786/contributions/6701471/attachments/3177394/5651606/11_Optical_photons_2025_Advanced_ALBA.pdf)

Hope this helps,

Tommaso

---

<div class="post-metadata">

**Author:** ![horvathd](https://fluka-forum.web.cern.ch/user_avatar/fluka-forum.web.cern.ch/horvathd/32/10584_2.png) [@horvathd](https://fluka-forum.web.cern.ch/u/horvathd)\
**Post date:** [24 March 2026 07:34 UTC](https://fluka-forum.web.cern.ch/t/modeling-a-blackbody-spectrum-in-fluka/8204/4 "2026-03-24T07:34:27Z")

</div>

Closed on 24 March 2026 07:34 UTC


