question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request: Defining `Custom` material properties in the blueprints

See original GitHub issue

When using the custom isotopics within the blueprints file it allows a user to specify number densities or mass fractions with some specified density for defining the initial composition of the material. In this case, a user can choose to use material: Custom or choose to use material: X, where X can be something like SS316 or UO2 as an example.

When specifying material: X, the ARMI framework will initialize the component to have material X and then it will default to using the Python methods for getting different material properties that are implemented (e.g., density, linear expansion coefficient, heat capacity, etc.). Although when a user specifies Custom as the material then there is limited functionality to specify these types of material properties.

blocks:
    inner fuel:
        clad: &component_fuel_clad
            shape: Circle
            material: SS316
            Tinput: 20.0
            Thot: 20.0
            id: 0.64
            od: 0.77
            mult: 271
        fuel:
            shape: Circle
            material: Custom
            isotopics: InnerFuel
            Tinput: 20.0
            Thot: 100.0
            id: 0.0
            mult: clad.mult
            od: clad.id

Sometimes when doing benchmark analyses it is useful to specify the number densities of a material using custom isotopics while still maintaining the use of the Custom material so that the density is not inherited from a given material, but instead use the number densities that are specified by the user. In this case, it would be nice if a user could inherit some methods from an existing material (i.e., linear expansion coefficient), but not all of them.

I could imagine a section in the blueprints that could allow a Custom material object to be built. Maybe this means allowing the user to import custom material definitions from a separate Python script (similar to shuffleLogic.py) or maybe this means just providing something like:

materials:
    CustomFuel:
        isotopics: InnerFuel
        linearExpansion: UZr.linearExpansion
        heatCapacity: SS316.heatCapacity
blocks:
    inner fuel:
        clad: &component_fuel_clad
            shape: Circle
            material: SS316
            Tinput: 20.0
            Thot: 20.0
            id: 0.64
            od: 0.77
            mult: 271
        fuel:
            shape: Circle
            material: CustomFuel
            Tinput: 20.0
            Thot: 100.0
            id: 0.0
            mult: clad.mult
            od: clad.id

In this scenario, the isotopics are now a child of the CustomFuel material that is defined in the materials section (rather than it being its own section on the component definition) and then the linearExpansion and heatCapacity functionalities are tied to the pre-existing UZr and SS316 methods that are already implemented in the code base.

This would allow me as the user to circumvent the warning in https://github.com/terrapower/armi/pull/496 and have more control over this behavior without having to implement a new Material class in the application I am working off of to handle both the correct treatment of a custom number density input along with the allowing the material to thermally expand, etc.

Please let me know what you think about this @ntouran / @john-science. The specific use case for this is when a benchmark specifies the number densities of a component/block and when we would like to have linear expansion defined to support a reactivity coefficient calculation.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
ntourancommented, Feb 9, 2022

Hmm, while implementing that it occurred to me that plugins don’t really do too much in terms of registering materials that they bring in other than setting the material resolution order to know about them (as @john-science was trying to remind me earlier).

This leads me to the supported path.to.module:MaterialClassName syntax supported by ARMI already. If you specified your material name in blueprints as, e.g. jakesCustomMaterials:Milkshake then the system would try to import jakesCustomMaterials.py and look for the Milkshake material class in there.

This can and does currently provide user-supply-able material classes in the run’s input directory, provided that the input directory is in the module resolution path (e.g. PYTHONPATH).

I tried this out and it works. But it’s kind of a pain to always be updating your PYTHONPATH. One thing we could consider doing to make this happen is having ARMI add the input directory directly to the sys.path variable at runtime. Then imports by name would work no problem.

Thoughts on that?

1reaction
jakehadercommented, Jan 26, 2022

Thanks for the feedback @john-science. I definitely think that this warrants further discussion between you, me, and @ntouran. Let’s take it offline and report back here with a proposed solution or maybe alternate way to frame the problem I am looking to solve.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UE4 - Tutorial - Dynamic Materials in BluePrints! (Request!)
A few people wanted to know how you can use blueprints to change materials around. :)Twitter: https://twitter.com/Play_RuffPatreon: ...
Read more >
Creating a Custom Material - 2020 - SolidWorks Web Help
To customize a material, copy a material to a custom library and change the copy's properties: In a part document, right-click Material in...
Read more >
Storing Custom Data in a Material Per Primitive
An overview of the Custom Primitive Data workflow for storing custom data per primitive that's accessible through Blueprint.
Read more >
Controlling Materials from Blueprint | Epic Developer Community
Learn how to control materials in Blueprint. Animate properties by sending data from gameplay. Optimize performance by avoiding draw calls.
Read more >
Generating code using schematics - Angular
Angular Material, for example, supplies generation schematics for the UI components that it defines. The following command uses one of these schematics to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found