ARMI Materials - Design and Consistency #767
Replies: 15 comments 25 replies
-
As @ntouran mentioned here, a lot of our materials have a method named armi/armi/materials/lithium.py Lines 66 to 67 in 20ca687 After all, not all of our Materials data is in the same units. |
Beta Was this translation helpful? Give feedback.
-
It should be enforced that all defined material properties have ranges for those properties. @john-science just went through the arduous process of implementing these ranges for our existing framework materials in #762 using the newly-created I think it could be very useful to add a "unit test" to the framework that will inspect the material classes and complain if one of the methods returning a supported material property does not have a corresponding entry in the That way we don't have to rely on code review to enforce this type of consistency in our material classes, and we can guarantee that all materials defined in the framework will have defined ranges for their properties. This could "break" downstream projects in the sense that the unit tests would fail if a material class is defined in that project that doesn't include the required property ranges. |
Beta Was this translation helpful? Give feedback.
-
Is there a reason we need every armi/armi/materials/material.py Line 43 in 20ca687 This causes a bunch of linting errors / Python subclassing errors for every material:
|
Beta Was this translation helpful? Give feedback.
-
Based on the PRs that @john-science just did, all materials currently will call the check range function to make sure the temperature is in the valid range. All future ARMI materials should be forced to use that same architecture so that there is consistent behavior between all materials for what happens when the temperature is in or outside the valid range for that property. |
Beta Was this translation helpful? Give feedback.
-
I think a better design for materials in ARMI would be if we separated out the code from the data. For instance, we would have a big text file or database that defined all the values, curves, temperature bounds, and references. And ARMI would just have code that would go though that data and generate a This would allow us to:
|
Beta Was this translation helpful? Give feedback.
-
Also, @drewejohnson notes in a different discussion, that ARMI materials have two parameters that are not consistently applied:
It seems likely that we could remove |
Beta Was this translation helpful? Give feedback.
-
ARMI has three similar methods on various materials that describe linear expansion:
These are inconsistently applied across the ARMI Materials. That is, any individual material might have one or two of these, chosen seemingly at random. However, it seems like If so, then if the method |
Beta Was this translation helpful? Give feedback.
-
Bringing a few comments in from #868 to provide some additional thoughts on the (1/3 -- #868 (comment)) There are several implementations for how reference densities are set. It would be great to have consistency. One idea is to create a constructor for each material. I am certainly open to other ideas, I just advocate for consistency and clarity. (2/3 -- #868 (comment)) Would be useful to have the reference temperature (for the reference density) be a parameter that is stored on the database. Related is the reference temp for the coefficient of thermal expansion. See @alexhjames comment here. (3/3 -- #868 (comment)) Based on #865, I think there is precedent for removing the temperature dependent correlations in materials. At least within the |
Beta Was this translation helpful? Give feedback.
-
I believe ARMI needs an API change:
It can not be obvious to our user base that the normal 3D density is actually
|
Beta Was this translation helpful? Give feedback.
-
@ntouran just noted that some of the ARMI materials have an internal state, which is an upsetting idea. So, I will attempt to fully squash that "feature" in the ARMI ecosystem. Which, I think, will make ARMI materials easier to use, and definitely easier to reason about. |
Beta Was this translation helpful? Give feedback.
-
One possibility for enforcing some level of consistency would be to use the This would make it significantly easier to trace through what methods on specific material classes are actually doing. |
Beta Was this translation helpful? Give feedback.
-
#762 made very good progress on improving the discoverability of our material property temperature ranges. I would like to suggest that we could take this even further. One thing stands out to me as being potentially problematic -- In the I think this type of ambiguity could be reduced if we made the |
Beta Was this translation helpful? Give feedback.
-
Just putting a link to this issue here, as it relates to materials and their consistent implementation: #402 |
Beta Was this translation helpful? Give feedback.
-
Related: #865 |
Beta Was this translation helpful? Give feedback.
-
I would like it if we separated the ARMI materials code from the data. Say we have far less code, but our materials were defined in YAML files. That would have the wonderful knock-on affect of letting analysts define custom materials in their blueprint files. Here is a fun, little example of what material data file might look like (numbers are nonsense, ignore them): material type: Fluid
composition:
O: [22.2, 22.2]
CO2: [0.06, 0.06]
Ar: [1.2, 1.2]
Ne: [0.001, 0.001]
N: balance
density:
function:
min degrees C: -150
max degrees C: 250
type: power law
coefficients:
exponent: -1.1
outer multiplier: 350
inner adder: 250.1
tabulated data:
- [-150, 2.4E+00]
- [-100, 2.2E+00]
- [0, 1.8E+00]
- [100, 9.6E-01]
- [300, 6.8E-01]
- [600, 3.8E-01]
- [1000, 2.3E-01]
- [1800, 1.7E-01]
- [2600, 1.2E-01]
references:
- ref: typical bibliographic citation
type: open literature
specific heat capacity:
# more of the same
dynamic viscosity:
# more of the same
kinematic viscosity:
# more of the same
thermal conductivity:
# more of the same |
Beta Was this translation helpful? Give feedback.
-
Recently, I have been working on a couple materials PRs in ARMI. And the sense I am left with is the Materials in ARMI are not consistent enough. I think a little design work is in order.
Let's gather some ideas for things that would improve ARMI materials for:
And let's label each idea by whether or not it changes the ARMI API (whether or not downstream repos will need to change).
Beta Was this translation helpful? Give feedback.
All reactions