<jupyter_start><jupyter_text>Part 4 - Changing materialsAs we saw in Part 3, the Neutronics Material Maker makes it easy to find the density of materials.It is important to account for material density correctly in neutronics simulations as the density of a material impacts the number density of atoms and therefore the neutronics reaction rate.Density is impacted by material properties such as temperature, enrichment and pressure.<jupyter_code># imports packages needed for the example

import numpy as np
import plotly.graph_objs as go

import neutronics_material_maker as nmm<jupyter_output><empty_output><jupyter_text>The following example calculates water density as a function of temperature (at constant pressure) using the Neutronics Material Maker. The Neutronics Material Maker uses the Python CoolProp package to do this.Using input parameters from the WCLL blanket, we will show density as a function of temperature over a large range (at constant pressure).WCLL input parameters:- pressure = 15.5 MPa- inlet temperature = 285 degrees C- outlet temperature = 325 degrees C<jupyter_code>temperatures = np.linspace(0.1, 600., 200)

water_densities = [nmm.Material('H2O', temperature_in_C=temperature, pressure_in_Pa=15500000).openmc_material.density for temperature in temperatures]

fig = go.Figure()

fig.add_trace(go.Scatter(
    x=temperatures,
    y=water_densities,
    mode='lines+markers',
    showlegend=False),
)

fig.update_layout(
    title="Water density as a function of temperature (at constant pressure)",
    xaxis_title="Temperature in C",
    yaxis_title="Density (g/cm3)"
)

fig.show()<jupyter_output><empty_output><jupyter_text>Similarly, the next example shows how Helium density changes as a function of pressure (at constant temperature).<jupyter_code>pressures = np.linspace(1000000., 10000000., 100)

helium_densities = [nmm.Material('He', temperature_in_C=400, pressure_in_Pa=pressure).openmc_material.density for pressure in pressures]

fig = go.Figure()

fig.add_trace(go.Scatter(
    x=pressures,
    y=helium_densities,
    mode='lines+markers',
    showlegend=False),
)

fig.update_layout(
    title="Helium density as a function of pressure (at constant temperature)",
    xaxis_title="Pressure in Pa",
    yaxis_title="Density (g/cm3)"
)

fig.show()<jupyter_output><empty_output><jupyter_text>This example shows how the density of a Lithium ceramic changes as a function of Lithium-6 enrichment.<jupyter_code>enrichments = np.linspace(0., 100., 50)

li4sio4_densities = [nmm.Material('Li4SiO4', enrichment=enrichment).openmc_material.density for enrichment in enrichments]

fig =go.Figure()

fig.add_trace(go.Scatter(
    x=enrichments,
    y=li4sio4_densities,
    mode='lines+markers',
    showlegend=False),
)

fig.update_layout(
    title="Lithium ceramic density as a function of Li-6 enrichment",
    xaxis_title="Li-6 enrichment",
    yaxis_title="Density (g/cm3)"
)

fig.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08676569885212694, 'fraction_numerical': 0.02261985145172181, 'mean_word_length': 5.540838852097131, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '78129', 'license': 'MIT', 'n_tokens_mistral': 986, 'n_tokens_neox': 895, 'n_words': 281, 'path': 'tasks/task_02_making_materials/4_example_materials_parameter_study.ipynb', 'repo_name': 'pshriwise/openmc_workshop', 'size': '2962'}