diff --git a/apps/HeatEquationKernelWithMaterial.py b/apps/HeatEquationKernelWithMaterial.py index 84ae961aa1430eec3aecc9ac15d007ba681c385f..95600b5a4602ade241c6c40bc2529f4386b6f14e 100644 --- a/apps/HeatEquationKernelWithMaterial.py +++ b/apps/HeatEquationKernelWithMaterial.py @@ -7,7 +7,7 @@ from importlib.resources import files # sys.path.append(walberla_dir) from pystencilssfg import SourceFileGenerator from sfg_walberla import Sweep -from pymatlib.data.alloys.SS316L import SS316L +from pymatlib.data.alloys.SS304L import SS304L from pymatlib.core.assignment_converter import assignment_converter from pymatlib.core.interpolators import InterpolationArrayContainer from pymatlib.core.yaml_parser import create_alloy_from_yaml @@ -26,23 +26,23 @@ with SourceFileGenerator() as sfg: heat_pde_discretized = discretize(heat_pde) heat_pde_discretized = heat_pde_discretized.args[1] + heat_pde_discretized.args[0].simplify() - # mat = SS316L.create_SS316L(u.center()) + # mat = SS304L.create_SS316L(u.center()) from pathlib import Path # Relative path to the package - #yaml_path = Path(__file__).parent.parent / "src" / "pymatlib" / "data" / "alloys" / "SS316L" / "SS304L.yaml" + #yaml_path = Path(__file__).parent.parent / "src" / "pymatlib" / "data" / "alloys" / "SS304L" / "SS304L.yaml" from importlib.resources import files # Access the YAML file as a package resource - yaml_path = files('pymatlib.data.alloys.SS316L').joinpath('SS304L.yaml') + yaml_path = files('pymatlib.data.alloys.SS304L').joinpath('SS304L.yaml') mat = create_alloy_from_yaml(yaml_path, u.center()) - # yaml_path_1 = files('pymatlib.data.alloys.SS316L').joinpath('SS304L_1.yaml') - # mat1 = create_alloy_from_yaml(str(yaml_path_1), u.center()) + # yaml_path_1 = files('pymatlib.data.alloys.SS304L').joinpath('SS304L_1.yaml') + # mat1 = create_alloy_from_yaml(yaml_path_1, u.center()) - # arr_container = DoubleLookupArrayContainer("SS316L", mat.temperature_array, mat.energy_density_array) - arr_container = InterpolationArrayContainer.from_material("SS316L", mat) + # arr_container = DoubleLookupArrayContainer("SS304L", mat.temperature_array, mat.energy_density_array) + arr_container = InterpolationArrayContainer.from_material("SS304L", mat) sfg.generate(arr_container) - # arr_container = InterpolationArrayContainer.from_material("SS316L_1", mat1) + # arr_container = InterpolationArrayContainer.from_material("SS304L_1", mat1) # sfg.generate(arr_container) # Convert assignments to pystencils format diff --git a/src/pymatlib/core/data_handler.py b/src/pymatlib/core/data_handler.py index a525f0acfe9539de9345e3d2bd68cd4ce82e9fa6..5d631e50158cabfcf73482a20b4ae19e7e24988c 100644 --- a/src/pymatlib/core/data_handler.py +++ b/src/pymatlib/core/data_handler.py @@ -595,7 +595,7 @@ if __name__ == '__main__': # Example usage: # 1. Using a file path base_dir = Path(__file__).parent # Directory of the current file - _file_path = str( base_dir / '..' / 'data' / 'alloys' / 'SS316L' / 'density_temperature.txt' ) + _file_path = str( base_dir / '..' / 'data' / 'alloys' / 'SS304L' / 'density_temperature.txt' ) min_temp, max_temp = find_min_max_temperature(_file_path) print(f"Minimum Temperature from file: {min_temp}") print(f"Maximum Temperature from file: {max_temp}") diff --git a/src/pymatlib/data/alloys/SS316L/304L_Erstarrungsdaten_edited.xlsx b/src/pymatlib/data/alloys/SS304L/304L_Erstarrungsdaten_edited.xlsx similarity index 100% rename from src/pymatlib/data/alloys/SS316L/304L_Erstarrungsdaten_edited.xlsx rename to src/pymatlib/data/alloys/SS304L/304L_Erstarrungsdaten_edited.xlsx diff --git a/src/pymatlib/data/alloys/SS316L/SS316L.py b/src/pymatlib/data/alloys/SS304L/SS304L.py similarity index 89% rename from src/pymatlib/data/alloys/SS316L/SS316L.py rename to src/pymatlib/data/alloys/SS304L/SS304L.py index c26da76560f50190bcc603758a72fc10240ed52d..4365cee291b565a3a028af52138025f6592eb55b 100644 --- a/src/pymatlib/data/alloys/SS316L/SS316L.py +++ b/src/pymatlib/data/alloys/SS304L/SS304L.py @@ -11,13 +11,13 @@ from pymatlib.core.data_handler import read_data_from_txt, celsius_to_kelvin, th from pymatlib.core.interpolators import interpolate_property, prepare_interpolation_arrays, interpolate_binary_search, interpolate_double_lookup -def create_SS316L(T: Union[float, sp.Symbol]) -> Alloy: +def create_SS304L(T: Union[float, sp.Symbol]) -> Alloy: """ - Creates an Alloy instance for SS316L stainless steel with specific properties. + Creates an Alloy instance for SS304L stainless steel with specific properties. Args: T (Union[float, sp.Symbol]): Temperature as a symbolic variable or numeric value. Returns: - Alloy: Initialized SS316L alloy with physical properties. + Alloy: Initialized SS304L alloy with physical properties. Notes: - **Material Properties**: - **Density**: 8.0 g/cm³ (8000 kg/m³) at room temperature @@ -45,7 +45,7 @@ def create_SS316L(T: Union[float, sp.Symbol]) -> Alloy: - heat_conductivity_temperature.txt Example: >>> T = sp.Symbol('T') - >>> ss316l = create_SS316L(T) + >>> ss316l = create_SS304L(T) >>> density_at_1000K = ss316l.density.evalf(T, 1000.0) """ # Define the alloy with specific elemental composition and phase transition temperatures @@ -56,7 +56,7 @@ def create_SS316L(T: Union[float, sp.Symbol]) -> Alloy: temperature_liquidus=1735., # Liquidus temperature in Kelvin (test at 1723.15 K = 1450 C) thermal_expansion_coefficient=16.3e-6 # in 1/K ) - # density_data_file_path = "/local/ca00xebo/repos/pymatlib/src/pymatlib/data/alloys/SS316L/density_temperature.txt" + # density_data_file_path = "/local/ca00xebo/repos/pymatlib/src/pymatlib/data/alloys/SS304L/density_temperature.txt" # Determine the base directory base_dir = Path(__file__).parent # Directory of the current file @@ -65,8 +65,8 @@ def create_SS316L(T: Union[float, sp.Symbol]) -> Alloy: density_data_file_path = str(base_dir / '304L_Erstarrungsdaten_edited.xlsx') # heat_capacity_data_file_path = str(base_dir / 'heat_capacity_temperature_edited.txt') heat_capacity_data_file_path = str(base_dir / '304L_Erstarrungsdaten_edited.xlsx') - heat_conductivity_data_file_path = str(base_dir / '..' / 'SS316L' / '304L_Erstarrungsdaten_edited.xlsx') - latent_heat_of_fusion_data_file_path = str(base_dir / '..' / 'SS316L' / '304L_Erstarrungsdaten_edited.xlsx') + heat_conductivity_data_file_path = str(base_dir / '..' / 'SS304L' / '304L_Erstarrungsdaten_edited.xlsx') + latent_heat_of_fusion_data_file_path = str(base_dir / '..' / 'SS304L' / '304L_Erstarrungsdaten_edited.xlsx') # Read temperature and material property data from the files # density_temp_array, density_array = read_data_from_txt(density_data_file_path) @@ -99,31 +99,31 @@ def create_SS316L(T: Union[float, sp.Symbol]) -> Alloy: SS316L.density = interpolate_property(T, density_temp_array, density_array) SS316L.heat_capacity = interpolate_property(T, heat_capacity_temp_array, heat_capacity_array) SS316L.thermal_diffusivity = thermal_diffusivity_by_heat_conductivity(SS316L.heat_conductivity, SS316L.density, SS316L.heat_capacity) - # SS316L.latent_heat_of_fusion = interpolate_property(T, SS316L.solidification_interval(), np.array([171401.0, 0.0])) + # SS304L.latent_heat_of_fusion = interpolate_property(T, SS304L.solidification_interval(), np.array([171401.0, 0.0])) SS316L.latent_heat_of_fusion = interpolate_property(T, latent_heat_of_fusion_temp_array, latent_heat_of_fusion_array) SS316L.specific_enthalpy = interpolate_property(T, density_temp_array, sp_enthalpy_array) SS316L.energy_density = energy_density_total_enthalpy(SS316L.density, SS316L.specific_enthalpy) SS316L.energy_density_solidus = SS316L.energy_density.evalf(T, SS316L.temperature_solidus) SS316L.energy_density_liquidus = SS316L.energy_density.evalf(T, SS316L.temperature_liquidus) - print("SS316L.heat_conductivity:", SS316L.heat_conductivity, "type:", type(SS316L.heat_conductivity)) - print("SS316L.density:", SS316L.density, "type:", type(SS316L.density)) - print("SS316L.heat_capacity:", SS316L.heat_capacity, "type:", type(SS316L.heat_capacity)) - print(f"SS316L.latent_heat_of_fusion: {SS316L.latent_heat_of_fusion}") - print(f"SS316L.energy_density: {SS316L.energy_density}") - print(f"SS316L.energy_density_solidus: {SS316L.energy_density_solidus}") - print(f"SS316L.energy_density_liquidus: {SS316L.energy_density_liquidus}") + print("SS304L.heat_conductivity:", SS316L.heat_conductivity, "type:", type(SS316L.heat_conductivity)) + print("SS304L.density:", SS316L.density, "type:", type(SS316L.density)) + print("SS304L.heat_capacity:", SS316L.heat_capacity, "type:", type(SS316L.heat_capacity)) + print(f"SS304L.latent_heat_of_fusion: {SS316L.latent_heat_of_fusion}") + print(f"SS304L.energy_density: {SS316L.energy_density}") + print(f"SS304L.energy_density_solidus: {SS316L.energy_density_solidus}") + print(f"SS304L.energy_density_liquidus: {SS316L.energy_density_liquidus}") - """print("SS316L.heat_conductivity@T_sol/T_liq:", SS316L.heat_conductivity.evalf(T, SS316L.temperature_solidus), SS316L.heat_conductivity.evalf(T, SS316L.temperature_liquidus)) - print("SS316L.density@T_sol/T_liq:", SS316L.density.evalf(T, SS316L.temperature_solidus), SS316L.density.evalf(T, SS316L.temperature_liquidus)) - print("SS316L.heat_capacity@T_sol/T_liq:", SS316L.heat_capacity.evalf(T, SS316L.temperature_solidus), SS316L.heat_capacity.evalf(T, SS316L.temperature_liquidus)) - print("SS316L.latent_heat_of_fusion@T_sol/T_liq:", SS316L.latent_heat_of_fusion.evalf(T, SS316L.temperature_solidus), SS316L.latent_heat_of_fusion.evalf(T, SS316L.temperature_liquidus)) - print("SS316L.energy_density@T_sol/T_liq:", SS316L.energy_density.evalf(T, SS316L.temperature_solidus), SS316L.energy_density.evalf(T, SS316L.temperature_liquidus))""" + """print("SS304L.heat_conductivity@T_sol/T_liq:", SS304L.heat_conductivity.evalf(T, SS304L.temperature_solidus), SS304L.heat_conductivity.evalf(T, SS304L.temperature_liquidus)) + print("SS304L.density@T_sol/T_liq:", SS304L.density.evalf(T, SS304L.temperature_solidus), SS304L.density.evalf(T, SS304L.temperature_liquidus)) + print("SS304L.heat_capacity@T_sol/T_liq:", SS304L.heat_capacity.evalf(T, SS304L.temperature_solidus), SS304L.heat_capacity.evalf(T, SS304L.temperature_liquidus)) + print("SS304L.latent_heat_of_fusion@T_sol/T_liq:", SS304L.latent_heat_of_fusion.evalf(T, SS304L.temperature_solidus), SS304L.latent_heat_of_fusion.evalf(T, SS304L.temperature_liquidus)) + print("SS304L.energy_density@T_sol/T_liq:", SS304L.energy_density.evalf(T, SS304L.temperature_solidus), SS304L.energy_density.evalf(T, SS304L.temperature_liquidus))""" """c_p = [] density_temp_array = np.array(density_temp_array) for temp in density_temp_array: - cp = SS316L.heat_capacity.evalf(T, temp) + cp = SS304L.heat_capacity.evalf(T, temp) c_p.append(cp) c_p_array = np.array(c_p) print(c_p_array)""" @@ -151,9 +151,9 @@ def create_SS316L(T: Union[float, sp.Symbol]) -> Alloy: print("----------" * 10) args = (SS316L.temperature_array, - # SS316L.energy_density_solidus, # 9744933767.272629 - # SS316L.energy_density_liquidus, # 11789781961.769783 - # SS316L.energy_density.evalf(T, SS316L.temperature_liquidus), # T_star: 1743.1412643772671, expected T_star: 1723.15 + # SS304L.energy_density_solidus, # 9744933767.272629 + # SS304L.energy_density_liquidus, # 11789781961.769783 + # SS304L.energy_density.evalf(T, SS304L.temperature_liquidus), # T_star: 1743.1412643772671, expected T_star: 1723.15 11789781961.76978, SS316L.energy_density_array) # energy density has the same value for both temperatures >> function is not monotonically increasing @@ -413,28 +413,28 @@ def create_SS316L(T: Union[float, sp.Symbol]) -> Alloy: T_dbte = sp.Symbol('T_dbte') print(f"density_1.evalf:\n{density_1.evalf(T, density_temp_array)}") - # SS316L.thermal_diffusivity = diffusivity_1 + # SS304L.thermal_diffusivity = diffusivity_1 # Perform interpolation for each property print('density') - # SS316L.density = interpolate_property(T, density_temp_array, density_array) - print('SS316L.density: ', SS316L.density) + # SS304L.density = interpolate_property(T, density_temp_array, density_array) + print('SS304L.density: ', SS316L.density) print('heat_capacity') - # SS316L.heat_capacity = interpolate_property(T, heat_capacity_temp_array, heat_capacity_array) + # SS304L.heat_capacity = interpolate_property(T, heat_capacity_temp_array, heat_capacity_array) print('heat_conductivity') - # SS316L.heat_conductivity = interpolate_property(T, heat_conductivity_temp_array, heat_conductivity_array) + # SS304L.heat_conductivity = interpolate_property(T, heat_conductivity_temp_array, heat_conductivity_array) # Calculate thermal diffusivity from thermal conductivity, density, and heat capacity print('thermal_diffusivity') - # print("SS316L.heat_conductivity.evalf(T, density_temp_array):", SS316L.heat_conductivity.evalf(T, density_temp_array)) + # print("SS304L.heat_conductivity.evalf(T, density_temp_array):", SS304L.heat_conductivity.evalf(T, density_temp_array)) SS316L.thermal_diffusivity = thermal_diffusivity_by_heat_conductivity(SS316L.heat_conductivity, SS316L.density, SS316L.heat_capacity) - # print('SS316L.heat_conductivity.evalf(T, density_temp_array): ', (SS316L.heat_conductivity.evalf(T, density_temp_array))) # <class 'numpy.ndarray'> - # print('SS316L.density.expr: ', type(SS316L.density.expr)) # <class 'sympy.core.mul.Mul'> - # print('SS316L.heat_capacity.evalf(T, heat_conductivity_temp_array): ', (SS316L.heat_capacity.evalf(T, heat_conductivity_temp_array))) # <class 'numpy.ndarray'> - print('SS316L.thermal_diffusivity: ', SS316L.thermal_diffusivity) - print('SS316L.thermal_diffusivity.evalf(T, 2003.15): ', (SS316L.thermal_diffusivity.evalf(T, density_temp_array))) + # print('SS304L.heat_conductivity.evalf(T, density_temp_array): ', (SS304L.heat_conductivity.evalf(T, density_temp_array))) # <class 'numpy.ndarray'> + # print('SS304L.density.expr: ', type(SS304L.density.expr)) # <class 'sympy.core.mul.Mul'> + # print('SS304L.heat_capacity.evalf(T, heat_conductivity_temp_array): ', (SS304L.heat_capacity.evalf(T, heat_conductivity_temp_array))) # <class 'numpy.ndarray'> + print('SS304L.thermal_diffusivity: ', SS316L.thermal_diffusivity) + print('SS304L.thermal_diffusivity.evalf(T, 2003.15): ', (SS316L.thermal_diffusivity.evalf(T, density_temp_array))) print("----------" * 10) return SS316L @@ -442,13 +442,13 @@ def create_SS316L(T: Union[float, sp.Symbol]) -> Alloy: if __name__ == '__main__': Temp = sp.Symbol('T') - alloy = create_SS316L(Temp) + alloy = create_SS304L(Temp) # Print the composition of each element in the alloy for i in range(len(alloy.composition)): print(f"Element {alloy.elements[i]}: {alloy.composition[i]}") - print("\nTesting SS316L with symbolic temperature:") + print("\nTesting SS304L with symbolic temperature:") for field in vars(alloy): print(f"{field} = {alloy.__getattribute__(field)}") diff --git a/src/pymatlib/data/alloys/SS316L/SS304L.yaml b/src/pymatlib/data/alloys/SS304L/SS304L.yaml similarity index 100% rename from src/pymatlib/data/alloys/SS316L/SS304L.yaml rename to src/pymatlib/data/alloys/SS304L/SS304L.yaml diff --git a/src/pymatlib/data/alloys/SS316L/SS304L_1.yaml b/src/pymatlib/data/alloys/SS304L/SS304L_1.yaml similarity index 100% rename from src/pymatlib/data/alloys/SS316L/SS304L_1.yaml rename to src/pymatlib/data/alloys/SS304L/SS304L_1.yaml diff --git a/src/pymatlib/data/alloys/SS316L/__init__.py b/src/pymatlib/data/alloys/SS304L/__init__.py similarity index 100% rename from src/pymatlib/data/alloys/SS316L/__init__.py rename to src/pymatlib/data/alloys/SS304L/__init__.py diff --git a/src/pymatlib/data/alloys/SS316L/density_temperature.txt b/src/pymatlib/data/alloys/SS304L/density_temperature.txt similarity index 100% rename from src/pymatlib/data/alloys/SS316L/density_temperature.txt rename to src/pymatlib/data/alloys/SS304L/density_temperature.txt diff --git a/src/pymatlib/data/alloys/SS316L/density_temperature_edited.txt b/src/pymatlib/data/alloys/SS304L/density_temperature_edited.txt similarity index 100% rename from src/pymatlib/data/alloys/SS316L/density_temperature_edited.txt rename to src/pymatlib/data/alloys/SS304L/density_temperature_edited.txt diff --git a/src/pymatlib/data/alloys/SS316L/heat_capacity_temperature.txt b/src/pymatlib/data/alloys/SS304L/heat_capacity_temperature.txt similarity index 100% rename from src/pymatlib/data/alloys/SS316L/heat_capacity_temperature.txt rename to src/pymatlib/data/alloys/SS304L/heat_capacity_temperature.txt diff --git a/src/pymatlib/data/alloys/SS316L/heat_capacity_temperature_edited.txt b/src/pymatlib/data/alloys/SS304L/heat_capacity_temperature_edited.txt similarity index 100% rename from src/pymatlib/data/alloys/SS316L/heat_capacity_temperature_edited.txt rename to src/pymatlib/data/alloys/SS304L/heat_capacity_temperature_edited.txt diff --git a/src/pymatlib/data/alloys/SS316L/heat_conductivity_temperature.txt b/src/pymatlib/data/alloys/SS304L/heat_conductivity_temperature.txt similarity index 100% rename from src/pymatlib/data/alloys/SS316L/heat_conductivity_temperature.txt rename to src/pymatlib/data/alloys/SS304L/heat_conductivity_temperature.txt diff --git a/tests/cpp/TestArrayContainer.py b/tests/cpp/TestArrayContainer.py index a20d260637c211345334af2fed0b3be8d708f24d..8fc49760bbba61743ae2cabc84cde4b6a7d3c39f 100644 --- a/tests/cpp/TestArrayContainer.py +++ b/tests/cpp/TestArrayContainer.py @@ -21,7 +21,7 @@ with SourceFileGenerator() as sfg: custom_container = InterpolationArrayContainer("DoubleLookupTests", np.flip(T_eq), np.flip(E_neq)) sfg.generate(custom_container) - yaml_path = files('pymatlib.data.alloys.SS316L').joinpath('SS304L.yaml') + yaml_path = files('pymatlib.data.alloys.SS304L').joinpath('SS304L.yaml') mat = create_alloy_from_yaml(yaml_path, u.center()) - arr_container = InterpolationArrayContainer.from_material("SS316L", mat) + arr_container = InterpolationArrayContainer.from_material("SS304L", mat) sfg.generate(arr_container) diff --git a/tests/legacy/test_interpolate_functs_perf.py b/tests/legacy/test_interpolate_functs_perf.py index b9266a804d2de0df051d1bffc175f36ba8a8c428..d2c26399c01c9fa6524797445b1e6f5d6fdb64aa 100644 --- a/tests/legacy/test_interpolate_functs_perf.py +++ b/tests/legacy/test_interpolate_functs_perf.py @@ -97,8 +97,8 @@ def create_alloy(T: Union[float, sp.Symbol]) -> Alloy: base_dir = Path(__file__).parent # Paths to data files using relative paths - density_data_file_path = str(base_dir/'..'/'data'/'alloys'/'SS316L'/'density_temperature_edited.txt') - heat_capacity_data_file_path = str(base_dir/'..'/'data'/'alloys'/'SS316L'/'heat_capacity_temperature_edited.txt') + density_data_file_path = str(base_dir/'..'/'data'/'alloys'/'SS304L'/'density_temperature_edited.txt') + heat_capacity_data_file_path = str(base_dir/'..'/'data'/'alloys'/'SS304L'/'heat_capacity_temperature_edited.txt') # Read temperature and material property data from the files density_temp_array, density_array = read_data(density_data_file_path) @@ -173,7 +173,7 @@ def create_alloy(T: Union[float, sp.Symbol]) -> Alloy: raise ValueError(f"Mismatch value. Temperature value should be {alloy.temperature_liquidus}") E_target_alloy = generate_target_points(float(alloy.energy_density_array[0]), float(alloy.energy_density_array[-1]), 1_000) - compare_interpolation_methods(E_target_alloy, T_eq, E_neq, E_eq, inv_delta_E_eq, idx_map, 'SS316L') + compare_interpolation_methods(E_target_alloy, T_eq, E_neq, E_eq, inv_delta_E_eq, idx_map, 'SS304L') def measure_performance(iterations=1): all_execution_times = np.zeros(iterations) diff --git a/tests/python/test_alloy.py b/tests/python/test_alloy.py index 8477a9517042c229795d9813c2eb5dca02984e6a..cfbb44cfe278a952fa659fe4d5ee29b765025e56 100644 --- a/tests/python/test_alloy.py +++ b/tests/python/test_alloy.py @@ -3,7 +3,7 @@ import numpy as np import sympy as sp from pymatlib.core.alloy import Alloy, AlloyCompositionError, AlloyTemperatureError from pymatlib.data.element_data import Ti, Al, V, Fe, Cr, Mn, Ni -from src.pymatlib.data.alloys.SS316L.SS316L import create_SS316L +from src.pymatlib.data.alloys.SS304L.SS304L import create_SS304L from src.pymatlib.core.typedefs import MaterialProperty def test_alloy_creation(): @@ -22,9 +22,9 @@ def test_alloy_creation(): Alloy(elements=[Fe, Cr, Mn, Ni], composition=[0.7, 0.2, 0.05, 0.05], temperature_solidus=1900., temperature_liquidus=1800.) def test_create_SS316L(): - """Test the creation and properties of SS316L alloy.""" + """Test the creation and properties of SS304L alloy.""" # Test with float temperature input - alloy = create_SS316L(1400.0) + alloy = create_SS304L(1400.0) # Check if properties are set and have correct types assert hasattr(alloy, 'density') @@ -40,7 +40,7 @@ def test_create_SS316L(): # Test with symbolic temperature input T = sp.Symbol('T') - alloy_symbolic = create_SS316L(T) + alloy_symbolic = create_SS304L(T) # Check symbolic properties assert alloy_symbolic.density is not None @@ -55,7 +55,7 @@ def test_create_SS316L(): assert isinstance(float(alloy.thermal_diffusivity.expr), float) def test_create_SS316L2(): - alloy = create_SS316L(1400.0) + alloy = create_SS304L(1400.0) # Check if density exists and has the correct type assert hasattr(alloy, 'density') @@ -70,14 +70,14 @@ def test_alloy_single_element(): def test_alloy_property_modification(): # Test accessing and modifying individual alloy properties - alloy = create_SS316L(1400.0) + alloy = create_SS304L(1400.0) # assert isinstance(alloy.density, MaterialProperty) # Set the density to a MaterialProperty instance with a constant expression alloy.density = MaterialProperty(expr=sp.Float(8000.0)) assert alloy.density.expr == sp.Float(8000.0) '''def test_create_SS316L_invalid_temperature(): - # Test creating SS316L alloy with invalid temperature inputs + # Test creating SS304L alloy with invalid temperature inputs with pytest.raises(ValueError): create_SS316L(-100.0) # Negative temperature with pytest.raises(ValueError): diff --git a/tests/python/test_yaml_config.py b/tests/python/test_yaml_config.py index ae3ef0877fa4ce8cfe02bc2bae95babebc4902b9..a699cd1e9711719477de31cc370476a35a5c7cca 100644 --- a/tests/python/test_yaml_config.py +++ b/tests/python/test_yaml_config.py @@ -14,7 +14,7 @@ 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" / "SS316L" / "SS304L.yaml" +yaml_path = current_file.parent.parent.parent / "src" / "pymatlib" / "data" / "alloys" / "SS304L" / "SS304L.yaml" # Create alloy from YAML ss316l = create_alloy_from_yaml(yaml_path, T) @@ -30,7 +30,7 @@ for i in range(len(ss316l.composition)): print(f"\nSolidus Temperature: {ss316l.temperature_solidus}") print(f"Liquidus Temperature: {ss316l.temperature_liquidus}") -print("\nTesting SS316L with symbolic temperature:") +print("\nTesting SS304L with symbolic temperature:") for field in vars(ss316l): print(f"{field} = {ss316l.__getattribute__(field)}")