# Help needed in 3D BHE CXA design

**URL:** <https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713>\
**Category:** Help & Support\
**Tags:** ogs6\
**Created:** [October 22, 2025, 12:22pm UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713 "2025-10-22T12:22:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![xenner](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/xenner/32/1458_2.png) [@xenner](https://discourse.opengeosys.org/u/xenner)\
**Post date:** [October 22, 2025, 12:22pm UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713/1 "2025-10-22T12:22:03Z")

</div>

Hello all,

I am a drilling engineer and we are working on a technology to reach approximately 20km by rotary drilling. The objective with this technology is to create big bore coaxial enhanced closed loop geothermal well. The drilling design design is done but I am not an expert in geothermal simulation software. I have tried Waiwera software but found out it was not capable of simulating of supercritical conditions of water.

During my journey i stumbled upon OpenGeoSys and the work of Dr. Chaofan Chen which exactly matches our case except the depths and additional hydraulic stimulation scenarios. [Dr Chaofan Chen CXA BHE design](https://www.opengeosys.org/docs/benchmarks/heat-transport-bhe/3d_coaxial_deep_bhe/) and [Files](https://gitlab.opengeosys.org/ogs/ogs/-/tree/master/Tests/Data/Parabolic/T/3D_deep_BHE)

See below the scematic of a CXA setup but with the comments of the parameters I am looking to simulation. Our flowrate will be maximum 230 liters per second.

 ![Screenshot 2025-10-22 at 14.04.50](https://discourse.opengeosys.org/uploads/default/original/2X/d/d4f40050afa09a8b2b4e7d55c09411efb3b1ca25.jpeg)

After trying myself several days unsuccessfully I decided to send Dr. Chaofan Chen a message and he indicated that here on the forum are probably people who can help me setup the system for simulation.

So therefore a humble request if there is anyone here who can help me to setup my scenario with the 2 frac scenarios to help me simulate the geothermal performance of the well over time.

Another question I have in case there are geological specialist around here. We are working with the theory (and field proven) that fractured rocks can thermally merge over time and that then the frac radius and total interval length can be counted as a full downhole heat exchanger. In case of 100 fracs in 8000m this thermal merging would take 30 years and in case of 200 fracs in 4000m this thermal merging would take 1.3 years. Some people say the thermal merging time can be fully ignored when the fracs are filled with a solid super thermal material (scenario 2) Does anyone have experience in this or can comment on this?

Many many thanks! Jan

---

<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:** [October 23, 2025, 9:15am UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713/2 "2025-10-23T09:15:28Z")

</div>

Hello Jan,

thanks for your interest using OGS for this interesting questions. We recommend to start with a simple model like the one of Chaofan and get this running on your machine. If you encounter concrete issues with this simple case, we should be able to help you relatively fast.

Regarding your questions of the fractures: In the BHE process of OGS it is from my knowledge not possible, to consider fractures directly. One idea to consider the filled fractures, is to assign a new material id to some specific elements in the pre processing to handle the fractures as own material in the prj-file. This simple tutorial of ogstools may help you with this: [Setting initial properties and variables in bulk meshes — ogstools 0.7.1 documentation](https://ogstools.opengeosys.org/stable/auto_examples/howto_preprocessing/plot_initial_properties_and_variables.html#sphx-glr-auto-examples-howto-preprocessing-plot-initial-properties-and-variables-py)

As a simpler starting point, you can also make thin layers with different properties to test the general behavior. For the meshing, maybe this tool can help you: [Creating a BHE mesh (Borehole Heat Exchanger) — ogstools 0.7.1 documentation](https://ogstools.opengeosys.org/stable/auto_examples/howto_preprocessing/plot_gen_bhe_mesh.html#sphx-glr-auto-examples-howto-preprocessing-plot-gen-bhe-mesh-py)

So start as simple as possible and if you encounter specific problems with this, just write us here in the post.

Best regards, Max

---

<div class="post-metadata">

**Author:** ![xenner](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/xenner/32/1458_2.png) [@xenner](https://discourse.opengeosys.org/u/xenner)\
**Post date:** [October 23, 2025, 3:55pm UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713/3 "2025-10-23T15:55:15Z")

</div>

Hi Max,

After working out howto setup a mesh (in docker + macosx) i found that this code somewhat works.

root ➜ /workspace/cxc/adjusted/test $ cat mesh8.py  
import pyvista as pv  
import pathlib  
from typing import List  
import os  
import ogstools as ot  
from ogstools.meshlib import Mesh  
from ogstools.meshlib.gmsh\_BHE import BHE, gen\_bhe\_mesh

# Debug: Check Gmsh and environment

print(“Gmsh version:”)  
os.system(“gmsh --version”)  
print(“Temporary files before meshing:”)  
os.system(“ls -l /tmp/\*.msh || echo ‘No .msh files found’”)

# Scaling factor for mesh sizes (based on depth increase: 16300 / 70 ≈ 232.857)

scaling\_factor = 16300.0 / 70.0  
inner\_mesh\_size = 6.0 \* (scaling\_factor \*\* 0.5) # Square root scaling for balance  
outer\_mesh\_size = 12.0 \* (scaling\_factor \*\* 0.5)  
dist\_box\_x = 3.0 \* (scaling\_factor \*\* 0.5)  
dist\_box\_y = 3.0 \* (scaling\_factor \*\* 0.5)  
target\_z\_size\_coarse = 100.0 # Reduced for stability  
target\_z\_size\_fine = 50.0 # Reduced for stability

# Generate the 3D mesh

print(“Input parameters:”, {  
“length”: 70.0,  
“width”: 20.0,  
“layer”: [16300.0],  
“groundwater”: ,  
“BHE”: [{“x”: 1.0, “y”: 10.0, “z\_begin”: -10.0, “z\_end”: -16210.0, “borehole\_radius”: 0.108}],  
“meshing\_type”: “structured”,  
“refinement”: {“dist\_box\_x”: dist\_box\_x, “dist\_box\_y”: dist\_box\_y,  
“inner\_mesh\_size”: inner\_mesh\_size, “outer\_mesh\_size”: outer\_mesh\_size}  
})

try:  
bhe\_meshes = gen\_bhe\_mesh(  
length=70.0,  
width=20.0,  
layer=[16300.0],  
groundwater=,  
BHE\_Array=[  
BHE(  
x=1.0,  
y=10.0,  
z\_begin=-10.0,  
z\_end=-16210.0,  
borehole\_radius=0.108  
),  
],  
target\_z\_size\_coarse=target\_z\_size\_coarse,  
target\_z\_size\_fine=target\_z\_size\_fine,  
n\_refinement\_layers=3, # Increased for smoother transitions  
meshing\_type=“structured”, # Changed to supported type  
dist\_box\_x=dist\_box\_x,  
dist\_box\_y=dist\_box\_y,  
inner\_mesh\_size=inner\_mesh\_size,  
outer\_mesh\_size=outer\_mesh\_size,  
propagation=1.2,  
order=1,  
out\_name=pathlib.Path(“domain.vtu”)  
)  
except Exception as e:  
print(“Mesh generation failed:”, str(e))  
print(“Fallback files are inappropriate for 16300m domain. Please check meshing parameters.”)  
raise

print(“Temporary files after meshing:”)  
os.system(“ls -l /tmp/\*.msh || echo ‘No .msh files found’”)

def load\_and\_plot(mesh\_filenames: List[str]):  
pv.set\_plot\_theme(“document”)  
plotter = pv.Plotter(off\_screen=True)  
domain\_mesh\_pv = pv.read(mesh\_filenames[0])  
print(“Domain mesh arrays:”, domain\_mesh\_pv.array\_names)  
bhe\_line = domain\_mesh\_pv.extract\_cells\_by\_type(pv.CellType.LINE)  
if “MaterialIDs” in domain\_mesh\_pv.array\_names:  
plotter.add\_mesh(  
domain\_mesh\_pv,  
scalars=“MaterialIDs”,  
cmap=“viridis”,  
show\_scalar\_bar=True,  
scalar\_bar\_args={“title”: “Material IDs”},  
opacity=0.8,  
)  
else:  
print(“MaterialIDs not found. Available arrays:”, domain\_mesh\_pv.array\_names)  
plotter.add\_mesh(domain\_mesh\_pv, style=“surface”, color=“grey”, opacity=0.8)  
plotter.add\_mesh(domain\_mesh\_pv, style=“wireframe”, color=“black”, opacity=0.3)  
plotter.add\_mesh(bhe\_line, color=“red”, line\_width=3)  
offsets = [(0, 0, 100), (0, 0, -100), (2, 0, 0)]  
for submesh\_file, offset in zip(mesh\_filenames[1:], offsets, strict=False):  
submesh\_pv = pv.read(submesh\_file)  
print(f"Submesh {submesh\_file}:", submesh\_pv)  
plotter.add\_mesh(  
submesh\_pv.translate(offset), show\_edges=True, color=“lightgrey”, opacity=0.7  
)  
plotter.camera\_position = “iso”  
plotter.screenshot(“deep\_bhe\_plot.png”)  
print(“Mesh generated! Plot saved as ‘deep\_bhe\_plot.png’.”)  
print(“Filenames:”, mesh\_filenames)

load\_and\_plot(bhe\_meshes)

But if i load this one with [https://gitlab.opengeosys.org/ogs/ogs/-/raw/master/Tests/Data/Parabolic/T/3D\_deep\_BHE/3D\_deep\_BHE\_CXA.prj](https://gitlab.opengeosys.org/ogs/ogs/-/raw/master/Tests/Data/Parabolic/T/3D_deep_BHE/3D_deep_BHE_CXA.prj) (adjusted for the depth ofcourse)

It seems to give me output temperatures of 25 degrees Celsius but Im expecting more like 300 degrees Celsius.

The simulation does run and it does produce the vtu files but the result in temperature isn’t correct. I am suspecting it is not applying a geothermal gradient (i looking at 3 deg.C per 100mtrs)

Kind regards,

Jan

---

<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:** [October 24, 2025, 7:19pm UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713/4 "2025-10-24T19:19:33Z")

</div>

Hi Jan,

sorry for the delay in response. Very good, that the meshing somehow works. I didn’t get all the code lines in these few minutes, but due to the running simulation I assume it’s fine.🙂

The initial soil temperature is set constant to 25 in the provided prj-file from the benchmark. If you want a simple geothermal gradient in the initial temperature field you can change the definition of the parameter T0.

```xml
<parameter>
      <name>T0</name>
     <type>Function</type>
     <expression>25-0.03*z</expression>
</parameter>

```

Please note that the z-coordinate is negative, if the top surface start at 0m. So you will get a linear increase with greater depths in the initial field. With this higher temperatures in the initial field, your simulated temperatures of the BHE should be as expected.

I hope, that this helps you. If you further questions, just write me here in this channel.

Good luck with your simulation!

Kind regards,  
Max

---

<div class="post-metadata">

**Author:** ![xenner](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/xenner/32/1458_2.png) [@xenner](https://discourse.opengeosys.org/u/xenner)\
**Post date:** [October 25, 2025, 6:58pm UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713/5 "2025-10-25T18:58:13Z")

</div>

Hi Max thank you!  
I found this one out too. Do you know perhaps if I also need to do something with BHE1?

Also I was thinking of the mesh… the bottom 4000mtr will be fracked every 20mtrs to approximately 480mtr radius. Do I need to create a mesh of 1000mtr diameter x 16200mtr length then? To accomodate this? For simplicity i imagine the fractures as radial discs with +/- 0.5" diameter going down to 0 in the tip…

With the frac network my objective is to create a full diameter downhole heat exchanger that can support the heat demand from the well, There is theory of thermal merging of fracs that says that within year X the thermal merging of the fracs is completed and you can use the whole cilinder volume as heat exchanger. For example for frac spacing 100mtr this is 30 years but for 20mtr this is 1.3 years. I would like to model this into OGS just to determine my required frac radius to create a sustainable system that reduces the temperature less then 0,5 celsius degrees downhole (depending of flow rate ofcourse). I have no idea howto model this into ogs so any help is welcome 😃

Kind regards,

Jan

---

<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:** [October 27, 2025, 6:47am UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713/6 "2025-10-27T06:47:50Z")

</div>

Hi Jan,

I think a constant initial temperature for the BHE will be fine, nevertheless you can use the function parameter with the number of components for the used BHE type - the CXC type has 3 components I think. (You can see this easy in the prj-file in the specification of the process variable temperature\_BHE1.)

For your model area: A bit more soil below your BHE will be good, especially with a boundary condition like a geothermal flux from the bottom surface. To get this radial oriented mesh and the fractures as complete elements, you need to script it your own in gmsh - maybe the source code of the ogstools function will help with this. But at this point, I’m not familiar how to model fractures. I was simply thinking on an own material id for the elements of the fracture and use an own medium definition for it.

And one important thing to note: The CXC BHE in OGS is a closed loop, so no liquid from the BHE will get in contact with the surrounding soil.

Best regards,  
Max

---

<div class="post-metadata">

**Author:** ![xenner](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/xenner/32/1458_2.png) [@xenner](https://discourse.opengeosys.org/u/xenner)\
**Post date:** [October 30, 2025, 8:27am UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713/7 "2025-10-30T08:27:55Z")

</div>

Thanks Max,

Another question I have this in my prj  
  
  
  
  
AqueousLiquid  
  
  
phase\_velocity  
Constant  
0 0 0  
  
  
specific\_heat\_capacity  
Constant  
4068  
  
  
density  
Constant  
992.92

How can I adapt this for super critical fluid? So that it calculates it for example from the python iapws library or any other way?

Kind regards,

Jan

---

<div class="post-metadata">

**Author:** ![MaxDax](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/m/e9bcb4/32.png) [@MaxDax](https://discourse.opengeosys.org/u/MaxDax)\
**Post date:** [October 30, 2025, 12:26pm UTC](https://discourse.opengeosys.org/t/help-needed-in-3d-bhe-cxa-design/1713/8 "2025-10-30T12:26:48Z")

</div>

Hi Jan,  
Some of the IAPWS parameter library are implemented as their own type see for example here: [OGS: [tag] WaterDensityIAPWSIF97Region1](https://doxygen.opengeosys.org/dd/d97/ogs_file_param __properties__ property__waterdensityiapwsif97region1)

I think the problem is the BHE process is T only so it does not solve the hydraulic equation so you don’t have pressure as a primary variable also for the iapws types. It seems there was not yet a need to extend this. Other options would be to write a function yourself for the parameters using the depth and temperature [https://doxygen.opengeosys.org/d9/dfe/ogs\_file\_param\_\_properties\_\_property\_\_function](https://doxygen.opengeosys.org/d9/dfe/ogs_file_param __properties__ property__function)  
Similar topic is also this phase velocity tag. When you want to have a groundwater flow you can give the darcy velocity as x y z vectors, but it is not coupled with the temperature.  
As far is i know you can’t use a python script for the soil parameters. Hope i could help.  
Best Maxi
