diff --git a/tests/regression_tests/cpp_driver/driver.cpp b/tests/regression_tests/cpp_driver/driver.cpp
index 2bc771b24..87d5ca9f5 100644
--- a/tests/regression_tests/cpp_driver/driver.cpp
+++ b/tests/regression_tests/cpp_driver/driver.cpp
@@ -1,6 +1,8 @@
#include "openmc/capi.h"
#include "openmc/cell.h"
+#include "openmc/geometry.h"
+#include "openmc/summary.h"
#include "openmc/tallies/filter.h"
#include "openmc/tallies/filter_cell.h"
#include "openmc/tallies/tally.h"
@@ -29,6 +31,17 @@ int main(int argc, char** argv) {
tally->set_filters(filters);
tally->set_scores({"flux"});
+ // set the temperature of the cell containing
+ // the lattice
+ auto& root_univ = openmc::model::universes[openmc::model::root_universe];
+ auto& lattice_cell = openmc::model::cells[root_univ->cells_[0]];
+ lattice_cell->set_temperature(300, 1, true);
+
+ // the summary file will be used to check that
+ // temperatures were set correctly so clear
+ // error output can be provided
+ openmc::write_summary();
+
openmc_run();
openmc_finalize();
return 0;
diff --git a/tests/regression_tests/cpp_driver/inputs_true.dat b/tests/regression_tests/cpp_driver/inputs_true.dat
index 4d0e90d8f..84efa6467 100644
--- a/tests/regression_tests/cpp_driver/inputs_true.dat
+++ b/tests/regression_tests/cpp_driver/inputs_true.dat
@@ -2,8 +2,22 @@
|
|
+ |
+ |
+
+ 4.0 4.0
+ 2 2
+ -4.0 -4.0
+
+1 1
+1 1
+
-
+
+
+
+
+
@@ -11,7 +25,11 @@
-
+
+
+
+
+
diff --git a/tests/regression_tests/cpp_driver/results_true.dat b/tests/regression_tests/cpp_driver/results_true.dat
index 7748cf5c0..77de290ce 100644
--- a/tests/regression_tests/cpp_driver/results_true.dat
+++ b/tests/regression_tests/cpp_driver/results_true.dat
@@ -1,7 +1,11 @@
k-combined:
-1.857752E+00 2.922425E-02
+1.934690E+00 2.593158E-02
tally 1:
-5.337194E+01
-3.209877E+02
-1.621671E+02
-2.939588E+03
+8.771138E+01
+8.618680E+02
+2.643695E+01
+7.811923E+01
+8.917373E+01
+8.880318E+02
+2.033221E+02
+4.619301E+03
diff --git a/tests/regression_tests/cpp_driver/test.py b/tests/regression_tests/cpp_driver/test.py
index a4dd8785b..42f0c2e58 100644
--- a/tests/regression_tests/cpp_driver/test.py
+++ b/tests/regression_tests/cpp_driver/test.py
@@ -4,6 +4,7 @@ import shutil
import subprocess
import textwrap
+from numpy.testing import assert_allclose
import openmc
import pytest
@@ -46,6 +47,7 @@ def cpp_driver(request):
finally:
# Remove local build directory when test is complete
shutil.rmtree('build')
+ os.remove('CMakeLists.txt')
@pytest.fixture
@@ -57,22 +59,39 @@ def model():
u235.add_nuclide('U235', 1.0, 'ao')
u235.set_density('g/cc', 11)
+ zirc = openmc.Material(name='cladding')
+ zirc.add_nuclide('Zr90', 1.0)
+ zirc.set_density('g/cc', 6.44)
+
water = openmc.Material(name="water")
water.add_nuclide('H1', 2.0, 'ao')
water.add_nuclide('O16', 1.0, 'ao')
water.set_density('g/cc', 1.0)
- mats = openmc.Materials([u235, water])
+ mats = openmc.Materials([u235, zirc, water])
model.materials = mats
# geometry
fuel_or = openmc.ZCylinder(r=1.5)
- coolant_or = openmc.ZCylinder(r=3.0, boundary_type='reflective')
+ cladding_or = openmc.ZCylinder(r=1.7)
fuel = openmc.Cell(fill=u235, region=-fuel_or)
- coolant = openmc.Cell(fill=water, region=+fuel_or & -coolant_or)
+ cladding = openmc.Cell(fill=zirc, region=+fuel_or & -cladding_or)
+ moderator = openmc.Cell(fill=water, region=+cladding_or)
- model.geometry = openmc.Geometry([fuel, coolant])
+ pincell_univ = openmc.Universe(cells=[fuel, cladding, moderator])
+
+ # lattice
+ lattice = openmc.RectLattice()
+ lattice.pitch = (4.0, 4.0)
+ lattice.lower_left = (-4.0, -4.0)
+ lattice.universes = [[pincell_univ, pincell_univ], [pincell_univ, pincell_univ]]
+ lattice_region = openmc.model.rectangular_prism(8.0,
+ 8.0,
+ boundary_type='reflective')
+ lattice_cell = openmc.Cell(fill=lattice, region=lattice_region)
+
+ model.geometry = openmc.Geometry([lattice_cell])
model.settings.particles = 100
model.settings.batches = 10
@@ -97,6 +116,22 @@ class ExternalDriverTestHarness(PyAPITestHarness):
openmc.run(openmc_exec=self.executable,
event_based=config['event'])
+ def _compare_results(self):
+ super()._compare_results()
+
+ # load the summary file
+ summary = openmc.Summary('summary.h5')
+
+ # get the summary cells
+ cells = summary.geometry.get_all_cells()
+
+ # for the 2 by 2 lattice, each cell should have 4
+ # temperature values set to 300 K
+ for cell in cells.values():
+ if isinstance(cell.fill, openmc.Material):
+ assert len(cell.temperature) == 4
+ assert_allclose(cell.temperature, 300.0)
+
def test_cpp_driver(cpp_driver, model):
harness = ExternalDriverTestHarness(cpp_driver, 'statepoint.10.h5', model)
diff --git a/tests/regression_tests/source_dlopen/test.py b/tests/regression_tests/source_dlopen/test.py
index 12969cf29..41690224d 100644
--- a/tests/regression_tests/source_dlopen/test.py
+++ b/tests/regression_tests/source_dlopen/test.py
@@ -39,6 +39,7 @@ def compile_source(request):
# Remove local build directory when test is complete
shutil.rmtree('build')
+ os.remove('CMakeLists.txt')
@pytest.fixture