From 471caa581025ab85b65dd6a5eebc6ae9a464f495 Mon Sep 17 00:00:00 2001 From: Josh May Date: Fri, 18 Aug 2023 22:20:00 -0700 Subject: [PATCH] Set cross_sections for element expansion in Material.add_element() (#2633) Co-authored-by: Paul Romano --- openmc/material.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index 95dae032e7..4ef16ab015 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -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')