Advice on a curved CXC BHE Model with different soil properties

Hello! I am trying to simulate a curved well co-axial centered BHE (i.e., the entirety of a horizontal well) using the tutorial provided. I’m more focused on looking at how it would affect the soil temperature over a period of time. But from testing it, I see that even when I set the well trajectory in the mesh, vtu and the geometry file, the only location I would see the exchange happen would be at the top and toe of the well. Is using the BHE heat transport model the best way to go about this or is there another way that would be better suited for my situation? The other thing I would also like to introduce is having an insulated tubing portion on the well and multiple soil formation in the model as well. Thanks!

Hi, horizontal heat exchangers are a bit more complex to model with OpenGeoSys but I think it’s possible. The BHE is an additional line in the mesh and the inflow and outflow node is determined by the highest z-coordinate or if this is not possible by the smallest node id. For vertical BHE cases we have this meshing tool in ogstools. For horizontal there is manual coding with gmsh needed, but maybe the source code of this tool can help you in this case. From my point of view the heat transport BHE is the right for your case. If you provide a meshing script, I can take a look.

Additional note: Normally horizontal heat exchangers are just single pipes, for this we have the BHE of 1P type in OpenGeoSys.

Hi M_Jaeschke,

Sorry for the really late reply. For some reason, it’s not allowing me to add attachments onto the message here. Best I can do is upload the content of my geo file here. I was hoping that it would follow the entirety of the horizontal well but maybe I’m just doing it wrong.

// Gmsh project created on Wed Jun 04 15:40:15 2025
SetFactory(“OpenCASCADE”);
//+
Box(1) = {0, 0, 0, 20, 20, -50};
//+
Point(9) = {10, 10, -10, 1.0};
//+
Point(10) = {10, 10, -20, 1.0};
//+
Point(11) = {10, 10, -30, 1.0};
//+
Point(12) = {10, 10, -35, 1.0};
//+
Point(13) = {15, 10, -40, 1.0};
//+
Point(14) = {18, 10, -40, 1.0};
//+
Point(15) = {12, 10, -38, 1.0};
//+
Line(13) = {9, 10};
//+
Line(14) = {10, 11};
//+
Line(15) = {11, 12};
//+
Line(16) = {12, 15};
//+
Line(17) = {15, 13};
//+
Line(18) = {13, 14};
//+
Point(16) = {10, 8.675056, -10, 1.0};
//+
Point(17) = {10, 11.324944, -10, 1.0};
//+
Point(18) = {11.147401504, 10.662472, -10, 1.0};
//+
Point(19) = {8.852598496, 10.662472, -10, 1.0};
//+
Point(20) = {8.852598496, 9.337528, -10, 1.0};
//+
Point(21) = {11.147401504, 9.337528, -10, 1.0};
//+
Line(19) = {19, 20};
//+
Line(20) = {20, 16};
//+
Line(21) = {16, 21};
//+
Line(22) = {21, 18};
//+
Line(23) = {18, 17};
//+
Line(24) = {17, 19};
//+
Recursive Delete {
Curve{18};
}
//+
Recursive Delete {
Curve{17};
}
//+
Recursive Delete {
Curve{16};
}
//+
Point(22) = {10, 10, -45, 1.0};
//+
Recursive Delete {
Point{22};
}
//+
Recursive Delete {
Curve{15};
}
//+
Recursive Delete {
Curve{14};
}
//+
Recursive Delete {
Curve{13};
}
//+
Point(22) = {10, 10, 0, 1.0};
//+
Point(23) = {10, 10, 0, 0.5};
//+
Recursive Delete {
Point{22};
}
//+
Recursive Delete {
Point{23};
}
//+
Point(22) = {10, 10, -10, 0.5};
//+
Point(23) = {10, 10, -40, 0.5};
//+
Line(25) = {22, 23};
//+
Curve Loop(7) = {21, 22, 23, 24, 19, 20};
//+
Plane Surface(7) = {7};
//+
Wire(8) = {25};
Extrude { Surface{7}; } Using Wire {8}

//+
Extrude {{0, -1, 0}, {11.147401504, 9.337528, -40}, Pi/2} {
Surface{15}; Layers{3}; Recombine;
}
//+
Point(40) = {11.147401504, 10, -41.147401504, 0.5};
//+
Point(41) = {18.147401504, 10, -41.147401504, 0.5};
//+
Line(55) = {40, 41};
//+
Wire(23) = {55};
Extrude { Surface{21}; } Using Wire {23}

Dear Deylin Yiao,
i also had a look on your meshing script. Two notes i would recommend using triangle prisms for the BHE parts, so you have to use the recombine feature in the extrusion. As the extrude along a wire can’t recombine in gmsh you can’t use this feature (see also). But i think with opencascade you are not able to do a twisting extrude, which you need for the connection between the two straight parts. From your geo file I constructed a mesh that is close to the geometry you envisioned. But you still have to adapt it to your needs as it is not exactly the same. Also i just used some values for the mesh size without thinking about the later simulation… Additionally you did not mesh the 6 surrounding points of your BHE node according to the method published by Diersch et al. at least not the given mesh size at the points (4th entry for the Point call) which is also the base for the BHE process in OGS. I hope my geo file helps!
Best Max

radius = 2;
//+
Point(9) = {10, 10, -10, 1.5};
//+
Point(16) = {10, 8.675056, -10, 1.5};
//+
Point(17) = {10, 11.324944, -10, 1.5};
//+
Point(18) = {11.147401504, 10.662472, -10, 1.5};
//+
Point(19) = {8.852598496, 10.662472, -10, 1.5};
//+
Point(20) = {8.852598496, 9.337528, -10, 1.5};
//+
Point(21) = {11.147401504, 9.337528, -10, 1.5};
//+
Line(19) = {19, 20};
//+
Line(20) = {20, 16};
//+
Line(21) = {16, 21};
//+
Line(22) = {21, 18};
//+
Line(23) = {18, 17};
//+
Line(24) = {17, 19};

Curve Loop(7) = {21, 22, 23, 24, 19, 20};
//+
Plane Surface(7) = {7};
//+
Point{9} In Surface{7};
Extrude {0,0,-30} {
  Surface{7}; Layers{30};Recombine;
}

Extrude {0,0,-30} {
  Point{9}; Layers{30};Recombine;
}

Extrude { {1,0,0} , {10, 10 + radius, -40} , Pi/2 } {
  Surface{56}; Layers{10}; Recombine;
}

Extrude { {1,0,0} , {10, 10 + radius, -40} , Pi/2 } {
  Point{40}; Layers{10}; Recombine;
}

Extrude {0,10,0} {
  Surface{89}; Layers{10};Recombine;
}

Extrude {0,10,0} {
  Point{97}; Layers{10};Recombine;
}


Point(1) = { 0,  0,   0, 5};
Point(2) = { 0, 30,   0, 5};
Point(3) = {30, 30,   0, 5};
Point(4) = {30,  0,   0, 5};

Line(1000) = {1,2};
Line(1001) = {2,3};
Line(1002) = {3,4};
Line(1003) = {4,1};
Curve Loop(1000) = {1000:1003};
Plane Surface(1000) = {1000};


Point(5) = { 0,  0, -50, 5};
Point(6) = { 0, 30, -50, 5};
Point(7) = {30, 30, -50, 5};
Point(8) = {30,  0, -50, 5};

Line(1004) = {5,6};
Line(1005) = {6,7};
Line(1006) = {7,8};
Line(1007) = {8,5};
Curve Loop(1001) = {1004:1007};
Plane Surface(1001) = {1001};

Line(1008) = {1,5};
Line(1009) = {2,6};
Line(1010) = {3,7};
Line(1011) = {4,8};

Curve Loop(1002) = {1000,1009, -1004, -1008};
Plane Surface(1002) = {1002};

Curve Loop(1003) = {1001,1010, -1005, -1009};
Plane Surface(1003) = {1003};

Curve Loop(1004) = {1002,1011, -1006, -1010};
Plane Surface(1004) = {1004};

Curve Loop(1005) = {1003,1008, -1007, -1011};
Plane Surface(1005) = {1005};

Surface Loop(1) = {1000:1005, 7, 35, 39, 43,47,51,55,68,72,76,80,84,88,117,101,121,105,109,113,122};

Volume(5) = {1};

Physical Volume("domain")={1,2,3,5};

Physical Line("bhe")={57,90,123};

Mesh 3; 
Coherence Mesh;
1 Like