mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Fixing rotation test.
This commit is contained in:
parent
9ffbf02f40
commit
a4fa21eea5
4 changed files with 43 additions and 37 deletions
11
tests/regression_tests/rotation/geometry.xml
Normal file
11
tests/regression_tests/rotation/geometry.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum" />
|
||||
<surface id="2" type="sphere" coeffs="1 0 0 5" />
|
||||
|
||||
<cell id="1" fill="2" rotation="10 20 30" region="-1" />
|
||||
<cell id="2" universe="2" material="1" region="-2" />
|
||||
<cell id="3" universe="2" material="2" region="2" />
|
||||
|
||||
</geometry>
|
||||
14
tests/regression_tests/rotation/materials.xml
Normal file
14
tests/regression_tests/rotation/materials.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<material id="1">
|
||||
<density value="10" units="g/cc" />
|
||||
<nuclide name="U235" ao="1.0" />
|
||||
</material>
|
||||
|
||||
<material id="2">
|
||||
<density value="0.1" units="g/cc" />
|
||||
<nuclide name="H1" ao="0.1" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
15
tests/regression_tests/rotation/settings.xml
Normal file
15
tests/regression_tests/rotation/settings.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<run_mode>eigenvalue</run_mode>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
|
|
@ -1,40 +1,6 @@
|
|||
import openmc
|
||||
import pytest
|
||||
|
||||
from tests.testing_harness import TestHarness, PyAPITestHarness
|
||||
|
||||
@pytest.fixture
|
||||
def model():
|
||||
model = openmc.model.Model()
|
||||
|
||||
fuel = openmc.Material()
|
||||
fuel.set_density('g/cc', 10.0)
|
||||
fuel.add_nuclide('U235', 1.0)
|
||||
|
||||
h1 = openmc.Material()
|
||||
h1.set_density('g/cc', 0.1)
|
||||
h1.add_nuclide('H1', 0.1)
|
||||
|
||||
outer_sphere = openmc.Sphere(r=10.0, boundary_type='vacuum')
|
||||
inner_sphere = openmc.Sphere(x0=1.0, r=5.0)
|
||||
|
||||
fuel_cell = openmc.Cell(fill=fuel, region=-inner_sphere)
|
||||
hydrogen_cell = openmc.Cell(fill=h1, region=+inner_sphere)
|
||||
univ = openmc.Universe(cells=[fuel_cell, hydrogen_cell])
|
||||
outer_cell = openmc.Cell(fill=univ, region=-outer_sphere)
|
||||
outer_cell.rotation = (10, 20, 30)
|
||||
|
||||
model.geometry = openmc.Geometry(root=[outer_cell])
|
||||
|
||||
model.settings.particles = 1000
|
||||
model.settings.inactive = 5
|
||||
model.settings.batches = 10
|
||||
source_box = openmc.stats.Box((-4., -4., -4.), (4., 4., 4.))
|
||||
model.settings.source = openmc.Source(space=source_box)
|
||||
|
||||
return model
|
||||
from tests.testing_harness import TestHarness
|
||||
|
||||
|
||||
def test_rotation(model):
|
||||
harness = PyAPITestHarness('statepoint.10.h5', model)
|
||||
def test_rotation():
|
||||
harness = TestHarness('statepoint.10.h5')
|
||||
harness.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue