Set different temperature at different boundaries

Hi all,
I’m trying to set different temperature at different boundaries, the code is shown below. From the view by Paraview, it seems that DirichletBC of temperature will be overrided by my_model.T = F.Temperature(873), which means the temperature is 873 K everywhere while what I expect is that the temperature at id_W_Yupper is 1200 K and id_CuCrZr_inner is 373 K.

my_model.T = F.Temperature(873)

boundary_conditions = [
    F.DirichletBC(field="T", value=1200, surfaces=id_W_Yupper),
    F.DirichletBC(field="T", value=373, surfaces=id_CuCrZr_inner),
]
my_model.boundary_conditions.extend(boundary_conditions)

View by Paraview:
image

If my_model.T = F.Temperature(873) is deleted, the simulation will have no ‘source’. So how can I make 1200 K at id_W_Yupper and 373 K at id_CuCrZr_inner be the source of my model?

Thank you!

Hi Xin,

Consider using the HeatTransferProblem class instead of Temperature(). See this section of the User Guide for more information.

Thanks a lot! I’ll try.