Skip to content

Comments

Implementation of migration area score#3810

Open
GuySten wants to merge 2 commits intoopenmc-dev:developfrom
GuySten:migration
Open

Implementation of migration area score#3810
GuySten wants to merge 2 commits intoopenmc-dev:developfrom
GuySten:migration

Conversation

@GuySten
Copy link
Contributor

@GuySten GuySten commented Feb 16, 2026

Description

This PR implement 'migration-area' score to calculate diffusion coefficients and transport cross sections for multigroup.

Fixes #1734

Theory

https://www.researchgate.net/publication/324831861_Group-wise_Tally_Scheme_of_Incremental_Migration_Area_for_Cumulative_Migration_Method

Example

import openmc
import matplotlib.pyplot as plt

model = openmc.Model()

# Material
material = openmc.Material(name="Hydrogen")
material.add_nuclide("H1", 1.0)
material.set_density('g/cm3', 1.0)
material.add_s_alpha_beta('c_H_in_H2O')

# Geometry
radius = 10.0
sphere = openmc.Sphere(r=radius, boundary_type="reflective")
cell = openmc.Cell(region=-sphere, fill=material)
model.geometry = openmc.Geometry([cell])

# Settings
model.settings.particles = 100000
model.settings.batches = 20
model.settings.run_mode = 'fixed source'
model.settings.source = openmc.IndependentSource()
    

# Tally 
groups = openmc.mgxs.EnergyGroups('CASMO-70')
energy_filter = openmc.EnergyFilter(groups.group_edges)
tally = openmc.Tally()
tally.scores = ["migration-area", "flux", "total"]
tally.filters = [energy_filter]
model.tallies = [tally]

model.run()


with openmc.StatePoint('statepoint.20.h5') as sp:
    tally = sp.get_tally(id=1)
    
energies = 0.5*(groups.group_edges[1:]+groups.group_edges[:-1])
flux =  tally.get_values(value='mean', scores=['flux']).squeeze()
total =  tally.get_values(value='mean', scores=['total']).squeeze()
migration_area = tally.get_values(value='mean', scores=['migration-area']).squeeze()

migration_area /= flux
total /= flux

plt.semilogx(energies,1/(3*migration_area*total))
plt.title(r'$\Sigma_{tr}/\Sigma_t$')
plt.show()
Figure_1

Reference results:

Untitled

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) 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)

@GuySten GuySten marked this pull request as ready for review February 16, 2026 19:20
@GuySten GuySten requested a review from paulromano as a code owner February 16, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discussion about adding a new tally for CMM

1 participant