Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pointing the Component.density method at 3D material density #1149

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions armi/materials/uraniumOxide.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class UraniumOxide(material.FuelMaterial, material.SimpleSolid):
propertyUnits = {"heat capacity": "J/mol-K"}

propertyValidTemperature = {
"density": ((300, 3100), "K"),
"density3": ((300, 3100), "K"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the only material you found that needed this update?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I randomly happened across this one.

Perhaps we could look through all the materials for similar mis-namings.

"heat capacity": ((298.15, 3120), "K"),
"linear expansion": ((273, 3120), "K"),
"linear expansion percent": ((273, __meltingPoint), "K"),
Expand Down Expand Up @@ -166,7 +166,7 @@ def density3(self, Tk: float = None, Tc: float = None) -> float:
Polynomial line fit to data from [#ornltm2000]_ on page 11.
"""
Tk = getTk(Tc, Tk)
self.checkPropertyTempRange("density", Tk)
self.checkPropertyTempRange("density3", Tk)

return (-1.01147e-7 * Tk ** 2 - 1.29933e-4 * Tk + 1.09805e1) * self.getTD()

Expand Down
2 changes: 1 addition & 1 deletion armi/reactor/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ def density(self):

if not density:
# possible that there are no nuclides in this component yet. In that case, defer to Material.
density = self.material.density(Tc=self.temperatureInC)
density = self.material.density3(Tc=self.temperatureInC)

return density

Expand Down
26 changes: 26 additions & 0 deletions armi/reactor/tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import math
import unittest

from armi.materials.material import Material
from armi.reactor import components
from armi.reactor.components import (
Component,
Expand Down Expand Up @@ -326,6 +327,31 @@ def test_densityConsistent(self):
c.getArea() * c.parent.getHeight() * c.density(), self.component.getMass()
)

def test_density3D(self):
"""Testing the Component density gets the correct 3D material density."""

class StrangeMaterial(Material):
"""material designed to make the test easier to understand"""

def density(self, Tk=None, Tc=None):
return 1.0

def density3(self, Tk=None, Tc=None):
return 3.0

c = Sphere(
name="strangeBall",
material=StrangeMaterial(),
Tinput=200,
Thot=500,
od=1,
id=0,
mult=1,
)

# we expect to see the 3D material density here
self.assertEqual(c.density(), 3.0)


class TestDerivedShape(TestShapedComponent):
componentCls = DerivedShape
Expand Down
1 change: 1 addition & 0 deletions doc/release/0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ What's new in ARMI
#. Bug fix for Magnessium density curve. (`PR#1126 https://github.com/terrapower/armi/pull/1126`_)
#. Bug fix for Potassium density curve. (`PR#1128 https://github.com/terrapower/armi/pull/1128`_)
#. Bug fix for Concrete density curve. (`PR#1131 https://github.com/terrapower/armi/pull/1131`_)
#. Bug fix for Component.density. (`PR#1149 https://github.com/terrapower/armi/pull/1149`_)
#. Calculate block kgHM and kgFis on core loading and after shuffling. (`PR#1136 https://github.com/terrapower/armi/pull/1136`_)

Bug fixes
Expand Down