mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Skip BC check for volume calculations (#2743)
This commit is contained in:
parent
079629b828
commit
b465a83806
2 changed files with 16 additions and 1 deletions
|
|
@ -81,7 +81,8 @@ void read_geometry_xml(pugi::xml_node root)
|
|||
}
|
||||
}
|
||||
|
||||
if (settings::run_mode != RunMode::PLOTTING && !boundary_exists) {
|
||||
if (settings::run_mode != RunMode::PLOTTING &&
|
||||
settings::run_mode != RunMode::VOLUME && !boundary_exists) {
|
||||
fatal_error("No boundary conditions were applied to any surfaces!");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,3 +29,17 @@ def test_invalid_id(run_in_tmpdir, cls):
|
|||
|
||||
with pytest.raises(RuntimeError):
|
||||
model.calculate_volumes()
|
||||
|
||||
|
||||
def test_no_bcs(run_in_tmpdir):
|
||||
"""Ensure that a model without boundary conditions can be used in a volume calculation"""
|
||||
model = openmc.examples.pwr_pin_cell()
|
||||
for surface in model.geometry.get_all_surfaces().values():
|
||||
surface.boundary_type = 'transmission'
|
||||
|
||||
bbox = openmc.BoundingBox([-1.]*3, [1.]*3)
|
||||
cells = list(model.geometry.get_all_cells().values())
|
||||
vc = openmc.VolumeCalculation(cells, samples=10, lower_left=bbox[0], upper_right=bbox[1])
|
||||
|
||||
model.settings.volume_calculations = [vc]
|
||||
model.calculate_volumes()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue