Skip to content

Commit

Permalink
fix #7257 Source "From File" now uses openmc.FileSource() class (#7437)
Browse files Browse the repository at this point in the history
  • Loading branch information
moellep authored Jan 31, 2025
1 parent c8565c1 commit 03d5252
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sirepo/package_data/static/js/openmc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2644,7 +2644,7 @@ SIREPO.app.directive('sourcesOrTalliesEditor', function(appState, panelState) {
$scope.description = m => {
if (childModel === 'source') {
return m.type === 'file' && m.file
? `File(filename=${m.file })`
? `FileSource(${m.file })`
: sourceInfo('SpatialDistribution', m.space);
}
return tallyInfo(m);
Expand Down
3 changes: 1 addition & 2 deletions sirepo/template/openmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pykern.pkcollections import PKDict
from pykern.pkdebug import pkdc, pkdp, pkdlog, pkdexc
from sirepo import simulation_db
from sirepo import util
from sirepo.template import template_common
import CAD_to_OpenMC.assembly
import gzip
Expand Down Expand Up @@ -785,7 +784,7 @@ def _generate_save_weight_windows(data):

def _generate_source(source, qcall):
if source.get("type") == "file" and source.get("file"):
return f"openmc.IndependentSource(filename=\"{_SIM_DATA.lib_file_name_with_model_field('source', 'file', source.file)}\")"
return f"openmc.FileSource(\"{_SIM_DATA.lib_file_name_with_model_field('source', 'file', source.file)}\")"
if source.space._type == "box":
# TODO(pjm): move only_fissionable outside of box
c = f"{{'fissionable': {source.space.only_fissionable == '1'}}}"
Expand Down

0 comments on commit 03d5252

Please sign in to comment.