Skip to content

Add Ability to add a balance material component #997

Description

@MicahGale

Is your feature request related to a problem? Please describe.

In metallurgy it is common to have a "balance" component, which is roughly "whatever is left over". For instance iron is the balance component in all steels. Or for example, U-238 is the balance of most uranium enrichments. It is annoying to have to manually calculate the balance component as 1.0 - sum(fractions) (though most users would probably do 1.0 - (0.03 + 0.07...)).

Describe the solution you'd like

I am going back on forth on how to do this. We could do this at the Nuclide or Material level. Nuclide level might look like:

mat.add_nuclide("U-238", balance=True)

This probably needs to rise a ValueError if the current components sum to >=1.0. This use case would be helpful only when the balance is a single isotope.

At the Material level I would imagine something like:

oxygen = montepy.Material...
chrome = montepy.Material...
iron = montepy.Material...

steel = problem.Materials.mix([oxygen, chrome], [0.005, 0.05], balance=iron)

This latter case is more helpful for mixing elemental materials (e.g., alloys).

Describe alternatives you've considered

Status quo.

Additional context

This was partially inspired by discussing how to make Zircaloy-4 in the MCNP forum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestAn issue that improves the user interface.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions