Skip to content

Commit

Permalink
Pointing the Component.density method at 3D material density (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Feb 3, 2023
1 parent 5cfddf6 commit 2a9cd5c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
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"),
"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

0 comments on commit 2a9cd5c

Please sign in to comment.