diff --git a/src/materials/alloys/Alloy.py b/src/materials/alloys/Alloy.py index 23726c14ece0eb4a20bf249637be4b0dff1b19a2..8b638106d9ec9b090857d2b6a0513d250ad89cc1 100644 --- a/src/materials/alloys/Alloy.py +++ b/src/materials/alloys/Alloy.py @@ -1,5 +1,5 @@ import numpy as np -from typing import List, Tuple, Union +from typing import List, Tuple from dataclasses import dataclass, field from src.materials.elements import Element, Ti, Al, V from src.materials.elements import interpolate_atomic_number, interpolate_atomic_mass, interpolate_temperature_boil @@ -123,4 +123,3 @@ if __name__ == '__main__': except Exception as e: print(f"An unexpected error occurred: {e}") - diff --git a/src/materials/alloys/SS316L/SS316L.py b/src/materials/alloys/SS316L/SS316L.py index df963b13528362e1c72739af4ad5d180e8a592d1..c79a425595e1781b202dff9599d4c0b6afbb4e6a 100644 --- a/src/materials/alloys/SS316L/SS316L.py +++ b/src/materials/alloys/SS316L/SS316L.py @@ -116,4 +116,4 @@ if __name__ == '__main__': heat_capacity = 600 # Example value for testing thermal_diffusivity = thermal_diffusivity_by_heat_conductivity( heat_conductivity, density, heat_capacity) - print(f"Calculated thermal diffusivity: {thermal_diffusivity}") \ No newline at end of file + print(f"Calculated thermal diffusivity: {thermal_diffusivity}") diff --git a/src/materials/interpolators.py b/src/materials/interpolators.py index 1a8b7341e26727a02e8a81eab79915f5b17e52f2..21b97788136949eccdd92a6b6b66440ed84d8072 100644 --- a/src/materials/interpolators.py +++ b/src/materials/interpolators.py @@ -226,18 +226,18 @@ if __name__ == '__main__': # Consistency Test print("\nConsistency Test between interpolate_lookup and interpolate_equidistant:") test_temps = [150.0, 200.0, 350.0, 450.0, 550.0, 650.0] - for T in test_temps: - lookup_result = interpolate_lookup(T, np.flip(np.array([600.0, 500.0, 400.0, 300.0, 200.0])), + for TT in test_temps: + lookup_result = interpolate_lookup(TT, np.flip(np.array([600.0, 500.0, 400.0, 300.0, 200.0])), np.array([10.0, 20.0, 30.0, 40.0, 50.0])) - equidistant_result = interpolate_equidistant(T, 200.0, 100.0, np.array([10.0, 20.0, 30.0, 40.0, 50.0])) - print(f"Temperature {T}:") + equidistant_result = interpolate_equidistant(TT, 200.0, 100.0, np.array([10.0, 20.0, 30.0, 40.0, 50.0])) + print(f"Temperature {TT}:") print(f"interpolate_lookup result: {lookup_result}") print(f"interpolate_equidistant result: {equidistant_result}") if isinstance(lookup_result, (int, float)) and isinstance(equidistant_result, (int, float)): - assert np.isclose(lookup_result, equidistant_result), f"Inconsistent results for T = {T}" + assert np.isclose(lookup_result, equidistant_result), f"Inconsistent results for T = {TT}" else: - print(f"Skipping comparison for symbolic or non-numeric result at T = {T}") + print(f"Skipping comparison for symbolic or non-numeric result at T = {TT}") symbolic_lookup_result = interpolate_lookup(Temp, density_temp_array1, density_v_array1) symbolic_equidistant_result = interpolate_equidistant(Temp, Temp_base, Temp_incr, density_v_array1) diff --git a/src/materials/models.py b/src/materials/models.py index 8a453662e1dbb8dab6d23ddce7825f13c531182f..cc1f1f088b2e9438f5ce29e39d7c5a9151661393 100644 --- a/src/materials/models.py +++ b/src/materials/models.py @@ -83,12 +83,12 @@ if __name__ == '__main__': # Test 5: Thermal diffusivity calculation with array values for heat conductivity k_a = np.linspace(30, 40, 3) print(f"Test 4a - Thermal diffusivity with array of heat conductivity: {thermal_diffusivity_by_heat_conductivity(k_a, rho, c_p)}") - # Expected output: Array of thermal diffusivities + # Expected output: Array of thermal diffusivity # Test 6: Thermal diffusivity with density calculated by thermal expansion calculated_densities = density_by_thermal_expansion(T_a, T_0, rho, tec) print(f"Test 4b - Thermal diffusivity with calculated densities: {thermal_diffusivity_by_heat_conductivity(k_a, calculated_densities, c_p)}") - # Expected output: Array of thermal diffusivities considering temperature-dependent density + # Expected output: Array of thermal diffusivity considering temperature-dependent density # Test 7: Symbolic computation for density with sympy Symbol temperature T_symbolic = sp.Symbol('T')