Open drewj-usnctech opened 2 months ago
@drewj-usnctech Just to be sure. This features is meant to support "custom isotopics" in our blueprints:
Is that how you're using the Custom(Material)
class?
@drewj-usnctech Just to be sure. This features is meant to support "custom isotopics" in our blueprints:
Is that how you're using the
Custom(Material)
class?
That is correct
Related to #1682:
Material.density
returns zero, probably under the assumption a subclass will override the method. And most cases that's true.But, if you make a custom material in the blueprint file and provide a mass density, the
CustomMaterial
object does not override the density and will return zero. This is despite the fact that is known by the classhttps://github.com/terrapower/armi/blob/7b26f79ac8c58b0477b0d7fa384b363d10fa9406/armi/materials/custom.py#L40
and used in the
pseudoDensity
methodhttps://github.com/terrapower/armi/blob/7b26f79ac8c58b0477b0d7fa384b363d10fa9406/armi/materials/custom.py#L42-L50
But, if you have a routine that does something with a subclass of
Material
and relies onMaterial.density
, you can see strange problems becauseCustomMaterial.density
falls back toMaterial.density
which relies on therefDens
propertyhttps://github.com/terrapower/armi/blob/7b26f79ac8c58b0477b0d7fa384b363d10fa9406/armi/materials/material.py#L492-L514
which defaults to zero
https://github.com/terrapower/armi/blob/7b26f79ac8c58b0477b0d7fa384b363d10fa9406/armi/materials/material.py#L101