# Initial conditions in BHE simulation

**URL:** <https://discourse.opengeosys.org/t/initial-conditions-in-bhe-simulation/1394>\
**Category:** ogs-users\
**Created:** [March 30, 2024, 6:33pm UTC](https://discourse.opengeosys.org/t/initial-conditions-in-bhe-simulation/1394 "2024-03-30T18:33:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![saturngreen67](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/saturngreen67/32/1168_2.png) [@saturngreen67](https://discourse.opengeosys.org/u/saturngreen67)\
**Post date:** [March 30, 2024, 6:33pm UTC](https://discourse.opengeosys.org/t/initial-conditions-in-bhe-simulation/1394/1 "2024-03-30T18:33:14Z")

</div>

Hi everyone,

I am using OGS for BHE simulation. I have two questions.

1. I did a TH simulation and got the temperature and pressure in the mesh, and I want to use it as an initial condition for soil temperature. The problem is that once I define BHE as a physical curve, the temperature would take the Dirichlet BC of the surface all the way (10 degrees). I cannot also remove it as a physical entity in my mesh since I need it later for the BHE simulation. How can I rectify this problem?

2. How can I get the outlet temperature of the BHE?

Best regards,  
Farid

 ![Screenshot from 2024-03-30 18-03-52](https://discourse.opengeosys.org/uploads/default/original/2X/a/a29046f28b63f47a07ff392693ff0079f3254761.png)

---

<div class="post-metadata">

**Author:** ![M\_Jaeschke](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@M\_Jaeschke](https://discourse.opengeosys.org/u/M_Jaeschke)\
**Post date:** [April 2, 2024, 6:54am UTC](https://discourse.opengeosys.org/t/initial-conditions-in-bhe-simulation/1394/2 "2024-04-02T06:54:05Z")

</div>

Dear Farid,

thanks for your questions.

1. The initial condition can be set in the prj-file in the process variables section for every process variable. You need to define a parameter, which can be used to set the initial condition. There are various options, in your case the MeshNode type should be the right one.

```auto
<parameter>
     <name>T0_Soil</name>
     <type>MeshNode</type>
     <mesh>SOIL_Initial</mesh>
     <field_name>temperature_soil</field_name>
</parameter>

```

If you want to set a Dirichlet BC at the top surface of the model, the BHE should not start at a node in the top surface. Let the BHE begin in a depth of -1m or so and everything runs well.

1. At every BHE-Node you will get a vector of the BHE-Temperatures. For 1U there are 4 Temperatures: {BHE\_inflow, BHE\_outflow, BHE\_grout\_1, BHE\_grout\_2}.  
For 2U there 8 temperatures: {BHE\_inflow\_1, BHE\_inflow\_2, BHE\_outflow\_1, BHE\_outflow\_2, BHE\_grout\_1, BHE\_grout\_2, BHE\_grout\_3, BHE\_grout\_4}.

Best regards,  
Max

---

<div class="post-metadata">

**Author:** ![saturngreen67](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/saturngreen67/32/1168_2.png) [@saturngreen67](https://discourse.opengeosys.org/u/saturngreen67)\
**Post date:** [April 2, 2024, 7:13am UTC](https://discourse.opengeosys.org/t/initial-conditions-in-bhe-simulation/1394/3 "2024-04-02T07:13:37Z")

</div>

Dear Max,

Thank you very much for your response. I got it working during the holidays. But I encountered another problem. I wanted to make density of the fluid in the formation as a function of temperature but I got the error that “temperature\_soil” is not a defined variable while it is definitely defined as a process variable. Do you know how that can be solved?

Best regards,  
Farid

---

<div class="post-metadata">

**Author:** ![M\_Jaeschke](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@M\_Jaeschke](https://discourse.opengeosys.org/u/M_Jaeschke)\
**Post date:** [April 2, 2024, 8:50am UTC](https://discourse.opengeosys.org/t/initial-conditions-in-bhe-simulation/1394/4 "2024-04-02T08:50:51Z")

</div>

Dear Farid,

do you want to make the density of `AqueousLiquid` in a defined `media` temperature dependent? Then you must name it `temperature` and it works - the reason for this, is also not clear for me. If you want to modeling the refrigerant density as a temperature dependent function, it is from my knowledge not yet possible.

Best regards,  
Max

---

<div class="post-metadata">

**Author:** ![saturngreen67](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/saturngreen67/32/1168_2.png) [@saturngreen67](https://discourse.opengeosys.org/u/saturngreen67)\
**Post date:** [April 2, 2024, 9:05am UTC](https://discourse.opengeosys.org/t/initial-conditions-in-bhe-simulation/1394/5 "2024-04-02T09:05:13Z")

</div>

Dear Max,

Yes, It is precisely as you said. I will try it then. I appreciate your help and support.

Best regards,  
Farid Arabameri
