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

Add new yaml config for testing, update models and parser

parent 253e8181
Branches
Tags
No related merge requests found
Pipeline #75838 passed
...@@ -27,8 +27,8 @@ def wrapper(value: Union[sp.Expr, NumericType, ArrayTypes, MaterialProperty]) \ ...@@ -27,8 +27,8 @@ def wrapper(value: Union[sp.Expr, NumericType, ArrayTypes, MaterialProperty]) \
if isinstance(value, sp.Expr): if isinstance(value, sp.Expr):
return sp.simplify(value) return sp.simplify(value)
if isinstance(value, (float, np.int32, np.int64, np.float32, np.float64)): # np.floating if isinstance(value, (float, np.int32, np.int64, np.float32, np.float64)): # np.floating
if abs(value) < DEFAULT_TOLERANCE: # if abs(value) < DEFAULT_TOLERANCE:
return sp.Float(0.0) # return sp.Float(0.0)
return sp.Float(float(value)) return sp.Float(float(value))
if isinstance(value, ArrayTypes): # Handles lists, tuples, and arrays if isinstance(value, ArrayTypes): # Handles lists, tuples, and arrays
try: try:
......
...@@ -217,7 +217,7 @@ class MaterialConfigParser: ...@@ -217,7 +217,7 @@ class MaterialConfigParser:
raise ValueError(f"'{prop_name}' cannot be negative, got {prop_value}") raise ValueError(f"'{prop_name}' cannot be negative, got {prop_value}")
if prop_name == 'thermal_expansion_coefficient': if prop_name == 'thermal_expansion_coefficient':
if isinstance(prop_value, float) and prop_value < -3e-5 or prop_value > 0.001: if isinstance(prop_value, float) and (prop_value < -3e-5 or prop_value > 0.001):
raise ValueError(f"'thermal_expansion_coefficient' value {prop_value} is outside the expected range (-3e-5/K to 0.001/K)") raise ValueError(f"'thermal_expansion_coefficient' value {prop_value} is outside the expected range (-3e-5/K to 0.001/K)")
if prop_name == 'energy_density_temperature_array': if prop_name == 'energy_density_temperature_array':
......
name: SS304L_Comprehensive
composition:
Fe: 0.675
Cr: 0.170
Ni: 0.120
Mo: 0.025
Mn: 0.010
solidus_temperature: 1605
liquidus_temperature: 1735
properties:
# 1. Constant float property
density: 7950. # kg/m³
# 2.1 File-based property (simple format)
heat_conductivity: ./heat_conductivity_temperature.txt
# 2.2 File-based property (advanced format)
specific_enthalpy:
file: ./304L_Erstarrungsdaten_edited.xlsx
temp_col: T (K)
prop_col: Enthalpy (J/kg)
# 3.1 Key-val pair with explicit temperature list
heat_capacity:
key: [1000, 1200, 1400, 1600, 1800, 2000, 2200, 2400, 2600, 2800]
val: [580, 590, 600, 600, 600, 610, 620, 630, 660, 700]
# 3.2 Key-val pair with references to defined temperatures
latent_heat_of_fusion:
key: [solidus_temperature, liquidus_temperature]
val: [171401, 0]
# 3.3 Key-val pair with tuple for temperature generation (increment)
thermal_expansion_coefficient:
key: (300, 100) # Start at 300K and increment by 100K
val: [16.3e-6, 16.5e-6, 16.8e-6, 17.0e-6, 17.2e-6]
# 3.4 Key-val pair with tuple for temperature generation (decrement)
dynamic_viscosity:
key: (1735, -10) # Start at 1735K and decrement by 10K
val: [0.005, 0.006, 0.007, 0.008, 0.009]
# 4.1 Computed property (simple format)
thermal_diffusivity: compute # k/(rho*cp)
# 4.2 Computed property (advanced format with model selection)
energy_density:
compute: total_enthalpy
# Required for energy_density computation (with number of points)
# energy_density_temperature_array: (300, 3000, 541)
# Alternative specification (with temperature increment)
energy_density_temperature_array: (300, 3000, 5.0)
# Properties required for density computation by thermal expansion
base_temperature: 2273.
base_density: 6.591878918e3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment