mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Updating python module to enable summary file reads from DAGMC simulations. Updating legacy DAGMC test as well.
This commit is contained in:
parent
67aca58079
commit
3e93b814a9
5 changed files with 16 additions and 3 deletions
|
|
@ -123,7 +123,8 @@ class Summary:
|
|||
def _read_surfaces(self):
|
||||
for group in self._f['geometry/surfaces'].values():
|
||||
surface = openmc.Surface.from_hdf5(group)
|
||||
self._fast_surfaces[surface.id] = surface
|
||||
if surface:
|
||||
self._fast_surfaces[surface.id] = surface
|
||||
|
||||
def _read_cells(self):
|
||||
|
||||
|
|
|
|||
|
|
@ -455,7 +455,9 @@ class Surface(IDManagerMixin, ABC):
|
|||
|
||||
surface_id = int(group.name.split('/')[-1].lstrip('surface '))
|
||||
name = group['name'][()].decode() if 'name' in group else ''
|
||||
surf_type = group['type'][()].decode()
|
||||
surf_type = group['geom_type'][()].decode()
|
||||
if surf_type == 'dagmc':
|
||||
return
|
||||
bc = group['boundary_type'][()].decode()
|
||||
coeffs = group['coefficients'][...]
|
||||
kwargs = {'boundary_type': bc, 'name': name, 'surface_id': surface_id}
|
||||
|
|
|
|||
|
|
@ -694,6 +694,9 @@ class DAGMCUniverse(UniverseBase):
|
|||
def get_all_cells(self, memo=None):
|
||||
return OrderedDict()
|
||||
|
||||
def get_all_materials(self, memo=None):
|
||||
return OrderedDict()
|
||||
|
||||
def create_xml_subelement(self, xml_element, memo=None):
|
||||
|
||||
if memo and self in memo:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<geometry>
|
||||
<dagmc filename="dagmc.h5m" id="1" name="" />
|
||||
</geometry>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<materials>
|
||||
<material depletable="true" id="40" name="no-void fuel">
|
||||
<density units="g/cc" value="11" />
|
||||
|
|
@ -22,7 +26,6 @@
|
|||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
<dagmc>true</dagmc>
|
||||
</settings>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<tallies>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ def model():
|
|||
|
||||
model.settings.dagmc = True
|
||||
|
||||
# geometry
|
||||
dag_univ = openmc.DAGMCUniverse("dagmc.h5m")
|
||||
model.geometry = openmc.Geometry(root=dag_univ)
|
||||
|
||||
# tally
|
||||
tally = openmc.Tally()
|
||||
tally.scores = ['total']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue