Particle Sources
Any Blender object can be defined as a particle source, even if it is not a mesh object. To enable a particle source for an object, the Source flag must be enabled in the Object > Source Properties:
Once enabled, the sampling region and direction of sources are displayed in red within the 3D viewport:
The source can be configured using a variety of options, which are described in this section. The first two parameters to define are:
-
Histories
Sets the number of histories to be simulated. In penRed, a history has the same meaning as in PENELOPE: it represents a primary particle generated by the source. For example, if the user sets one million histories for an electron source, one million electrons will be sampled by the source, according to the specified parameters, and simulated through the geometry system. Along with the primary particle, all descendant particles produced will also be simulated. -
Type
Specifies whether all sampled particles are of a specific type (e.g., Gammas, Electrons, or Positrons) or if a Phase Space File (PSF) will be used to read the particles states. A PSF includes the type, energy, position, and direction information for each particle to be simulated. This PSF files can be created using a PSF tally.
Generic Particle Sampling
If no PSF is used, the methods to sample the particle state must be specified. These include sampling its energy, position, direction, and time (if needed).
Spatial
These parameters define how the initial particle locations are sampled. The available options are:
Point
The particle location is set to the center of the object's bounding box.Box
The particle location is sampled uniformly inside the object's bounding box.-
Cylinder
The particle location is sampled uniformly inside a cylinder shape oriented along the Z-axis. The cylinder size can be defined in two ways:-
Fit inside the bounding box: Enable the
Inside Bounding Box
option to constrain the cylinder within the object's bounding box. The radius is set as:\[ r = min\left(dx, dy\right)/2 \]where \( dx \), and \( dy \) are the bounding box dimensions along the X, and Y axes, respectively.
-
Enclose the bounding box: Disable the
Inside Bounding Box
option to ensure the cylinder fully encloses the bounding box. In this case, the cylinder radius is calculated as:\[ r = \sqrt{\left(\frac{dx}{2}\right)^2 + \left(\frac{dy}{2}\right)^2} \]where \( dx \) and \( dy \) are the bounding box dimensions along the X and Y axes, respectively.
-
Energy
The plugin offers two methods to sample the initial particle energy, which can be selected using the Type parameter:
-
Monoenergetic
All particles are set with the specified energy, in eV. -
Spectrum
The particle energy is randomly sampled following a spectrum defined in the specified file. This file must be accessible when the simulation is executed.
The format consists of a piecewise function where each entry in the spectrum contains two numbers: - The first number specifies the starting energy of a channel. - The second number specifies its unnormalized probability.
The probabilities must be non-negative and do not need to be normalized to unity. PenRed interprets a negative probability as the end of the spectrum. For example, a valid spectrum format is shown below, where the character #
is interpreted as a comment. Note that the spectrum file must contain only comments or valid spectrum values until the end of the spectrum. Blank lines are not allowed, but all text beyond the end of the spectrum is ignored by the sampler.
#Spectrum (character '#' is interpreted as a comment)
1.20e3 10 1st channel: [1.20,1.61]keV
1.61e3 0.0 2nd channel: [1.61,5.00]keV, no emissions
5.00e3 20 monoenergetic line at 5.00 keV
5.00e3 0 3rd channel: [5.00,6.24]keV, no emissions
6.24e3 33.3 4th channel: [6.24,7.32]keV
7.32e3 5.02 5th channel: [7.32,8.00]keV
8.00e3 10.2 6th channel: [8.00,9.76]keV
9.76e3 15.2 7th channel: [9.76,10.0]keV
10.0e3 0.0 8th channel: [10.0,15.0]keV, no emissions
15.0e3 20 monoenergetic line at 15.0 keV
15.0e3 -1 end of the spectrum
Direction
Currently, the only direction sampling method consists of a cone following a specified direction vector. The parameters to define it are:
-
Direction
A 3D vector representing the direction of the cone. This will be visualized in the Blender 3D layout as an arrow. -
Aperture
The aperture of the cone, in degrees. This value must be in the interval[0, 180]
. If set to180
, the source will be isotropic.
Time
If the recording time is enabled, the simulation will calculate and increase the age of each particle produced by this source, as well as the corresponding secondary particles. Additionally, the initial time of each particle can be configured as follows:
-
No initialization
The initial time of all particles is set to0
. -
Decay
The initial time of each produced particle is randomly sampled according to an isotope decay. The following parameters must be provided to characterize the decay: Half life
: The half-life, in seconds, of the isotope.Time Window
: A two-dimensional array specifying the minimum and maximum time, in seconds (first and second positions), to sample.
Depending on the time window and the number of histories simulated, the total activity of the source can be calculated.
PSF
A PSF already contains all the particle states to be simulated, so it is not necessary to sample those states. Therefore, sampling methods are not required to be configured. However, the PSF filename must be provided using the PSF parameter. This file must be accessible when the simulation is executed. Additionally, to avoid reading the entire PSF file (which can be several GB in size), the Maximum Energy of all stored states must be provided in eV. This energy is used to create the tables with the physical properties of each material.
To increase simulation efficiency, splitting and Russian roulette can be applied to the read states. The behavior of these variance reduction techniques is controlled by the following parameters:
-
Factor
This integer value specifies how many particles a single read state will be split into. Each split state will be assigned a reduced weight (\(weight / Factor\)). The same factor is also used to determine the probability of skipping (killing) a read state. If the state survives, its weight will be increased accordingly. Note that these techniques are not applied to all states. Whether one or both techniques are applied depends on the Weight Window. -
Weight Window
This two-dimensional array defines a weight window to determine which variance reduction technique to apply to each state. The user must provide a Minimum (first position) and a Maximum (second position) weight value to define the window:- Weight \(<\) Minimum: Russian Roulette will be applied to the read state.
- Minimum \(\leq\) Weight \(\leq\) Maximum: No technique will be applied to the read state.
- Weight \(>\) Maximum: Splitting will be applied to the read state.
Finally, like the specific particle type sources, the time recording can be enabled, but the initial times are read from the PSF, not sampled.
CT
A CT-like source moves a generic or PSF source position along a circle defined in the XY plane while rotating the particle direction according to the angular position, as shown in the following figure:
Since this source doesn't sample particles directly, it requires either a generic or PSF source as its complement. The transformations applied to sampled particles occur in the following order:
- The particle is initially sampled using either a generic or PSF source
- A translation of (r, 0, 0) is applied to the particle position, where r is the configured CT radius
- A projection is selected, setting the particle age, and the particle is rotated accordingly
Important Notes: This kind of source can only be used on Blender empty objects, not mesh based objects. To ensure particles are aimed toward the CT center, the sampled particles' initial direction must point along the -X axis.
The behavior of the CT-like source is controlled by these parameters:
-
Enable
Enable or disable CT-like source. -
Radius
Define the CT radius in cm. -
Rotation Interval
Sets the minimum and maximum rotation angles, in degrees. -
Projections
Specify the number of angular positions (projections) where particles will be placed around the circle. -
Start Time
Initial age, in seconds, assigned to particles sampled in the first projection. -
Projection Time
Time interval between consecutive projections, in seconds. -
Secondaries to sample
This parameter is only available if combined with generic sources. Specify how many particles will be sampled per history. -
PSF Origin
This parameter is only available if combined with PSF sources. Specify the original recording position of the PSF, required for proper transformation calculations.