mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
added lethargy_bin_width test
This commit is contained in:
parent
7ba45aaa35
commit
8c72e4b7b0
1 changed files with 8 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import math
|
||||
import numpy as np
|
||||
import openmc
|
||||
from pytest import fixture, approx
|
||||
|
|
@ -241,8 +242,14 @@ def test_first_moment(run_in_tmpdir, box_model):
|
|||
assert first_score(sph_flux_tally) == approx(flux)
|
||||
assert first_score(zernike_tally) == approx(scatter)
|
||||
|
||||
|
||||
def test_energy():
|
||||
f = openmc.EnergyFilter.from_group_structure('CCFE-709')
|
||||
assert f.bins.shape == (709, 2)
|
||||
assert len(f.values) == 710
|
||||
|
||||
def test_lethargy_bin_width():
|
||||
f = openmc.EnergyFilter.from_group_structure('VITAMIN-J-175')
|
||||
assert len(f.lethargy_bin_width) == 175
|
||||
energy_bins = openmc.mgxs.GROUP_STRUCTURES['VITAMIN-J-175']
|
||||
assert f.lethargy_bin_width[0] == math.log10(energy_bins[1]/energy_bins[0])
|
||||
assert f.lethargy_bin_width[-1] == math.log10(energy_bins[-1]/energy_bins[-2])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue