From 61b1d82544fc95ce30a40f25eceffac7e17e3b07 Mon Sep 17 00:00:00 2001 From: yardasol Date: Thu, 21 Jul 2022 17:25:05 -0500 Subject: [PATCH] update test suite --- .../deplete_no_transport/test.py | 20 ++++++++++++------ ...nce.h5 => test_reference_constant_flux.h5} | Bin 35688 -> 35688 bytes .../test_reference_constant_power.h5 | Bin 0 -> 35688 bytes .../unit_tests/test_deplete_flux_operator.py | 5 +++-- 4 files changed, 17 insertions(+), 8 deletions(-) rename tests/regression_tests/deplete_no_transport/{test_reference.h5 => test_reference_constant_flux.h5} (99%) create mode 100644 tests/regression_tests/deplete_no_transport/test_reference_constant_power.h5 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 55675f9d082cd29b63a028131888b31f384f5418..1f4319b3e576dbb6ad692f8452e74c69e21c574d 100644 GIT binary patch delta 223 zcmaDcjp@ZSrVR;Q`X3+9s9ca4YnM{9?Q7>HX1fW~mg-)f;ANK-H1lfI);zlu(UO9g z06{y+-?NmH-anY!-=$dJQX0r$)hpo400ad_yX*stUYVsnh;Y7f4!pVC d;)2U92~fABLfpb(Ck=Ou=wzR69szU*0RRuxV#)vj delta 223 zcmaDcjp@ZSrVR;Q`saS-Z*A?&vNPY8=~?th(C+u|R@NWi!|hz+RK8!_Qf-&`LHDVI zoxI(*8CuCw{qH9CcPZ90fWU!N2N2b>e24v$>>HQQGN(B23O3Pij>~gSd;Bc9`@v!7 z5PwCzv(wHvN61C=CnY&MS09jY2!9&tY&~CE=BD&T=f}Y@?_@ulxkOEF6Yaay;)3p$ eUr@I=L*0@LaSMmtcerCjC;N2s2!I@d>>vP=sbQr6 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 0000000000000000000000000000000000000000..2c04addfbf4a1be16e5144fed5caad5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snmNbG*g6udKdk0`Es`d* zFT_^$@VOZnS>3h$M6$Cp`3xr}JomtuSn^k7g))(xFay(H>>G#_&<~bX$V$Z9(Nase<>)gx) z<1hPx+_*_@n<5#||=##T1&FegQx%RLo-ya|gf-2cXxqcq!_>k{~i>)_ze5xG-0{#_~i~z7P(o}Cuz%;3Yb6t_? zA~~*3{TeTmPIlmX#jgI=j&xfJQHA$?NT4H-YAQXH(G}>-RQg1!>r}F%pNsaT&DRD> z^>+7XT2pTuEvI$&J4w<2-qiaX26EEO`$zrv1*itxAJm7qeZP=C_xlraED89_B1y8z zG-dv*`;wsC693M`gAnxj2?6vI5;!0}_x@KoJqq{(1D(`2tM3CP?s5L=3&n%balfNO zd>(j=yyN0ws$-5WH$3S6+2227Tom7b|K$5_|EKwvF*_VqsP@-S{7V{O(4ka^T@?)r@jE=%Jh~ zu}%p>QKTRs2nYg#fFK|U2m*qDARq_`0)oJjAmFu+3>Rrlg7<|ekNsew)dl(gDMBCR zZD~K}mHj0U6DbG?0)l`bAP5Kof`A|(2nYg#fFK|UlpX=E=LwYsHa*1851@~IzgO|d zEYAyY&PJXOcp)h1f`A|(2nYg#fFK|U2m*q@(jidn{^4SQ`-YguenIvLOLxzuWkEm? z5CjAPK|l}?1d2hxYuz~8bKenOH$uV3C1j^F(Gm%2-5whrCS{9acx@m<}c zH8u4QHr%ZLzHD#(r-M&4p4|R*-Hp$>H+}xW)w*BV&TrYy5w^3L?fi}He3R`w$aWrP PJ2&UC6ZS!>X?Fe(f}(Zj literal 0 HcmV?d00001 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)