Skip to content
Snippets Groups Projects
Commit 8aa69246 authored by Rahil Doshi's avatar Rahil Doshi
Browse files

Update tests

parent c6233b0f
No related branches found
No related tags found
No related merge requests found
Pipeline #77224 passed
......@@ -4,6 +4,7 @@ from importlib.resources import files
from pystencilssfg import SourceFileGenerator
from pymatlib.core.yaml_parser import create_alloy_from_yaml
from pymatlib.core.codegen.interpolation_array_container import InterpolationArrayContainer
from pymatlib.core.property_array_extractor import PropertyArrayExtractor
with SourceFileGenerator() as sfg:
......@@ -22,6 +23,11 @@ with SourceFileGenerator() as sfg:
sfg.generate(custom_container)
yaml_path = files('pymatlib.data.alloys.SS304L').joinpath('SS304L.yaml')
mat = create_alloy_from_yaml(yaml_path, u.center())
arr_container = InterpolationArrayContainer.from_material("SS304L", mat)
mat, temp_array = create_alloy_from_yaml(yaml_path, u.center())
array_extractor = PropertyArrayExtractor(mat, temp_array, u.center)
arr_container = InterpolationArrayContainer("SS304L", temp_array, array_extractor.energy_density_array)
sfg.generate(arr_container)
print(f"extractor.temperature_array: {array_extractor.temperature_array}")
# print(f"extractor.density_array: {array_extractor.density_array}")
print(f"extractor.specific_enthalpy_array: {array_extractor.specific_enthalpy_array}")
print(f"extractor.energy_density_array: {array_extractor.energy_density_array}")
......@@ -15,9 +15,9 @@ T = sp.Symbol('T')
# Get the path to the YAML file
current_file = Path(__file__)
yaml_path = current_file.parent.parent.parent / "src" / "pymatlib" / "data" / "alloys" / "SS304L" / "SS304L.yaml"
# yaml_path = current_file.parent.parent.parent / "src" / "pymatlib" / "data" / "alloys" / "SS304L" / "SS304L_comprehensive.yaml"
# Create alloy from YAML
ss316l = create_alloy_from_yaml(yaml_path, T)
ss316l, temp = create_alloy_from_yaml(yaml_path, T)
#ss316l_1 = create_alloy_from_yaml("SS304L_1.yaml", T)
# Test various properties
......@@ -48,4 +48,3 @@ print(f"Latent heat: {ss316l.latent_heat_of_fusion.evalf(T, test_temp)}")
# Test array generation for energy density
if hasattr(ss316l, 'energy_density_array'):
print(f"\nEnergy Density Array Shape: {ss316l.energy_density_array.shape}")
print(f"Energy Density Temperature Array Shape: {ss316l.energy_density_temperature_array.shape}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment