Skip to content

Commit

Permalink
Fixing copper density curve (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Feb 6, 2023
1 parent 882637d commit 3b199b6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
4 changes: 2 additions & 2 deletions armi/materials/copper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def setDefaultMassFracs(self):
self.setMassFrac("CU63", 0.6915)
self.setMassFrac("CU65", 0.3085)

def density(self, Tk=None, Tc=None):
return 8.913
def density3(self, Tk=None, Tc=None):
return 8.913 # g/cm3

def linearExpansionPercent(self, Tk=None, Tc=None):
"""
Expand Down
35 changes: 28 additions & 7 deletions armi/materials/tests/test_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
r"""Tests materials.py"""
# pylint: disable=missing-function-docstring,missing-class-docstring,abstract-method,protected-access,no-member,invalid-name

import pickle
import math
import pickle
import unittest

from numpy import testing
Expand Down Expand Up @@ -49,12 +49,6 @@ def test_density3(self):
"""Test that all materials produce a zero density from density3"""
self.assertNotEqual(self.mat.density3(500), 0)

def test_getChildren(self):
self.assertEqual(len(self.mat.getChildren()), 0)

def test_getChildrenWithFlags(self):
self.assertEqual(len(self.mat.getChildrenWithFlags("anything")), 0)

def test_TD(self):
self.assertEqual(self.mat.getTD(), self.mat.theoreticalDensityFrac)

Expand Down Expand Up @@ -913,6 +907,33 @@ def test_propertyValidTemperature(self):
self.assertGreater(len(self.mat.propertyValidTemperature), 0)


class Copper_TestCase(_Material_Test, unittest.TestCase):
MAT_CLASS = materials.Cu

def test_setDefaultMassFracs(self):
cur = self.mat.massFrac
ref = {"CU63": 0.6915, "CU65": 0.3085}
self.assertEqual(cur, ref)

def test_densityNeverChanges(self):
for tk in [200.0, 400.0, 800.0, 1111.1]:
cur = self.mat.density3(tk)
self.assertAlmostEqual(cur, 8.913, 4)

def test_linearExpansionPercent(self):
temps = [100.0, 200.0, 600.0]
expansions = [-0.2955, -0.1500, 0.5326]
for i, temp in enumerate(temps):
cur = self.mat.linearExpansionPercent(Tk=temp)
self.assertAlmostEqual(cur, expansions[i], 4)

def test_getChildren(self):
self.assertEqual(len(self.mat.getChildren()), 0)

def test_getChildrenWithFlags(self):
self.assertEqual(len(self.mat.getChildrenWithFlags("anything")), 0)


class Sulfur_TestCase(_Material_Test, unittest.TestCase):
MAT_CLASS = materials.Sulfur

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 Copper density curve. (`PR#1150 https://github.com/terrapower/armi/pull/1150`_)
#. 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`_)

Expand Down

0 comments on commit 3b199b6

Please sign in to comment.