Skip to content

Commit

Permalink
Merge 6904c2d into 1ce048d
Browse files Browse the repository at this point in the history
  • Loading branch information
sombrereau committed Sep 9, 2022
2 parents 1ce048d + 6904c2d commit 9108f1b
Show file tree
Hide file tree
Showing 25 changed files with 230 additions and 96 deletions.
6 changes: 3 additions & 3 deletions armi/materials/caH2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
Calcium Hydride.
"""

from armi.materials.material import Material
from armi.materials.material import SimpleSolid


class CaH2(Material):
class CaH2(SimpleSolid):
"""CalciumHydride"""

name = "CaH2"
Expand Down Expand Up @@ -50,7 +50,7 @@ def setDefaultMassFracs(self):
self.setMassFrac("CA", 0.952115131)
self.setMassFrac("H", 0.047884869)

def density(self, Tk=None, Tc=None):
def density3(self, Tk=None, Tc=None):
"""Mass density
http://en.wikipedia.org/wiki/Calcium_hydride
Expand Down
7 changes: 4 additions & 3 deletions armi/materials/californium.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@
produces lots of neutrons. It's often used as a neutron source.
"""

from armi.materials.material import Material
from armi.materials.material import SimpleSolid
from armi.utils import densityTools


class Californium(Material):
class Californium(SimpleSolid):

name = "Californium"

def setDefaultMassFracs(self):
self.setMassFrac("CF252", 1.0)

def density(self, Tk=None, Tc=None):
def density3(self, Tk=None, Tc=None):
"""
https://en.wikipedia.org/wiki/Californium
"""
Expand Down
4 changes: 2 additions & 2 deletions armi/materials/cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
Cesium
"""

from armi.materials.material import Material
from armi.materials.material import Fluid
from armi.utils.units import getTk


class Cs(Material):
class Cs(Fluid):

name = "Cesium"

Expand Down
6 changes: 3 additions & 3 deletions armi/materials/hafnium.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
"""

from armi.nucDirectory import nucDir
from armi.materials.material import Material
from armi.materials.material import SimpleSolid


class Hafnium(Material):
class Hafnium(SimpleSolid):
name = "Hafnium"

def setDefaultMassFracs(self):
for a, abund in nucDir.getNaturalMassIsotopics("HF"):
self.setMassFrac("HF{0}".format(a), abund)

def density(self, Tk=None, Tc=None):
def density3(self, Tk=None, Tc=None):
r"""
http://www.lenntech.com/periodic/elements/hf.htm
"""
Expand Down
10 changes: 7 additions & 3 deletions armi/materials/inconel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
Inconel is a austenitic nickel-chromium superalloy.
"""

from armi.materials.material import Material
from armi.materials.material import SimpleSolid


class Inconel(Material):
class Inconel(SimpleSolid):
name = "Inconel"
references = {
"mass fractions": "https://www.specialmetals.com/documents/technical-bulletins/inconel/inconel-alloy-617.pdf",
Expand All @@ -41,5 +41,9 @@ def setDefaultMassFracs(self):
self.setMassFrac("B10", 0.00003 * 0.1997)
self.setMassFrac("B11", 0.00003 * (1.0 - 0.1997))

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


class Inconel617(Inconel):
pass
6 changes: 3 additions & 3 deletions armi/materials/inconelPE16.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
Inconel PE16
"""

from armi.materials.material import Material
from armi.materials.material import SimpleSolid
from armi.nucDirectory import nuclideBases
from armi import runLog


class InconelPE16(Material):
class InconelPE16(SimpleSolid):
name = "InconelPE16"
references = {
"mass fractions": r"http://www.specialmetals.com/assets/documents/alloys/nimonic/nimonic-alloy-pe16.pdf",
Expand Down Expand Up @@ -58,7 +58,7 @@ def setDefaultMassFracs(self):
for element, massFrac in massFracs.items():
self.setMassFrac(element, massFrac)

def density(self, Tk=None, Tc=None):
def density3(self, Tk=None, Tc=None):
runLog.warning(
"PE16 mass density is not temperature dependent, using room temperature value",
single=True,
Expand Down
66 changes: 65 additions & 1 deletion armi/materials/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,71 @@ def density3(self, Tk=None, Tc=None):
return self.density(Tk=Tk, Tc=Tc)


class FuelMaterial(Material):
class SimpleSolid(Material):
"""
Base material for a simple material that primarily defines density
Notes
-----
This function assumed the density is defined on the _density method and
this base class keeps density, density3 and linearExpansion all in sync
class SimpleMaterial(SimpleSolid):
def _density(self, Tk=None, Tc=None):
"
density that preserves mass when thermally expanded in 3D.
"
...
See Also
--------
armi.materials.density:
armi.materials.density3:
"""

refTempK = 300

def __init__(self):
Material.__init__(self)
self.p.refDens = self.density3(Tc=self.refTempK)

def linearExpansionPercent(self, Tk: float = None, Tc: float = None) -> float:
"""
Average thermal expansion dL/L. Used for computing hot dimensions and density.
Defaults to 0.0 for materials that don't expand.
Parameters
----------
Tk : float
temperature in (K)
Tc : float
Temperature in (C)
Returns
-------
dLL(T) in % m/m/K
Notes
-----
This only method only works for Simple Solid Materials which assumes
the density3 function returns 'free expansion' density as a function
temperature
"""
density1 = self.density3(Tc=self.refTempK)
density2 = self.density3(Tk=Tk, Tc=Tc)

if density1 == density2:
return 0
else:
return 100 * ((density1 / density2) ** (1.0 / 3.0) - 1)

def density3(self, Tk: float = None, Tc: float = None) -> float:
return 0.0


class FuelMaterial(SimpleSolid):
"""
Material that is considered a nuclear fuel.
Expand Down
19 changes: 7 additions & 12 deletions armi/materials/mgO.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,18 @@ class MgO(Material):
"linear expansion percent": ((273.15, 1273.15), "K"),
}

def __init__(self):
Material.__init__(self)
"""same reference as linear expansion. Table II.
Reference density is from Wolfram Alpha At STP (273 K)"""

self.p.refDens = 3.58

def setDefaultMassFracs(self):
r"""mass fractions"""
self.setMassFrac("MG", 0.603035897)
self.setMassFrac("O16", 0.396964103)

def density(self, Tk=None, Tc=None):
"""same reference as linear expansion. Table II.
Reference density is from Wolfram Alpha At STP (273 K)"""
Tk = getTk(Tc, Tk)
rho0 = 3.58
self.checkPropertyTempRange("density", Tk)
dLL = self.linearExpansionPercent(Tk=Tk)

dRho = (1 - (1 + dLL) ** 3) / (1 + dLL) ** 3
density = rho0 * (1 + dRho)
return density

def linearExpansionPercent(self, Tk=None, Tc=None):
"""THE COEFFICIENT OF EXPANSION OF MAGNESIUM OXIDE
Milo A. Durand
Expand Down
6 changes: 3 additions & 3 deletions armi/materials/molybdenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
Molybdenum
"""

from armi.materials.material import Material
from armi.materials.material import SimpleSolid


class Molybdenum(Material):
class Molybdenum(SimpleSolid):
name = "Molybdenum"

def setDefaultMassFracs(self):
"""Moly mass fractions."""
self.setMassFrac("MO", 1.0)

def density(self, Tk=None, Tc=None):
def density3(self, Tk=None, Tc=None):
return 10.28 # g/cc
6 changes: 3 additions & 3 deletions armi/materials/nZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
Niobium Zirconium Alloy
"""

from armi.materials.material import Material
from armi.materials.material import SimpleSolid


class NZ(Material):
class NZ(SimpleSolid):
name = "NZ"

def setDefaultMassFracs(self):
self.setMassFrac("NB93", 0.99)
self.setMassFrac("ZR", 0.01)

def density(self, Tk=None, Tc=None):
def density3(self, Tk=None, Tc=None):
return 8.66 # g/cc
10 changes: 7 additions & 3 deletions armi/materials/scandiumOxide.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ class Sc2O3(Material):

propertyValidTemperature = {"linear expansion percent": ((273.15, 1573.15), "K")}

def __init__(self):
Material.__init__(self)
"""
https://en.wikipedia.org/wiki/Scandium_oxide
"""
self.p.refDens = 3.86

def setDefaultMassFracs(self):
self.setMassFrac("SC45", 0.6520)
self.setMassFrac("O16", 0.3480)

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

def linearExpansionPercent(self, Tk=None, Tc=None):
"""
Return the linear expansion percent for Scandium Oxide (Scandia).
Expand Down
6 changes: 3 additions & 3 deletions armi/materials/sodiumChloride.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
.. note:: This is a very basic description of this material.
"""
from armi.materials.material import Material
from armi.materials.material import SimpleSolid
from armi.utils.units import getTk


class NaCl(Material):
class NaCl(SimpleSolid):
name = "NaCl"

def setDefaultMassFracs(self):
self.setMassFrac("NA23", 0.3934)
self.setMassFrac("CL35", 0.4596)
self.setMassFrac("CL37", 0.1470)

def density(self, Tk=None, Tc=None):
def density3(self, Tk=None, Tc=None):
"""
Return the density of Sodium Chloride.
Expand Down
7 changes: 4 additions & 3 deletions armi/materials/tZM.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ class TZM(Material):
5.04e-01,
]

def __init__(self):
Material.__init__(self)
self.p.refDens = 10.16

def setDefaultMassFracs(self):
self.setMassFrac("C", 2.50749e-05)
self.setMassFrac("TI", 0.002502504)
self.setMassFrac("ZR", 0.000761199)
self.setMassFrac("MO", 0.996711222)

def density(self, Tk=None, Tc=None):
return 10.16 # g/cc

def linearExpansionPercent(self, Tk=None, Tc=None):
r"""
return linear expansion in %dL/L from interpolation of tabular data.
Expand Down
6 changes: 3 additions & 3 deletions armi/materials/tantalum.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

"""Tantalum"""

from armi.materials.material import Material
from armi.materials.material import SimpleSolid


class Tantalum(Material):
class Tantalum(SimpleSolid):
name = "Tantalum"

def setDefaultMassFracs(self):
self.setMassFrac("TA181", 1)

def density(self, Tk=None, Tc=None):
def density3(self, Tk=None, Tc=None):
return 16.6 # g/cc
24 changes: 24 additions & 0 deletions armi/materials/tests/test_graphite.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""
Tests for graphite material
"""
import math
import unittest

from armi.materials.graphite import Graphite
Expand Down Expand Up @@ -43,6 +44,29 @@ def test_linearExpansionPercent(self):
def test_propertyValidTemperature(self):
self.assertEqual(len(self.mat.propertyValidTemperature), 0)

def test_density(self):
"""
test to reproduce density measurements results in table 2 from
[INL-EXT-16-38241]
"""
uncertainty = 0.01

for Tc, ref_rho in [
# sample G-348-1
(22.6, 1.8885),
(401.6, 1.8772),
(801.3, 1.8634),
# sample G-348-2
(23.5, 1.9001),
(401.0, 1.8888),
(800.9, 1.8748),
]:

test_rho = self.mat.density3(Tc=Tc)
error = math.fabs((ref_rho - test_rho) / ref_rho)

self.assertLess(error, uncertainty)


if __name__ == "__main__":
unittest.main()

0 comments on commit 9108f1b

Please sign in to comment.