# Heat-Exchange Tutorial in PreCICE

**URL:** <https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031>\
**Category:** Official adapters and tutorials\
**Tags:** openfoam, configuration, calculix\
**Created:** [April 24, 2022, 3:21pm UTC](https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031 "2022-04-24T15:21:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tianhk](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tianhk](https://precice.discourse.group/u/tianhk)\
**Post date:** [April 24, 2022, 3:21pm UTC](https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031/1 "2022-04-24T15:21:04Z")

</div>

Hi, I’m having a problem running the heat-Exchange tutorial. The boundary condition given in the official tutorial is Robin-Robin because it is more stable. However, I wanted to try the fluid-Neumann and solid-Dirichlet boundaries. When I’m done setting it up, I run buoyantSimpleFoam in OpenFoam and this error happens.

 ![微信截图_20220424230422](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/8/892b4058c9b35a8917c1b900b0245d3846374961.png)  
 ![微信截图_20220424225855](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/a/acf02531904c8ae358ebcd8587247bdef453c7af.png)

Since less data is exchanged, I only define Temperature and Heat-Flux to be exchanged. But the precice-config.xml error left me confused, and I couldn’t figure out what was wrong with the definition. data: scalar means where have problems with the definition of the data being exchanged? Thank you!

 ![微信截图_20220424231041](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/2/2bb594aa59fd4d3b8830ecbe4979f27caaaeab9b.png)  
 ![微信截图_20220424231103](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/2/2c19996cb8a6a52a0c0b2cca6c5d6e34761cce7b.png)  
 ![微信截图_20220424231429](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/a/a3e434db6682e69b2078077171d604db8462271d.png)

---

<div class="post-metadata">

**Author:** ![ajaust](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ajaust/32/160_2.png) [@ajaust](https://precice.discourse.group/u/ajaust)\
**Post date:** [April 25, 2022, 8:00am UTC](https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031/2 "2022-04-25T08:00:31Z")

</div>

When you want to define which data a mesh is using you should use the

```xml
<use-data name="{string}"/>

```

tag. Currently you are using

```xml
<data:scalar name="{string}"/>

```

which should not be used within the `<mesh>` tags. You can find more information about this in the [XML reference about defining data on meshes](https://precice.org/configuration-xml-reference.html#mesh).

---

<div class="post-metadata">

**Author:** ![tianhk](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tianhk](https://precice.discourse.group/u/tianhk)\
**Post date:** [April 26, 2022, 3:00pm UTC](https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031/3 "2022-04-26T15:00:01Z")

</div>

> [@ajaust](#):
>
> `use-data`

Thank you for your advice! It was my carelessness that led to the problem.

---

<div class="post-metadata">

**Author:** ![ajaust](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ajaust/32/160_2.png) [@ajaust](https://precice.discourse.group/u/ajaust)\
**Post date:** [April 26, 2022, 3:41pm UTC](https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031/4 "2022-04-26T15:41:23Z")

</div>

No worries. I am glad it was so easy to fix. 🙂

---

<div class="post-metadata">

**Author:** ![tianhk](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tianhk](https://precice.discourse.group/u/tianhk)\
**Post date:** [April 28, 2022, 2:08pm UTC](https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031/5 "2022-04-28T14:08:38Z")

</div>

Hello, the above problem has been solved. But here comes a new problem. I have checked several times, but I still don’t know the source of the problem. Can you help me see what’s wrong with it?  
For the heat-exchangr tutorials, I want to exchange Temperature and heat-flux on the two interfaces (Inner-interface and Outer-interface). The solid domain transmits heat-flux to the inner and outer fluid domains, and the inner and outer fluid domains transmit Temperature to the solid domain.  
The problem is shown below. And config.yml and precice-config.xml files are also shown.

 ![微信截图_20220428215416](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/3/364f9f1c9091f92d029eb4d84199d61b6484defc.png)

 ![微信截图_20220428220639](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/3/3b7e418d94a1bb54e104d4736998641656697e31.png)

 ![微信截图_20220428220702](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/8/8c97eb5044e29fcbe6ef724d766bf43aea858ed1.png)  
 ![微信截图_20220428220723](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/3/369b99afa0da0612590695a5fdf5cb0712048106.png)  
 ![微信截图_20220428220738](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/1/128a9f3207a5321477a417fc6d52f17eb84a753e.png)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [May 1, 2022, 2:09pm UTC](https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031/6 "2022-05-01T14:09:01Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![IshaanDesai](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ishaandesai/32/1048_2.png) [@IshaanDesai](https://precice.discourse.group/u/IshaanDesai)\
**Post date:** [May 5, 2022, 12:20pm UTC](https://precice.discourse.group/t/heat-exchange-tutorial-in-precice/1031/7 "2022-05-05T12:20:08Z")

</div>

@tianhk please open a new topic for the new problem so that we have a clear segregation of the discussion.
