-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspecific_heat.py
More file actions
34 lines (26 loc) · 1.05 KB
/
specific_heat.py
File metadata and controls
34 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 7 12:58:08 2026
@author: jarygau
"""
import numpy as np
def specific_heat_SST304L(T):
pass
def cp_material_dispatch(T, material_specific_heat):
"""
Returns specific heat [J/kg/K] for a given material as a function of temperature T [K].
Uses curve-fit polynomial in log10(T) for Al6061, SST304L, Cu_RRR20, or returns default 400.
"""
T = max(T, 1.0) # avoid log10(0)
if material_specific_heat == 'SST304L':
return 385 + 0.02 * (T - 300)
elif material_specific_heat == 'Al6061':
logT = np.log10(T)
# coefficients from your table for Cp fit
a,b,c,d,e,f,g,h,i = 46.6467, -314.292, 866.662, -1298.3, 1162.27, -637.795, 210.351, -38.3094, 2.96344
poly = a + b*logT + c*logT**2 + d*logT**3 + e*logT**4 + f*logT**5 + g*logT**6 + h*logT**7 + i*logT**8
return 10**poly
elif material_specific_heat == 'Cu_RRR20':
return 385 + 0.02 * (T - 300)
else:
return 400 # default fallback