# Non-isotermal two-phase flow: heterogeneous thermal properties

**URL:** <https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688>\
**Category:** Help & Support\
**Tags:** ogs6\
**Created:** [January 10, 2021, 9:12pm UTC](https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688 "2021-01-10T21:12:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lurpi](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/lurpi/32/470_2.png) [@lurpi](https://discourse.opengeosys.org/u/lurpi)\
**Post date:** [January 10, 2021, 9:12pm UTC](https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688/1 "2021-01-10T21:12:09Z")

</div>

Hi all,  
I am a bit confused by the \<material\_property\> definition block.  
With the “media/medium” definition, it is straightforward to define different thermal properties (i.e specific heat and thermal conductivity of the solid component) for different materials with ids defined in the mesh.  
With the \<porous\_media\> definition, specific heat and thermal conductivity of the solid are in the fluid block, which is the same for the complete domain (right?).  
Similarly, definiton of solid density is completely outside of these and \<porous\_medium\>.

Am I missing something in defining id=x somewhere in the properties?

---

<div class="post-metadata">

**Author:** ![dmitri.naumov](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/dmitri.naumov/32/561_2.png) [@dmitri.naumov](https://discourse.opengeosys.org/u/dmitri.naumov)\
**Post date:** [January 11, 2021, 1:08pm UTC](https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688/2 "2021-01-11T13:08:50Z")

</div>

Hi, I think the confusion is there because we didn’t finish transition from process-specific material models \<porous\_media\> to generic scheme in MPL \<media/medium\> for that (and some other processes).

Can you upload a “working” project here (or drop me a mail with NDA : ), then we might help you.

Yes, the fluid block is for the whole domain.

– Dima

PS: Now looking into the code, it (the process) might even not support multiple ids. We need to move to MPL asap.

@wenqing.wang do you know on how to set material properties for the ThermalTwoPhaseFlowWithPP process?

---

<div class="post-metadata">

**Author:** ![wenqing.wang](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/wenqing.wang/32/417_2.png) [@wenqing.wang](https://discourse.opengeosys.org/u/wenqing.wang)\
**Post date:** [January 11, 2021, 3:23pm UTC](https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688/3 "2021-01-11T15:23:54Z")

</div>

ThermalTwoPhaseFlowWithPP still uses the old material properties. In that implementation, the heterogeneous solid density is set as a Parameter instance of process class. You can define the element wise change density in vtu mesh and the give the input in `<Parameter>` as

```auto
         <parameter>
            <name>solid_density</name>
            <type>MeshElement</type>
            <field_name>s_density</field_name>
        </parameter>

```

where s\_density is the name of the vtu array of the element wise density value.

---

<div class="post-metadata">

**Author:** ![lurpi](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/lurpi/32/470_2.png) [@lurpi](https://discourse.opengeosys.org/u/lurpi)\
**Post date:** [January 11, 2021, 3:27pm UTC](https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688/4 "2021-01-11T15:27:21Z")

</div>

Thanks for the quick answer @dmitri.naumov . When moving to MPL, please remember that some benchmarks are defined with porous\_media

@wenqing.wang thanks for the fix. Would it work for specific\_heat\_capacity\_solid as well?

---

<div class="post-metadata">

**Author:** ![wenqing.wang](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/wenqing.wang/32/417_2.png) [@wenqing.wang](https://discourse.opengeosys.org/u/wenqing.wang)\
**Post date:** [January 11, 2021, 3:51pm UTC](https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688/5 "2021-01-11T15:51:23Z")

</div>

With current implementation, that does not work for `specific_heat_capacity_solid`, which was, I do not know why, implemented as fluid property. I hope that the material properties of that process and TwoPhaseFlowWithPPRho could be replaced with MPL early in this year. The replacement in TwoPhaseFlowWithPPRho was implemented ([GitHub - wenqing/ogs at pp\_rho\_MPL](https://github.com/wenqing/ogs/tree/pp_rho_MPL)) for a merging.

---

<div class="post-metadata">

**Author:** ![lurpi](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/lurpi/32/470_2.png) [@lurpi](https://discourse.opengeosys.org/u/lurpi)\
**Post date:** [January 11, 2021, 7:57pm UTC](https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688/6 "2021-01-11T19:57:32Z")

</div>

I will try with your branch, thanks.  
Unrelated question: I did not dig deep in the code, is the gas dissolution in the water phase computed (i.e. gas mass is present in solution, but liquid saturation = 1)?

---

<div class="post-metadata">

**Author:** ![wenqing.wang](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/wenqing.wang/32/417_2.png) [@wenqing.wang](https://discourse.opengeosys.org/u/wenqing.wang)\
**Post date:** [January 12, 2021, 8:11am UTC](https://discourse.opengeosys.org/t/non-isotermal-two-phase-flow-heterogeneous-thermal-properties/688/7 "2021-01-12T08:11:44Z")

</div>

The changes in my branch is only for TwoPhaseFlowWithPPRho, which does not contains thermal process.
