mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Set cross_sections for element expansion in Material.add_element() (#2633)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
e8de4c18b8
commit
471caa5810
1 changed files with 7 additions and 3 deletions
|
|
@ -642,7 +642,8 @@ class Material(IDManagerMixin):
|
|||
def add_element(self, element: str, percent: float, percent_type: str = 'ao',
|
||||
enrichment: Optional[float] = None,
|
||||
enrichment_target: Optional[str] = None,
|
||||
enrichment_type: Optional[str] = None):
|
||||
enrichment_type: Optional[str] = None,
|
||||
cross_sections: Optional[str] = None):
|
||||
"""Add a natural element to the material
|
||||
|
||||
Parameters
|
||||
|
|
@ -669,6 +670,8 @@ class Material(IDManagerMixin):
|
|||
Default is: 'ao' for two-isotope enrichment; 'wo' for U enrichment
|
||||
|
||||
.. versionadded:: 0.12
|
||||
cross_sections : str, optional
|
||||
Location of cross_sections.xml file.
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
|
@ -747,7 +750,8 @@ class Material(IDManagerMixin):
|
|||
percent_type,
|
||||
enrichment,
|
||||
enrichment_target,
|
||||
enrichment_type):
|
||||
enrichment_type,
|
||||
cross_sections):
|
||||
self.add_nuclide(*nuclide)
|
||||
|
||||
def add_elements_from_formula(self, formula: str, percent_type: str = 'ao',
|
||||
|
|
@ -1457,7 +1461,7 @@ class Material(IDManagerMixin):
|
|||
if "cfg" in elem.attrib:
|
||||
cfg = elem.get("cfg")
|
||||
return Material.from_ncrystal(cfg, material_id=mat_id)
|
||||
|
||||
|
||||
mat = cls(mat_id)
|
||||
mat.name = elem.get('name')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue