Skip to content

Commit 03d5252

Browse files
authored
fix #7257 Source "From File" now uses openmc.FileSource() class (#7437)
1 parent c8565c1 commit 03d5252

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

sirepo/package_data/static/js/openmc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2644,7 +2644,7 @@ SIREPO.app.directive('sourcesOrTalliesEditor', function(appState, panelState) {
26442644
$scope.description = m => {
26452645
if (childModel === 'source') {
26462646
return m.type === 'file' && m.file
2647-
? `File(filename=${m.file })`
2647+
? `FileSource(${m.file })`
26482648
: sourceInfo('SpatialDistribution', m.space);
26492649
}
26502650
return tallyInfo(m);

sirepo/template/openmc.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from pykern.pkcollections import PKDict
1010
from pykern.pkdebug import pkdc, pkdp, pkdlog, pkdexc
1111
from sirepo import simulation_db
12-
from sirepo import util
1312
from sirepo.template import template_common
1413
import CAD_to_OpenMC.assembly
1514
import gzip
@@ -785,7 +784,7 @@ def _generate_save_weight_windows(data):
785784

786785
def _generate_source(source, qcall):
787786
if source.get("type") == "file" and source.get("file"):
788-
return f"openmc.IndependentSource(filename=\"{_SIM_DATA.lib_file_name_with_model_field('source', 'file', source.file)}\")"
787+
return f"openmc.FileSource(\"{_SIM_DATA.lib_file_name_with_model_field('source', 'file', source.file)}\")"
789788
if source.space._type == "box":
790789
# TODO(pjm): move only_fissionable outside of box
791790
c = f"{{'fissionable': {source.space.only_fissionable == '1'}}}"

0 commit comments

Comments
 (0)