Skip to content

Commit

Permalink
🔥 Replace _in_C
Browse files Browse the repository at this point in the history
  • Loading branch information
je-cook committed Dec 1, 2023
1 parent b6bb60f commit a6d1a53
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
1 change: 1 addition & 0 deletions bluemira/materials/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
The home of base material objects. Use classes in here to make new materials.
"""

import abc
from dataclasses import asdict, dataclass, field
from typing import Any, Dict, List, Optional, Union

Expand Down
64 changes: 32 additions & 32 deletions data/materials/materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,55 +48,55 @@
},
"poissons_ratio": 0.33,
"coefficient_thermal_expansion": {
"value": "polynomial.Polynomial([15.13, 7.93e-3, -3.33e-6])(temperature_in_C)",
"value": "polynomial.Polynomial([15.13, 7.93e-3, -3.33e-6])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 1000,
"reference": "ITER_D_222RLN v3.3 Equation 40"
},
"youngs_modulus": {
"value": "0.001 * (201660 - 84.8 * temperature_in_C)",
"value": "0.001 * (201660 - 84.8 * to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 700,
"reference": "ITER_D_222RLN v3.3 Equation 41"
},
"density": {
"value": "interp(temperature_in_C, [20, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800], [7930, 7919, 7899, 7879, 7858, 7837, 7815, 7793, 7770, 7747, 7724, 7701, 7677, 7654, 7630, 7606, 7582])",
"value": "interp(to_celsius(temperature), [20, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800], [7930, 7919, 7899, 7879, 7858, 7837, 7815, 7793, 7770, 7747, 7724, 7701, 7677, 7654, 7630, 7606, 7582])",
"temp_min_celsius": 20,
"temp_max_celsius": 800,
"reference": "ITER_D_222RLN v3.3 Table A.S03.2.4-1"
},
"thermal_conductivity": {
"value": "13.98 + 1.502e-2 * temperature_in_C",
"value": "13.98 + 1.502e-2 * to_celsius(temperature)",
"temp_min_celsius": 20,
"temp_max_celsius": 800,
"reference": "ITER_D_222RLN v3.3 Equation 42"
},
"specific_heat": {
"value": "polynomial.Polynomial([462.69, 0.520265, -1.7117e-3, 3.3658e-6, -2.1958e-9])(temperature_in_C)",
"value": "polynomial.Polynomial([462.69, 0.520265, -1.7117e-3, 3.3658e-6, -2.1958e-9])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 800,
"reference": "ITER_D_222RLN v3.3 Equation 43"
},
"minimum_yield_stress": {
"value": "polynomial.Polynomial([225.75, -0.73683, 2.5036e-3, -5.4546e-6, 6.4366e-9, -3.029e-12])(temperature_in_C)",
"value": "polynomial.Polynomial([225.75, -0.73683, 2.5036e-3, -5.4546e-6, 6.4366e-9, -3.029e-12])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 700,
"reference": "ITER_D_222RLN v3.3 Equation 44"
},
"average_yield_stress": {
"value": "1.28 * polynomial.Polynomial([225.75, -0.73683, 2.5036e-3, -5.4546e-6, 6.4366e-9, -3.029e-12])(temperature_in_C)",
"value": "1.28 * polynomial.Polynomial([225.75, -0.73683, 2.5036e-3, -5.4546e-6, 6.4366e-9, -3.029e-12])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 700,
"reference": "ITER_D_222RLN v3.3 Equation 44"
},
"minimum_ultimate_tensile_stress": {
"value": "polynomial.Polynomial([529.75, -0.95180, 2.5732e-3, -2.3316e-6, -4.3944e-10, 3.4942e-13])(temperature_in_C)",
"value": "polynomial.Polynomial([529.75, -0.95180, 2.5732e-3, -2.3316e-6, -4.3944e-10, 3.4942e-13])(to_celsius(temperature))",
"temp_min_celsius": 50,
"temp_max_celsius": 650,
"reference": "ITER_D_222RLN v3.3 Equation 47"
},
"average_ultimate_tensile_stress": {
"value": "1.112 * polynomial.Polynomial([529.75, -0.95180, 2.5732e-3, -2.3316e-6, -4.3944e-10, 3.4942e-13])(temperature_in_C)",
"value": "1.112 * polynomial.Polynomial([529.75, -0.95180, 2.5732e-3, -2.3316e-6, -4.3944e-10, 3.4942e-13])(to_celsius(temperature))",
"temp_min_celsius": 50,
"temp_max_celsius": 650,
"reference": "ITER_D_222RLN v3.3 Equation 47"
Expand Down Expand Up @@ -124,44 +124,44 @@
"Zn": 1e-6
},
"coefficient_thermal_expansion": {
"value": "polynomial.Polynomial([16.73, 5.26e-3, -5.53e-6, 4.2e-9])(temperature_in_C)",
"value": "polynomial.Polynomial([16.73, 5.26e-3, -5.53e-6, 4.2e-9])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 900,
"reference": "ITER_D_222RLN v3.3 Equation 83"
},
"youngs_modulus": {
"value": "polynomial.Polynomial([117, -2.17e-2, -6.29e-5])(temperature_in_C)",
"value": "polynomial.Polynomial([117, -2.17e-2, -6.29e-5])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 400,
"reference": "ITER_D_222RLN v3.3 Equation 84"
},
"poissons_ratio": 0.33,
"density": {
"value": "8940 * (1 - 3e-6 * (temperature_in_C - 20) * polynomial.Polynomial([16.8, 3.16e-3, 8.18e-6, -2.49e-9])(temperature_in_C))",
"value": "8940 * (1 - 3e-6 * (to_celsius(temperature) - 20) * polynomial.Polynomial([16.8, 3.16e-3, 8.18e-6, -2.49e-9])(to_celsius(temperature)))",
"temp_min_celsius": 20,
"temp_max_celsius": 900,
"reference": "ITER_D_222RLN v3.3 Equation 85"
},
"thermal_conductivity": {
"value": "polynomial.Polynomial([402, -7.08e-2, 2.46e-6])(temperature_in_C)",
"value": "polynomial.Polynomial([402, -7.08e-2, 2.46e-6])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 1000,
"reference": "ITER_D_222RLN v3.3 Equation 86"
},
"specific_heat": {
"value": "polynomial.Polynomial([387, 6.35e-2, 4.36e-5])(temperature_in_C)",
"value": "polynomial.Polynomial([387, 6.35e-2, 4.36e-5])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 1000,
"reference": "ITER_D_222RLN v3.3 Equation 87"
},
"minimum_yield_stress": {
"value": "polynomial.Polynomial([584, -5.04e-2, -5e-6])(temperature_in_C)",
"value": "polynomial.Polynomial([584, -5.04e-2, -5e-6])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 950,
"reference": "ITER_D_222RLN v3.3 Equation 91"
},
"minimum_ultimate_tensile_stress": {
"value": "polynomial.Polynomial([212, -2.94e-1, 8.17e-5])(temperature_in_C)",
"value": "polynomial.Polynomial([212, -2.94e-1, 8.17e-5])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 950,
"reference": "ITER_D_222RLN v3.3 Equation 92"
Expand Down Expand Up @@ -195,25 +195,25 @@
},
"poissons_ratio": 0.33,
"youngs_modulus": {
"value": "polynomial.Polynomial([128, -2.59e-2, -4.87e-5])(temperature_in_C)",
"value": "polynomial.Polynomial([128, -2.59e-2, -4.87e-5])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 700,
"reference": "ITER_D_222RLN v3.3 Equation 96"
},
"coefficient_thermal_expansion": {
"value": "interp(temperature_in_C, [20, 50, 100, 150, 200, 250, 300, 400, 450, 500, 550, 600], [16.7, 17, 17.3, 17.5, 17.7, 17.8, 18, 18.1, 18.2, 18.4, 18.5, 18.6])",
"value": "interp(to_celsius(temperature), [20, 50, 100, 150, 200, 250, 300, 400, 450, 500, 550, 600], [16.7, 17, 17.3, 17.5, 17.7, 17.8, 18, 18.1, 18.2, 18.4, 18.5, 18.6])",
"temp_min_celsius": 20,
"temp_max_celsius": 600,
"reference": "ITER_D_222RLN v3.3 Table A.S31.2.1-1"
},
"density": {
"value": "8900 * (1 - 3e-6 * (temperature_in_C - 20) * polynomial.Polynomial([16.6, 6.24e-3, -9.05e-6, 7.2e-9])(temperature_in_C))",
"value": "8900 * (1 - 3e-6 * (to_celsius(temperature) - 20) * polynomial.Polynomial([16.6, 6.24e-3, -9.05e-6, 7.2e-9])(to_celsius(temperature)))",
"temp_min_celsius": 20,
"temp_max_celsius": 700,
"reference": "ITER_D_222RLN v3.3 Equation 97"
},
"thermal_conductivity": {
"value": "polynomial.Polynomial([323, -1.38e-1, -2.83e-4, 2.11e-7])(temperature_in_C)",
"value": "polynomial.Polynomial([323, -1.38e-1, -2.83e-4, 2.11e-7])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 700,
"reference": "ITER_D_222RLN v3.3 Equation 98"
Expand Down Expand Up @@ -255,31 +255,31 @@
},
"poissons_ratio": 0.33,
"coefficient_thermal_expansion": {
"value": "polynomial.Polynomial([3.9225, 5.8352e-4, 5.7054e-11, -2.0463e-14])(temperature_in_C)",
"value": "polynomial.Polynomial([3.9225, 5.8352e-4, 5.7054e-11, -2.0463e-14])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 1200,
"reference": "ITER_D_222RLN v3.3 Equation 135"
},
"youngs_modulus": {
"value": "polynomial.Polynomial([397.903, -2.3066e-3, -2.7162e-5])(temperature_in_C)",
"value": "polynomial.Polynomial([397.903, -2.3066e-3, -2.7162e-5])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 800,
"reference": "ITER_D_222RLN v3.3 Equation 136"
},
"density": {
"value": "1000 * polynomial.Polynomial([19.3027, -2.3786e-4, -2.2448e-8])(temperature_in_C)",
"value": "1000 * polynomial.Polynomial([19.3027, -2.3786e-4, -2.2448e-8])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 1200,
"reference": "ITER_D_222RLN v3.3 Equation 137"
},
"thermal_conductivity": {
"value": "polynomial.Polynomial([174.9274, -0.1067, 5.0067e-5, -7.8349e-9])(temperature_in_C)",
"value": "polynomial.Polynomial([174.9274, -0.1067, 5.0067e-5, -7.8349e-9])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 1000,
"reference": "ITER_D_222RLN v3.3 Equation 138"
},
"specific_heat": {
"value": "polynomial.Polynomial([128.308, 3.2797e-2, -3.4097e-6])(temperature_in_C)",
"value": "polynomial.Polynomial([128.308, 3.2797e-2, -3.4097e-6])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 1000,
"reference": "ITER_D_222RLN v3.3 Equation 139"
Expand All @@ -298,43 +298,43 @@
},
"poissons_ratio": 0.1,
"coefficient_thermal_expansion": {
"value": "polynomial.Polynomial([11.3, 1.33e-2, -1.2e-5, 4.1e-9])(temperature_in_C)",
"value": "polynomial.Polynomial([11.3, 1.33e-2, -1.2e-5, 4.1e-9])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 1000,
"reference": "ITER_D_222RLN v3.3 Equation 127"
},
"youngs_modulus": {
"value": "polynomial.Polynomial([306.78, -2.9281e-2, -4.5069e-5])(temperature_in_C)",
"value": "polynomial.Polynomial([306.78, -2.9281e-2, -4.5069e-5])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 800,
"reference": "ITER_D_222RLN v3.3 Equation 128"
},
"density": {
"value": "1830 * (1 - 3e-6 * (temperature_in_C - 20) * polynomial.Polynomial([11.3, 1.33e-2, -1.2e-5, 4.1e-9])(temperature_in_C))",
"value": "1830 * (1 - 3e-6 * (to_celsius(temperature) - 20) * polynomial.Polynomial([11.3, 1.33e-2, -1.2e-5, 4.1e-9])(to_celsius(temperature)))",
"temp_min_celsius": 20,
"temp_max_celsius": 800,
"reference": "ITER_D_222RLN v3.3 Equation 129"
},
"thermal_conductivity": {
"value": "polynomial.Polynomial([209, -4.8e-1, 9.38e-4, -9.37e-7, 3.34e-10])(temperature_in_C)",
"value": "polynomial.Polynomial([209, -4.8e-1, 9.38e-4, -9.37e-7, 3.34e-10])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 800,
"reference": "ITER_D_222RLN v3.3 Equation 130"
},
"specific_heat": {
"value": "interp(temperature_in_C, [20, 100, 200, 300, 400, 500, 600, 700, 800], [1807, 2046, 2295, 2497, 2660, 2791, 2998, 2989, 3071])",
"value": "interp(to_celsius(temperature), [20, 100, 200, 300, 400, 500, 600, 700, 800], [1807, 2046, 2295, 2497, 2660, 2791, 2998, 2989, 3071])",
"temp_min_celsius": 20,
"temp_max_celsius": 500,
"reference": "ITER_D_222RLN v3.3 Table A.A01.2.6-1"
},
"minimum_yield_stress": {
"value": "polynomial.Polynomial([252.2, -1.524e-1, -1.45e-4])(temperature_in_C)",
"value": "polynomial.Polynomial([252.2, -1.524e-1, -1.45e-4])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 650,
"reference": "ITER_D_222RLN v3.3 Equation 131"
},
"minimum_ultimate_tensile_stress": {
"value": "polynomial.Polynomial([392.8, -3.023e-1, -2.011e-4])(temperature_in_C)",
"value": "polynomial.Polynomial([392.8, -3.023e-1, -2.011e-4])(to_celsius(temperature))",
"temp_min_celsius": 20,
"temp_max_celsius": 950,
"reference": "ITER_D_222RLN v3.3 Equation 132"
Expand Down
2 changes: 1 addition & 1 deletion tests/materials/test_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_t_tmp(self):
pytest.importorskip("openmc")
s = make_serpent_material(self.SS_316)
assert " tmp 293.15 " in s.splitlines()[0]
self.SS_316.temperature_in_K = 400
self.SS_316.temperature = 400
s = make_serpent_material(self.SS_316)
assert " tmp 400 " in s.splitlines()[0]

Expand Down

0 comments on commit a6d1a53

Please sign in to comment.