Skip to content

Conversation

@jude-moo
Copy link
Collaborator

@jude-moo jude-moo commented Dec 15, 2025

This pull requests includes the required changes to add the FNG-SS benchmark for OpenMC into JADE. The changes include:

  • The addition of FNG-SS to the run_cfg.yml file
  • The post processing requirements for the openmc benchmark in the raw config file
  • Updated documentation outlining any differences to the benchmark.
  • Merged developing branch so PR should be up to date

Summary by CodeRabbit

  • Documentation

    • Added detailed OpenMC guidance for the FNG SS benchmark, including geometry/tally notes, boundary and geometry adjustments, energy-response guidance, and instructions for comparing OpenMC results to measured data.
  • New Features

    • Added FNG-SS OpenMC benchmark support with simulation inputs, materials, geometry, tallies, volumes and benchmark metadata, plus a new OpenMC configuration for foil reaction-rate processing.
  • Tests

    • Added OpenMC-specific tests exercising FNG-SS and FNG-HCPB raw-data processing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

Walkthrough

Adds OpenMC FNG-SS assets: documentation, an OpenMC benchmark YAML, test fixtures (geometry, materials, tallies, volumes, metadata), and pytest cases invoking raw data processing for OpenMC runs.

Changes

Cohort / File(s) Summary
Documentation
docs/source/documentation/benchdesc/fng/fng-ss.rst
New OpenMC-specific documentation describing the FNG SS model, vacuum outer boundaries, geometry adjustments for cone/funnel cells, an OpenMC flux tally with an EnergyFunctionFilter, and instruction to normalize results by foil volumes.
Benchmark config (OpenMC)
src/jade/resources/default_cfg/benchmarks_pp/raw/openmc/FNG-SS.yaml
New YAML config introducing an anchor mapping foil cell IDs (500–506) and a Reaction rate post-processing block that computes volumes and replaces the Cells column with the anchored foil values.
Runtime configuration
src/jade/resources/default_cfg/run_cfg.yml
Minor formatting change (removed trailing space on custom_input in an existing FNG_HCPB block); no functional additions for FNG-SS in this diff.
Simulation geometry & materials
tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/geometry.xml, .../materials.xml, .../metadata.json
New test fixtures: detailed OpenMC geometry XML (many cells/surfaces, vacuum boundaries), 15-material XML file, and benchmark metadata JSON.
Tallies & volumes
tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/tallies.xml, .../volumes.json
New tallies.xml with cell/neutron/energyfunction filters and a flux tally (Al-27(n,a)); volumes.json mapping cells 500–506 to numeric volumes for normalization.
Tests
tests/post/test_raw_processor.py
Added OpenMC pytest for FNG-SS (and aligned FNG-HCPB OpenMC test) guarded by availability checks; they load YAML, build cfg, iterate folders, and call RawProcessor.process_raw_data().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to inspect closely:
    • src/jade/resources/default_cfg/benchmarks_pp/raw/openmc/FNG-SS.yaml — anchor values and the Reaction rate replace operation mapping to Cells.
    • tests/.../FNG-SS_Al/tallies.xml — energyfunction filter bins and response y-values, and tally filter composition.
    • tests/.../FNG-SS_Al/geometry.xml — region expressions, surface definitions, and vacuum boundary attributes (cone/plane coupling).
    • tests/post/test_raw_processor.py — skip guards and fixture folder wiring.

Suggested reviewers

  • dodu94
  • Radiation-Transport

Poem

🐰 I tunneled through XML and YAML bright,
Foils in rows beneath moonlight,
Tallies hum and volumes sing,
A tiny rabbit fixed everything! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Adding OpenMC version of FNG-SS benchmark' clearly and concisely describes the main change - introducing OpenMC support for the FNG-SS benchmark. It is specific, directly related to the changeset, and summarizes the primary purpose.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8500888 and a0af557.

📒 Files selected for processing (1)
  • src/jade/resources/default_cfg/run_cfg.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/jade/resources/default_cfg/run_cfg.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: test (ubuntu-latest, 3.11, false)
  • GitHub Check: test (windows-latest, 3.10, false)
  • GitHub Check: test (ubuntu-latest, 3.12, false)
  • GitHub Check: test (windows-latest, 3.11, false)
  • GitHub Check: test (ubuntu-latest, 3.10, false)
  • GitHub Check: test (windows-latest, 3.12, false)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jude-moo jude-moo changed the title Benchmark/openmc fng ss Adding OpenMC version of FNG-SS benchmark Dec 15, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/tallies.xml (1)

10-10: Consider cleaning up floating-point precision artifacts in energy values.

The energy grid contains values with precision artifacts (e.g., 8000000.999999999, 16100000.000000002). While OpenMC likely handles these correctly, rounding to cleaner values would improve data quality and maintainability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3037b6 and 8500888.

⛔ Files ignored due to path filters (1)
  • tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/tallies.out is excluded by !**/*.out
📒 Files selected for processing (6)
  • tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/geometry.xml (1 hunks)
  • tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/materials.xml (1 hunks)
  • tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/metadata.json (1 hunks)
  • tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/tallies.xml (1 hunks)
  • tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/volumes.json (1 hunks)
  • tests/post/test_raw_processor.py (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • tests/dummy_structure/simulations/openmc-FENDL 3.2b/FNG-SS/FNG-SS_Al/metadata.json
  • tests/dummy_structure/simulations/openmc-FENDL 3.2b/FNG-SS/FNG-SS_Al/volumes.json
🧰 Additional context used
🧬 Code graph analysis (1)
tests/post/test_raw_processor.py (2)
src/jade/config/raw_config.py (2)
  • ConfigRawProcessor (11-34)
  • from_yaml (23-34)
src/jade/post/raw_processor.py (2)
  • RawProcessor (15-118)
  • process_raw_data (61-103)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: test (windows-latest, 3.11, false)
  • GitHub Check: test (ubuntu-latest, 3.11, false)
  • GitHub Check: test (ubuntu-latest, 3.10, false)
  • GitHub Check: test (ubuntu-latest, 3.12, false)
  • GitHub Check: test (windows-latest, 3.10, false)
  • GitHub Check: test (windows-latest, 3.12, false)
🔇 Additional comments (2)
tests/post/test_raw_processor.py (1)

356-369: LGTM!

The test follows the established pattern for OpenMC tests, is properly gated with pytest.mark.skipif(not OMC_AVAIL), and correctly loads the configuration and processes the simulation folders.

tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/geometry.xml (1)

1-145: LGTM!

The geometry definition is structurally sound and properly integrates with the tally configuration (cells 500–506 match the tally filter bins in tallies.xml). Vacuum boundaries are correctly defined on outer surfaces.

Note: Materials 12–15 from materials.xml are not referenced in this geometry, which supports the concern raised about those being potentially erroneous duplicates.

Comment on lines +122 to +137
<material id="12">
<density units="g/cm3" value="2.7"/>
<nuclide ao="1.0" name="Fe56"/>
</material>
<material id="13">
<density units="g/cm3" value="2.7"/>
<nuclide ao="1.0" name="Fe56"/>
</material>
<material id="14">
<density units="g/cm3" value="2.7"/>
<nuclide ao="1.0" name="Fe56"/>
</material>
<material id="15">
<density units="g/cm3" value="2.7"/>
<nuclide ao="1.0" name="Fe56"/>
</material>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check usage of materials 12-15 in geometry.xml
echo "=== Checking material references in geometry.xml ==="
for mat_id in 12 13 14 15; do
  echo "Material $mat_id references:"
  rg -n "material=\"$mat_id\"" "tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/geometry.xml" || echo "  (no matches found)"
done

Repository: JADE-V-V/JADE

Length of output: 289


🏁 Script executed:

#!/bin/bash
# Verify geometry.xml exists and check its structure
echo "=== Checking if geometry.xml exists ==="
ls -lh "tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/geometry.xml" 2>/dev/null || echo "File not found"

echo -e "\n=== Checking how materials are referenced in geometry.xml ==="
head -100 "tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/geometry.xml" | grep -i material | head -10

echo -e "\n=== Checking if materials 12-15 are referenced anywhere in the directory ==="
for mat_id in 12 13 14 15; do
  count=$(rg -c "material[\"']?[=:]?\s*[\"']?$mat_id[\"']?" "tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/" 2>/dev/null | wc -l)
  echo "Material $mat_id appears in: $count files"
  rg "material[\"']?[=:]?\s*[\"']?$mat_id[\"']?" "tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/" -l 2>/dev/null
done

Repository: JADE-V-V/JADE

Length of output: 1164


🏁 Script executed:

#!/bin/bash
# Verify materials 12-15 in materials.xml
echo "=== Materials 12-15 in materials.xml (lines 122-137) ==="
sed -n '122,137p' "tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/materials.xml"

echo -e "\n=== Total material definitions in file ==="
grep -c '<material id=' "tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/materials.xml"

echo -e "\n=== All material IDs ==="
rg '<material id="(\d+)"' -o -r '$1' "tests/dummy_structure/simulations/_openmc_-_FENDL 3.2b_/FNG-SS/FNG-SS_Al/materials.xml" | sort -n

Repository: JADE-V-V/JADE

Length of output: 670


Remove unused material definitions.

Materials 12–15 are defined identically (density 2.7 g/cm³, Fe56 composition) but are never referenced in geometry.xml or elsewhere in the simulation. These are orphaned definitions that should be deleted to keep the materials file clean.

🤖 Prompt for AI Agents
In tests/dummy_structure/simulations/_openmc_-_FENDL
3.2b_/FNG-SS/FNG-SS_Al/materials.xml around lines 122–137 there are four
identical, unused material blocks (id="12"–"15") that should be removed; delete
the entire <material>...</material> entries for ids 12–15 from the file and then
run a quick search/validation against geometry.xml and the rest of the
simulation to confirm no references remain.

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@dodu94 dodu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Jude, thanks for this and sorry for the delay. Tests have been finally fixed and we can proceed. Please could you just remove the FNG-SS entry from the run-cfg.yml? You did good at inserting it since it was missing but in my PR I added all the missing ones and I am afraid if we push both we would run in a conflict:

https://github.com/JADE-V-V/JADE/pull/471/changes#diff-901483fcad5c99357015b7e470e16040411c74d87d0b0435aca8f90a547303d1

@jude-moo
Copy link
Collaborator Author

@dodu94 This should now be removed from the file.

Copy link
Member

@dodu94 dodu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dodu94 dodu94 merged commit 82a0902 into JADE-V-V:developing Dec 19, 2025
1 of 25 checks passed
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.

2 participants