File size: 675 Bytes
cdcc0fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import torch

from input_builder import cylinder_mask, from_pack
from modeling import denormalize, load_model

model = load_model(".")

mask = cylinder_mask(rows=3, cols=4, radius_frac=0.4)
x = from_pack(
    mask,
    current_A=40.0,
    soc=0.3,
    R0_ohm=0.02,
    k_cell_W_mK=20.0,
    k_coolant_W_mK=0.6,
    h_conv_W_m2K=80.0,
    T_amb_degC=25.0,
    domain_L_m=0.08,
)

with torch.no_grad():
    T = denormalize(model(x))[0, 0]

hot = divmod(int(T.argmax()), T.shape[1])
print("temperature grid:", tuple(T.shape))
print("peak degC:", round(float(T.max()), 2))
print("mean degC:", round(float(T.mean()), 2))
print("hottest cell row,col:", [int(hot[0]), int(hot[1])])