In [ ]:
Copied!
# SPDX-FileCopyrightText: 2025-present The Bluemira Developers <https://github.com/Fusion-Power-Plant-Framework/bluemira>
#
# SPDX-License-Identifier: LGPL-2.1-or-later
"""An example to show the use of a matproplib material"""
# SPDX-FileCopyrightText: 2025-present The Bluemira Developers
#
# SPDX-License-Identifier: LGPL-2.1-or-later
"""An example to show the use of a matproplib material"""
In [ ]:
Copied!
import matplotlib.pyplot as plt
import numpy as np
from matproplib.conditions import OperationalConditions
from matproplib.library.copper import CryogenicCopper
import matplotlib.pyplot as plt
import numpy as np
from matproplib.conditions import OperationalConditions
from matproplib.library.copper import CryogenicCopper
Library Materials¶
We can import an existing material from the matproplib library. Here we use the
CryogenicCopper material, which is a collection of some material property
parameterisations, largely from NIST.
In [ ]:
Copied!
copper = CryogenicCopper()
copper = CryogenicCopper()
We can then set up some conditions at which we want to evaluate some material property. Here we take a look at the electrical resistivity of Copper in cryogenic conditions, which is senstive to temperature, magnetic field, and neutron fluence.
In [ ]:
Copied!
temperatures = np.linspace(4, 100, 50) # Temperatures from 4 K to 100 K
zero_fluence_conditions = [
OperationalConditions(temperature=t, magnetic_field=10.0, neutron_fluence=0.0)
for t in temperatures
]
resistivity_zero_fluence = [
copper.electrical_resistivity(c) for c in zero_fluence_conditions
]
fluence = 1e22
fluence_conditions = [
OperationalConditions(temperature=t, magnetic_field=10.0, neutron_fluence=fluence)
for t in temperatures
]
resistivity_fluence = [copper.electrical_resistivity(c) for c in fluence_conditions]
temperatures = np.linspace(4, 100, 50) # Temperatures from 4 K to 100 K
zero_fluence_conditions = [
OperationalConditions(temperature=t, magnetic_field=10.0, neutron_fluence=0.0)
for t in temperatures
]
resistivity_zero_fluence = [
copper.electrical_resistivity(c) for c in zero_fluence_conditions
]
fluence = 1e22
fluence_conditions = [
OperationalConditions(temperature=t, magnetic_field=10.0, neutron_fluence=fluence)
for t in temperatures
]
resistivity_fluence = [copper.electrical_resistivity(c) for c in fluence_conditions]
And simply plot the results.
In [ ]:
Copied!
f, ax = plt.subplots()
ax.plot(temperatures, resistivity_zero_fluence, label="fluence=0.0")
ax.plot(temperatures, resistivity_fluence, label=f"fluence={fluence:.1e}")
ax.legend()
ax.set_xlabel("Temperature (K)")
ax.set_ylabel("Electrical Resistivity (Ohm m)")
plt.show()
f, ax = plt.subplots()
ax.plot(temperatures, resistivity_zero_fluence, label="fluence=0.0")
ax.plot(temperatures, resistivity_fluence, label=f"fluence={fluence:.1e}")
ax.legend()
ax.set_xlabel("Temperature (K)")
ax.set_ylabel("Electrical Resistivity (Ohm m)")
plt.show()