mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Set DAGMC cell instances on surface crossing (#3052)
This commit is contained in:
parent
4bd0b09e60
commit
00faa7d698
4 changed files with 39 additions and 7 deletions
|
|
@ -557,9 +557,14 @@ void Particle::cross_surface(const Surface& surf)
|
|||
sqrtkT_last() = sqrtkT();
|
||||
// set new cell value
|
||||
lowest_coord().cell = i_cell;
|
||||
auto& cell = model::cells[i_cell];
|
||||
|
||||
cell_instance() = 0;
|
||||
material() = model::cells[i_cell]->material_[0];
|
||||
sqrtkT() = model::cells[i_cell]->sqrtkT_[0];
|
||||
if (cell->distribcell_index_ >= 0)
|
||||
cell_instance() = cell_instance_at_level(*this, n_coord() - 1);
|
||||
|
||||
material() = cell->material(cell_instance());
|
||||
sqrtkT() = cell->sqrtkT(cell_instance());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -47,9 +47,18 @@
|
|||
<run_mode>eigenvalue</run_mode>
|
||||
<particles>100</particles>
|
||||
<batches>10</batches>
|
||||
<inactive>2</inactive>
|
||||
<inactive>5</inactive>
|
||||
<output>
|
||||
<summary>false</summary>
|
||||
</output>
|
||||
</settings>
|
||||
</model>
|
||||
<tallies>
|
||||
<filter id="1" type="cellinstance">
|
||||
<bins>4 0 4 1 4 2 4 3 4 4</bins>
|
||||
</filter>
|
||||
<tally id="1" name="cell instance tally">
|
||||
<filters>1</filters>
|
||||
<scores>scatter</scores>
|
||||
</tally>
|
||||
</tallies>
|
||||
</model>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,13 @@
|
|||
k-combined:
|
||||
9.156561E-01 4.398617E-02
|
||||
9.887663E-01 1.510336E-02
|
||||
tally 1:
|
||||
4.340758E+00
|
||||
4.265459E+00
|
||||
4.712319E+00
|
||||
4.654778E+00
|
||||
4.151897E+00
|
||||
3.588090E+00
|
||||
2.965925E+00
|
||||
1.852746E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
|
|
|
|||
|
|
@ -72,13 +72,20 @@ class DAGMCUniverseTest(PyAPITestHarness):
|
|||
|
||||
self._model.geometry = openmc.Geometry([bounding_cell])
|
||||
|
||||
# add a cell instance tally
|
||||
tally = openmc.Tally(name='cell instance tally')
|
||||
# using scattering
|
||||
cell_instance_filter = openmc.CellInstanceFilter(((4, 0), (4, 1), (4, 2), (4, 3), (4, 4)))
|
||||
tally.filters = [cell_instance_filter]
|
||||
tally.scores = ['scatter']
|
||||
self._model.tallies = [tally]
|
||||
|
||||
# settings
|
||||
self._model.settings.particles = 100
|
||||
self._model.settings.batches = 10
|
||||
self._model.settings.inactive = 2
|
||||
self._model.settings.inactive = 5
|
||||
self._model.settings.output = {'summary' : False}
|
||||
|
||||
|
||||
def test_univ():
|
||||
harness = DAGMCUniverseTest('statepoint.10.h5', model=openmc.Model())
|
||||
harness.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue