Skip to content

Commit

Permalink
Set cross_sections for element expansion in Material.add_element() (#…
Browse files Browse the repository at this point in the history
…2633)

Co-authored-by: Paul Romano <[email protected]>
  • Loading branch information
joshmay1 and paulromano committed Aug 19, 2023
1 parent e8de4c1 commit 471caa5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions openmc/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,8 @@ def remove_macroscopic(self, macroscopic: str):
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
Expand All @@ -669,6 +670,8 @@ def add_element(self, element: str, percent: float, percent_type: str = 'ao',
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
-----
Expand Down Expand Up @@ -747,7 +750,8 @@ def add_element(self, element: str, percent: float, percent_type: str = 'ao',
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',
Expand Down Expand Up @@ -1457,7 +1461,7 @@ def from_xml_element(cls, elem: ET.Element) -> Material:
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')

Expand Down

0 comments on commit 471caa5

Please sign in to comment.