Added back in requirement that user must input energy and energyout bins in MG mode

This commit is contained in:
Adam Nelson 2015-11-16 20:56:07 -05:00
parent 5965e92e46
commit 640409c412
6 changed files with 68 additions and 112 deletions

View file

@ -1347,16 +1347,8 @@ The ``<tally>`` element accepts the following sub-elements:
then two energy bins will be created, one with energies between 0 and
1 MeV and the other with energies between 1 and 20 MeV.
In multi-group mode, however, the bounds of the filter are already
implied as being the same as the group boundaries of the problem.
Therefore no bins would be needed as they are implicitly applied by
the code. For example, the above filter example for continuous-energy
mode would look like the following for multi-group mode, but the
resultant tallies would still be done for every group in the library:
.. code-block:: xml
<filter type="energy" />
In multi-group mode the bins provided must match group edges
defined in the multi-group library.
:energyout:
In continuous-energy mode, this filter should be provided as a
@ -1371,16 +1363,8 @@ The ``<tally>`` element accepts the following sub-elements:
energies between 0 and 1 MeV and the other with energies between
1 and 20 MeV.
In multi-group mode, however, the bounds of the filter are already
implied as being the same as the group boundaries of the problem.
Therefore no bins would be needed as they are implicitly applied by
the code. For example, the above filter example for continuous-energy
mode would look like the following for multi-group mode, but the
resultant tallies would still be done for every group in the library:
.. code-block:: xml
<filter type="energyout" />
In multi-group mode the bins provided must match group edges
defined in the multi-group library.
:mu:
A monotonically increasing list of bounding **post-collision** cosines

View file

@ -163,10 +163,9 @@ mesh.lower_left = [-0.63, -0.63, -1.e50]
mesh.upper_right = [0.63, 0.63, 1.e50]
# Instantiate some tally Filters
# energy_filter = openmc.Filter(type='energy',
# bins=[1E-11, 0.0635E-6, 10.0E-6, 1.0E-4, 1.0E-3,
# 0.5, 1.0, 20.0])
energy_filter = openmc.Filter(type='energy')
energy_filter = openmc.Filter(type='energy',
bins=[1E-11, 0.0635E-6, 10.0E-6, 1.0E-4, 1.0E-3,
0.5, 1.0, 20.0])
mesh_filter = openmc.Filter()
mesh_filter.mesh = mesh

View file

@ -6,7 +6,7 @@
<upper_right>0.63 0.63 1e+50</upper_right>
</mesh>
<tally id="1" name="tally 1">
<filter type="energy" />
<filter bins="1e-11 6.35e-08 1e-05 0.0001 0.001 0.5 1.0 20.0" type="energy" />
<filter bins="1" type="mesh" />
<scores>flux fission nu-fission</scores>
</tally>

View file

@ -2623,25 +2623,10 @@ contains
if (temp_str == 'energy' .or. temp_str == 'energyout' .or. &
temp_str == 'mu' .or. temp_str == 'polar' .or. &
temp_str == 'azimuthal') then
! If in MG mode, fail if user provides bins, as we are only
! allowing for all groups
if (.not. run_CE .and. (temp_str == 'energy' .or. &
temp_str == 'energyout')) then
call fatal_error("No energy or energyout bins needed on tally " &
&// trim(to_str(t % id)))
else
n_words = get_arraysize_double(node_filt, "bins")
end if
n_words = get_arraysize_double(node_filt, "bins")
else
n_words = get_arraysize_integer(node_filt, "bins")
end if
else if (.not. run_CE .and. (temp_str == 'energy' .or. &
temp_str == 'energyout')) then
! For MG calculations, dont require the user to put in all the
! group boundaries, as there could be many. Assume that if no &
! bins are entered that that means they want group-wise results.
n_words = -1
else
call fatal_error("Bins not set in filter on tally " &
&// trim(to_str(t % id)))
@ -2752,48 +2737,38 @@ contains
! Set type of filter
t % filters(j) % type = FILTER_ENERGYIN
if (n_words > 0) then
! Set number of bins
t % filters(j) % n_bins = n_words - 1
! Set number of bins
t % filters(j) % n_bins = n_words - 1
! Allocate and store bins
allocate(t % filters(j) % real_bins(n_words))
call get_node_array(node_filt, "bins", t % filters(j) % real_bins)
! Allocate and store bins
allocate(t % filters(j) % real_bins(n_words))
call get_node_array(node_filt, "bins", t % filters(j) % real_bins)
if (.not. run_CE) t % energy_matches_groups = .false.
else if (n_words == -1) then
! Set number of bins
t % filters(j) % n_bins = energy_groups
! Allocate and store bins
allocate(t % filters(j) % real_bins(energy_groups))
t % filters(j) % real_bins = energy_bins
if (.not. run_CE) t % energy_matches_groups = .true.
if (.not. run_CE) then
if (n_words /= energy_groups + 1) then
t % energy_matches_groups = .false.
else if (all(t % filters(j) % real_bins == energy_bins)) then
t % energy_matches_groups = .false.
end if
end if
case ('energyout')
! Set type of filter
t % filters(j) % type = FILTER_ENERGYOUT
if (n_words > 0) then
! Set number of bins
t % filters(j) % n_bins = n_words - 1
! Set number of bins
t % filters(j) % n_bins = n_words - 1
! Allocate and store bins
allocate(t % filters(j) % real_bins(n_words))
call get_node_array(node_filt, "bins", t % filters(j) % real_bins)
! Allocate and store bins
allocate(t % filters(j) % real_bins(n_words))
call get_node_array(node_filt, "bins", t % filters(j) % real_bins)
if (.not. run_CE) t % energyout_matches_groups = .false.
else if (n_words == -1) then
! Set number of bins
t % filters(j) % n_bins = energy_groups
! Allocate and store bins
allocate(t % filters(j) % real_bins(energy_groups))
t % filters(j) % real_bins = energy_bins
if (.not. run_CE) t % energyout_matches_groups = .true.
if (.not. run_CE) then
if (n_words /= energy_groups + 1) then
t % energy_matches_groups = .false.
else if (all(t % filters(j) % real_bins == energy_bins)) then
t % energy_matches_groups = .false.
end if
end if
! Set to analog estimator

View file

@ -27,7 +27,7 @@ element tallies {
"polar" | "azimuthal" | "delayedgroup") } |
attribute type { ( "cell" | "cellborn" | "material" | "universe" |
"surface" | "distribcell" | "mesh" | "energy" | "energyout" | "mu" |
"polar" | "azimuthal" | "delayedgroup") })? &
"polar" | "azimuthal" | "delayedgroup") }) &
(element bins { list { xsd:double+ } } |
attribute bins { list { xsd:double+ } })
}* &

View file

@ -133,44 +133,42 @@
<zeroOrMore>
<element name="filter">
<interleave>
<optional>
<choice>
<element name="type">
<choice>
<value>cell</value>
<value>cellborn</value>
<value>material</value>
<value>universe</value>
<value>surface</value>
<value>distribcell</value>
<value>mesh</value>
<value>energy</value>
<value>energyout</value>
<value>mu</value>
<value>polar</value>
<value>azimuthal</value>
<value>delayedgroup</value>
</choice>
</element>
<attribute name="type">
<choice>
<value>cell</value>
<value>cellborn</value>
<value>material</value>
<value>universe</value>
<value>surface</value>
<value>distribcell</value>
<value>mesh</value>
<value>energy</value>
<value>energyout</value>
<value>mu</value>
<value>polar</value>
<value>azimuthal</value>
<value>delayedgroup</value>
</choice>
</attribute>
</choice>
</optional>
<choice>
<element name="type">
<choice>
<value>cell</value>
<value>cellborn</value>
<value>material</value>
<value>universe</value>
<value>surface</value>
<value>distribcell</value>
<value>mesh</value>
<value>energy</value>
<value>energyout</value>
<value>mu</value>
<value>polar</value>
<value>azimuthal</value>
<value>delayedgroup</value>
</choice>
</element>
<attribute name="type">
<choice>
<value>cell</value>
<value>cellborn</value>
<value>material</value>
<value>universe</value>
<value>surface</value>
<value>distribcell</value>
<value>mesh</value>
<value>energy</value>
<value>energyout</value>
<value>mu</value>
<value>polar</value>
<value>azimuthal</value>
<value>delayedgroup</value>
</choice>
</attribute>
</choice>
<choice>
<element name="bins">
<list>