# Set different temperature at different boundaries

**URL:** <https://festim.discourse.group/t/set-different-temperature-at-different-boundaries/52>\
**Category:** User Support\
**Created:** [June 18, 2024, 7:54am UTC](https://festim.discourse.group/t/set-different-temperature-at-different-boundaries/52 "2024-06-18T07:54:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xinshen](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/xinshen/32/194_2.png) [@xinshen](https://festim.discourse.group/u/xinshen)\
**Post date:** [June 18, 2024, 7:54am UTC](https://festim.discourse.group/t/set-different-temperature-at-different-boundaries/52/1 "2024-06-18T07:54:38Z")

</div>

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.

```auto
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](https://global.discourse-cdn.com/free1/uploads/festim/original/1X/7fe9b6ff8c74e86cabdd22ee27c935118f334786.png)

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!

---

<div class="post-metadata">

**Author:** ![remidm](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/remidm/32/4_2.png) [@remidm](https://festim.discourse.group/u/remidm)\
**Post date:** [June 18, 2024, 11:45am UTC](https://festim.discourse.group/t/set-different-temperature-at-different-boundaries/52/2 "2024-06-18T11:45:33Z")

</div>

Hi Xin,

Consider using the `HeatTransferProblem` class instead of `Temperature()`. See [this section](https://festim.readthedocs.io/en/stable/userguide/temperature.html#from-a-heat-transfer-solver) of the User Guide for more information.

---

<div class="post-metadata">

**Author:** ![xinshen](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/xinshen/32/194_2.png) [@xinshen](https://festim.discourse.group/u/xinshen)\
**Post date:** [June 22, 2024, 1:04am UTC](https://festim.discourse.group/t/set-different-temperature-at-different-boundaries/52/3 "2024-06-22T01:04:25Z")

</div>

Thanks a lot! I’ll try.
