-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignoring nuclides with no xs data when writing material xml files #2800
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,12 +13,12 @@ | |||||
|
||||||
from openmc.checkvalue import check_type, check_value, check_iterable_type, PathLike | ||||||
from openmc.exceptions import DataError | ||||||
from openmc import StatePoint | ||||||
from openmc.mgxs import GROUP_STRUCTURES | ||||||
from openmc.data import REACTION_MT | ||||||
import openmc | ||||||
from .abc import change_directory | ||||||
from .chain import Chain, REACTIONS | ||||||
from .coupled_operator import _find_cross_sections | ||||||
from .coupled_operator import _find_cross_sections, _get_nuclides_with_data | ||||||
import openmc.lib | ||||||
|
||||||
|
@@ -91,7 +91,7 @@ def get_microxs_and_flux( | |||||
reactions = chain.reactions | ||||||
if not nuclides: | ||||||
cross_sections = _find_cross_sections(model) | ||||||
nuclides_with_data = _get_nuclides_with_data(cross_sections) | ||||||
nuclides_with_data = get_nuclides_with_data(cross_sections) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
nuclides = [nuc.name for nuc in chain.nuclides | ||||||
if nuc.name in nuclides_with_data] | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -15,6 +15,7 @@ | |||||
from openmc.checkvalue import check_value | ||||||
from openmc.exceptions import DataError | ||||||
from openmc.mpi import comm | ||||||
from openmc import get_nuclides_with_data | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think get_nuclides_with_data is now called _get_nuclides_with_data. Also perhaps this does not need importing as I see an abstract method in the openmc_operator file |
||||||
from .abc import TransportOperator, OperatorResult | ||||||
from .atom_number import AtomNumber | ||||||
from .reaction_rates import ReactionRates | ||||||
|
@@ -148,16 +149,12 @@ def __init__( | |||||
# for which there is an entry in the micro_xs parameter | ||||||
openmc.reset_auto_ids() | ||||||
|
||||||
self.nuclides_with_data = self._get_nuclides_with_data( | ||||||
self.cross_sections) | ||||||
self.nuclides_with_data = get_nuclides_with_data(self.cross_sections) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
# Select nuclides with data that are also in the chain | ||||||
self._burnable_nucs = [nuc.name for nuc in self.chain.nuclides | ||||||
if nuc.name in self.nuclides_with_data] | ||||||
|
||||||
# Select nuclides without data that are also in the chain | ||||||
self._decay_nucs = [nuc.name for nuc in self.chain.nuclides | ||||||
if nuc.name not in self.nuclides_with_data] | ||||||
|
||||||
self.burnable_mats, volumes, all_nuclides = self._get_burnable_mats() | ||||||
self.local_mats = _distribute(self.burnable_mats) | ||||||
|
@@ -207,10 +204,10 @@ def _get_burnable_mats(self) -> Tuple[List[str], Dict[str, float], List[str]]: | |||||
# Iterate once through the geometry to get dictionaries | ||||||
for mat in self.materials: | ||||||
for nuclide in mat.get_nuclides(): | ||||||
if nuclide in self.nuclides_with_data or self._decay_nucs: | ||||||
if nuclide in self.nuclides_with_data or self.chain.nuclides: | ||||||
model_nuclides.add(nuclide) | ||||||
else: | ||||||
msg = (f"Nuclilde {nuclide} in material {mat.id} is not " | ||||||
msg = (f"Nuclide {nuclide} in material {mat.id} is not " | ||||||
"present in the depletion chain and has no cross " | ||||||
"section data.") | ||||||
raise warn(msg) | ||||||
|
@@ -247,23 +244,6 @@ def _load_previous_results(self): | |||||
"""Load results from a previous depletion simulation""" | ||||||
pass | ||||||
|
||||||
@abstractmethod | ||||||
def _get_nuclides_with_data(self, cross_sections): | ||||||
"""Find nuclides with cross section data | ||||||
|
||||||
Parameters | ||||||
---------- | ||||||
cross_sections : str or pandas.DataFrame | ||||||
Path to continuous energy cross section library, or object | ||||||
containing one-group cross-sections. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
nuclides : set of str | ||||||
Set of nuclide names that have cross secton data | ||||||
|
||||||
""" | ||||||
|
||||||
def _extract_number(self, local_mats, volume, all_nuclides, prev_res=None): | ||||||
"""Construct AtomNumber using geometry | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.