diff --git a/docs/source/io_formats/statepoint.rst b/docs/source/io_formats/statepoint.rst index 5f34d4700..e334f2bf1 100644 --- a/docs/source/io_formats/statepoint.rst +++ b/docs/source/io_formats/statepoint.rst @@ -201,15 +201,28 @@ if run_mode == 'k-eigenvalue': **/tallies/tally /filter /type** (*char[]*) Type of the j-th filter. Can be 'universe', 'material', 'cell', 'cellborn', - 'surface', 'mesh', 'energy', 'energyout', or 'distribcell'. + 'surface', 'mesh', 'energy', 'energyout', 'distribcell', 'mu', 'polar', + 'azimuthal', 'delayedgroup', or 'energyfunction'. **/tallies/tally /filter /n_bins** (*int*) - Number of bins for the j-th filter. + Number of bins for the j-th filter. Not present for 'energyfunction' + filters. **/tallies/tally /filter /bins** (*int[]* or *double[]*) - Value for each filter bin of this type. + Value for each filter bin of this type. Not present for 'energyfunction' + filters. + +**/tallies/tally /filter /energy** (*double[]*) + + Energy grid points for energyfunction interpolation. Only used for + 'energyfunction' filters. + +**/tallies/tally /filter /y** (*double[]*) + + Interpolant values for energyfunction interpolation. Only used for + 'energyfunction' filters. **/tallies/tally /nuclides** (*char[][]*) diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index e364452b1..d66b36aa1 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -146,6 +146,7 @@ Constructing Tallies openmc.AzimuthalFilter openmc.DistribcellFilter openmc.DelayedGroupFilter + openmc.EnergyFunctionFilter openmc.Mesh openmc.Trigger openmc.Tally diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 4a81615a1..ea407e725 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -1481,9 +1481,12 @@ The ```` element accepts the following sub-elements: *Default*: "" :filter: - Specify a filter that restricts contributions to the tally to particles - within certain regions of phase space. This element and its - attributes/sub-elements are described below. + Specify a filter that modifies tally behavior. Most tallies (e.g. ``cell``, + ``energy``, and ``material``) restrict the tally so that only particles + within certain regions of phase space contribute to the tally. Others + (e.g. ``delayedgroup`` and ``energyfunction``) can apply some other function + to the scored values. This element and its attributes/sub-elements are + described below. .. note:: You may specify zero, one, or multiple filters to apply to the tally. To @@ -1494,7 +1497,7 @@ The ```` element accepts the following sub-elements: :type: The type of the filter. Accepted options are "cell", "cellborn", "material", "universe", "energy", "energyout", "mesh", "distribcell", - and "delayedgroup". + "delayedgroup", and "energyfunction". :bins: For each filter type, the corresponding ``bins`` entry is given as @@ -1629,6 +1632,22 @@ The ```` element accepts the following sub-elements: + :energyfunction: + ``energyfunction`` filters do not use the ``bins`` entry. Instead + they use ``energy`` and ``y``. + + :energy: + ``energyfunction`` filters multiply tally scores by an arbitrary + function. The function is described by a piecewise linear-linear set of + (energy, y) values. This entry specifies the energy values. (Only used + for ``energyfunction`` filters) + + :y: + ``energyfunction`` filters multiply tally scores by an arbitrary + function. The function is described by a piecewise linear-linear set of + (energy, y) values. This entry specifies the y values. (Only used + for ``energyfunction`` filters) + :nuclides: If specified, the scores listed will be for particular nuclides, not the summation of reactions from all nuclides. The format for nuclides should be diff --git a/src/relaxng/tallies.rnc b/src/relaxng/tallies.rnc index 2143c8e47..57f5f3747 100644 --- a/src/relaxng/tallies.rnc +++ b/src/relaxng/tallies.rnc @@ -25,8 +25,8 @@ element tallies { | attribute variable { ( "nuclide_density" ) } ) & (element nuclide { xsd:string { maxLength = "12" } } - | attribute nuclide { xsd:string { maxLength = "12" } } ) | - ) + | attribute nuclide { xsd:string { maxLength = "12" } } ) + ) | (element variable { ( "temperature") } | attribute variable { ( "temperature" ) } ) ) @@ -39,14 +39,24 @@ element tallies { (element estimator { ( "analog" | "tracklength" | "collision" ) } | attribute estimator { ( "analog" | "tracklength" | "collision" ) })? & element filter { - (element type { ( "cell" | "cellborn" | "material" | "universe" | - "surface" | "distribcell" | "mesh" | "energy" | "energyout" | "mu" | - "polar" | "azimuthal" | "delayedgroup") } | - attribute type { ( "cell" | "cellborn" | "material" | "universe" | - "surface" | "distribcell" | "mesh" | "energy" | "energyout" | "mu" | - "polar" | "azimuthal" | "delayedgroup") }) & - (element bins { list { xsd:double+ } } | - attribute bins { list { xsd:double+ } }) + ( + (element type { ( "cell" | "cellborn" | "material" | "universe" | + "surface" | "distribcell" | "mesh" | "energy" | "energyout" | "mu" | + "polar" | "azimuthal" | "delayedgroup" | "energyfunction") } | + attribute type { ( "cell" | "cellborn" | "material" | "universe" | + "surface" | "distribcell" | "mesh" | "energy" | "energyout" | "mu" | + "polar" | "azimuthal" | "delayedgroup" | "energyfunction") }) & + (element bins { list { xsd:double+ } } | + attribute bins { list { xsd:double+ } }) + ) | + ( + (element type { ("energyfunction") } | + attribute type { ("energyfunction") }) & + (element energy { list { xsd:double+ } } | + attribute energy { list { xsd:double+ } }) & + (element y { list { xsd:double+ } } | + attribute y { list { xsd:double+ } }) + ) }* & element nuclides { list { xsd:string { maxLength = "12" }+ } diff --git a/src/relaxng/tallies.rng b/src/relaxng/tallies.rng index fc60b8373..fde06bac6 100644 --- a/src/relaxng/tallies.rng +++ b/src/relaxng/tallies.rng @@ -196,60 +196,106 @@ - - - - - cell - cellborn - material - universe - surface - distribcell - mesh - energy - energyout - mu - polar - azimuthal - delayedgroup - - - - - cell - cellborn - material - universe - surface - distribcell - mesh - energy - energyout - mu - polar - azimuthal - delayedgroup - - - - - - - - - - - - - - - - - - - - + + + + + + cell + cellborn + material + universe + surface + distribcell + mesh + energy + energyout + mu + polar + azimuthal + delayedgroup + energyfunction + + + + + cell + cellborn + material + universe + surface + distribcell + mesh + energy + energyout + mu + polar + azimuthal + delayedgroup + energyfunction + + + + + + + + + + + + + + + + + + + + + + + + energyfunction + + + energyfunction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +