Skip to content

Fourier expansion#3899

Draft
tjlaboss wants to merge 14 commits intoopenmc-dev:developfrom
tjlaboss:fourier-expansion
Draft

Fourier expansion#3899
tjlaboss wants to merge 14 commits intoopenmc-dev:developfrom
tjlaboss:fourier-expansion

Conversation

@tjlaboss
Copy link
Contributor

Description

Addresses Part 1 of #3815 . Implements a new functional expansion tally basis in space: spatial Fourier. This borrows heavily from the implementation of spatial Legendre.

  • Adds new class SpatialFourierFilter.
  • Created a new base class SpatialExpansionFilter as a parent of SpatialFourierFilter and SpatialLegendreFilter on the Python side. Moved most of SpatialLegendreFilter to its parent.
  • Added unit and regression tests.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Discussion

  • Should this filter have a flag for only odd (sin) or even (cos) modes?
  • Is there a better convention for the bin labels?
  • Should the SpatialExpansionFilter base class be implemented on the C++ side as well?
  • This does filter does not normalize by the factor of sqrt(2). I believe that the convention for FETs in OpenMC is to normalize in postprocessing (though I'm not sure if this is explicitly established: see Return actual functional representation of funcational expansion tallies in Python API #3419).

Details

Running on the example problem from example-filters.ipynb:

spatiallegendre nuclide score mean std. dev.
P0 total flux 3.63e+01 8.06e-02
P1 total flux -2.60e-02 4.23e-02
P2 total flux -4.35e+00 2.69e-02
P3 total flux -1.36e-02 2.02e-02
P4 total flux -2.81e-01 1.40e-02
P5 total flux 4.92e-03 1.15e-02
P6 total flux 1.13e-01 9.69e-03
P7 total flux 5.20e-03 8.94e-03
P8 total flux -7.84e-02 7.61e-03
spatialfourier nuclide score mean std. dev.
a0 (constant) total flux 3.63e+01 8.06e-02
a1 (cos) total flux -6.45e+00 4.60e-02
b1 (sin) total flux 8.13e-03 6.10e-02
a2 (cos) total flux -2.32e+00 2.96e-02
b2 (sin) total flux 2.65e-02 3.14e-02
a3 (cos) total flux -6.38e-01 2.47e-02
b3 (sin) total flux 2.61e-02 2.51e-02
a4 (cos) total flux -6.40e-01 2.42e-02
b4 (sin) total flux 2.72e-02 2.35e-02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant