diff --git a/tests/regression_tests/deplete_no_transport/test.py b/tests/regression_tests/deplete_no_transport/test.py index f82a342cf2..3a9fbe1355 100644 --- a/tests/regression_tests/deplete_no_transport/test.py +++ b/tests/regression_tests/deplete_no_transport/test.py @@ -33,8 +33,12 @@ def vol_nuc(): return (fuel.volume, nuclides) -@pytest.mark.parametrize("multiproc", [True, False]) -def test_no_transport(run_in_tmpdir, vol_nuc, multiproc): +@pytest.mark.parametrize("multiproc, normalization_mode, power, flux", [ + (True, 'constant-flux', None, 1164719970082145.0), + (False, 'constant-flux', None, 1164719970082145.0), + (True, 'constant-power', 174, None), + (False, 'constant-power', 174, None)]) +def test_no_transport_constant_flux(run_in_tmpdir, vol_nuc, multiproc): """Transport free system test suite. Runs an OpenMC transport-free depletion calculation and verifies @@ -46,22 +50,26 @@ def test_no_transport(run_in_tmpdir, vol_nuc, multiproc): micro_xs_file = Path(__file__).parents[2] / 'micro_xs_simple.csv' micro_xs = FluxDepletionOperator.create_micro_xs_from_csv(micro_xs_file) chain_file = Path(__file__).parents[2] / 'chain_simple.xml' - flux = 1164719970082145.0 # flux from pincell example op = FluxDepletionOperator.from_nuclides( - vol_nuc[0], vol_nuc[1], micro_xs, flux, chain_file) + vol_nuc[0], vol_nuc[1], micro_xs, chain_file, normalization_mode=normalization_mode) # Power and timesteps dt = [30] # single step + flux = 1164719970082145.0 # n/cm^2-s, flux from pincell example power = 174 # W/cm # Perform simulation using the predictor algorithm openmc.deplete.pool.USE_MULTIPROCESSING = multiproc openmc.deplete.PredictorIntegrator( - op, dt, power, timestep_units='d').integrate() + op, dt, power=power, flux=flux, timestep_units='d').integrate() # Get path to test and reference results path_test = op.output_dir / 'depletion_results.h5' - path_reference = Path(__file__).with_name('test_reference.h5') + if flux is None: + ref_path = 'test_reference_constant_flux.h5' + else: + ref_path = 'test_reference_constant_power.h5' + path_reference = Path(__file__).with_name(ref_path) # If updating results, do so and return if config['update']: diff --git a/tests/regression_tests/deplete_no_transport/test_reference.h5 b/tests/regression_tests/deplete_no_transport/test_reference_constant_flux.h5 similarity index 99% rename from tests/regression_tests/deplete_no_transport/test_reference.h5 rename to tests/regression_tests/deplete_no_transport/test_reference_constant_flux.h5 index 55675f9d08..1f4319b3e5 100644 Binary files a/tests/regression_tests/deplete_no_transport/test_reference.h5 and b/tests/regression_tests/deplete_no_transport/test_reference_constant_flux.h5 differ diff --git a/tests/regression_tests/deplete_no_transport/test_reference_constant_power.h5 b/tests/regression_tests/deplete_no_transport/test_reference_constant_power.h5 new file mode 100644 index 0000000000..2c04addfbf Binary files /dev/null and b/tests/regression_tests/deplete_no_transport/test_reference_constant_power.h5 differ diff --git a/tests/unit_tests/test_deplete_flux_operator.py b/tests/unit_tests/test_deplete_flux_operator.py index 3ae0984907..b7a2253983 100644 --- a/tests/unit_tests/test_deplete_flux_operator.py +++ b/tests/unit_tests/test_deplete_flux_operator.py @@ -11,7 +11,6 @@ from openmc.deplete.flux_operator import FluxDepletionOperator import pandas as pd import numpy as np -FLUX = 5e16 CHAIN_PATH = Path(__file__).parents[1] / "chain_simple.xml" ONE_GROUP_XS = Path(__file__).parents[1] / "micro_xs_simple.csv" @@ -62,6 +61,7 @@ def test_create_micro_xs_from_csv(): def test_operator_init(): """The test uses a temporary dummy chain. This file will be removed at the end of the test, and only contains a depletion_chain node.""" + volume = 1 nuclides = {'U234': 8.922411359424315e+18, 'U235': 9.98240191860822e+20, 'U238': 2.2192386373095893e+22, @@ -70,4 +70,5 @@ def test_operator_init(): 'O17': 1.7588724018066158e+19} micro_xs = FluxDepletionOperator.create_micro_xs_from_csv(ONE_GROUP_XS) nuclide_flux_operator = FluxDepletionOperator.from_nuclides( - 1, nuclides, micro_xs, FLUX_SPECTRA, CHAIN_PATH) + volume, nuclides, micro_xs, CHAIN_PATH) + nuclide_flux_operator = FluxDepletionOperator(materials, micro_xs, CHAIN_PATH)