@@ -84,6 +84,10 @@ class Settings:
8484 history-based parallelism.
8585
8686 .. versionadded:: 0.12
87+ free_gas_threshold : float
88+ Energy multiplier (in units of :math:`kT`) below which the free gas
89+ scattering treatment is applied for elastic scattering. If not
90+ specified, a value of 400.0 is used.
8791 generations_per_batch : int
8892 Number of generations per batch
8993 ifp_n_generation : int
@@ -376,6 +380,7 @@ def __init__(self, **kwargs):
376380 self ._seed = None
377381 self ._stride = None
378382 self ._survival_biasing = None
383+ self ._free_gas_threshold = None
379384
380385 # Shannon entropy mesh
381386 self ._entropy_mesh = None
@@ -1255,6 +1260,17 @@ def source_rejection_fraction(self, source_rejection_fraction: float):
12551260 cv .check_less_than ('source_rejection_fraction' , source_rejection_fraction , 1 )
12561261 self ._source_rejection_fraction = source_rejection_fraction
12571262
1263+ @property
1264+ def free_gas_threshold (self ) -> float | None :
1265+ return self ._free_gas_threshold
1266+
1267+ @free_gas_threshold .setter
1268+ def free_gas_threshold (self , free_gas_threshold : float | None ):
1269+ if free_gas_threshold is not None :
1270+ cv .check_type ('free gas threshold' , free_gas_threshold , Real )
1271+ cv .check_greater_than ('free gas threshold' , free_gas_threshold , 0.0 )
1272+ self ._free_gas_threshold = free_gas_threshold
1273+
12581274 def _create_run_mode_subelement (self , root ):
12591275 elem = ET .SubElement (root , "run_mode" )
12601276 elem .text = self ._run_mode .value
@@ -1733,6 +1749,11 @@ def _create_source_rejection_fraction_subelement(self, root):
17331749 element = ET .SubElement (root , "source_rejection_fraction" )
17341750 element .text = str (self ._source_rejection_fraction )
17351751
1752+ def _create_free_gas_threshold_subelement (self , root ):
1753+ if self ._free_gas_threshold is not None :
1754+ element = ET .SubElement (root , "free_gas_threshold" )
1755+ element .text = str (self ._free_gas_threshold )
1756+
17361757 def _eigenvalue_from_xml_element (self , root ):
17371758 elem = root .find ('eigenvalue' )
17381759 if elem is not None :
@@ -2171,6 +2192,11 @@ def _source_rejection_fraction_from_xml_element(self, root):
21712192 if text is not None :
21722193 self .source_rejection_fraction = float (text )
21732194
2195+ def _free_gas_threshold_from_xml_element (self , root ):
2196+ text = get_text (root , 'free_gas_threshold' )
2197+ if text is not None :
2198+ self .free_gas_threshold = float (text )
2199+
21742200 def to_xml_element (self , mesh_memo = None ):
21752201 """Create a 'settings' element to be written to an XML file.
21762202
@@ -2241,6 +2267,7 @@ def to_xml_element(self, mesh_memo=None):
22412267 self ._create_random_ray_subelement (element , mesh_memo )
22422268 self ._create_use_decay_photons_subelement (element )
22432269 self ._create_source_rejection_fraction_subelement (element )
2270+ self ._create_free_gas_threshold_subelement (element )
22442271
22452272 # Clean the indentation in the file to be user-readable
22462273 clean_indentation (element )
@@ -2352,6 +2379,7 @@ def from_xml_element(cls, elem, meshes=None):
23522379 settings ._random_ray_from_xml_element (elem , meshes )
23532380 settings ._use_decay_photons_from_xml_element (elem )
23542381 settings ._source_rejection_fraction_from_xml_element (elem )
2382+ settings ._free_gas_threshold_from_xml_element (elem )
23552383
23562384 return settings
23572385
0 commit comments