HomeFeaturesExamplesTutorialsHelpTheoryVerificationPricingContact
BoreTherm / TutorialsTutorial 15 / 19
Workflow and theory · Advanced physics

3D analysis (FEM)

What the command Run 3D analysis (menu Calculation › Run 3D analysis) computes, how the finite element model of the ground is built and solved, how its result is compared with the analytic design, and what can be reused. The numbers come from the example project: one borehole of 100 m with a single U-pipe in homogeneous ground (λ = 2.0 W/(m·K)), heating-only monthly ground loads of 6.7 MWh a year with 6-hour heating peaks of up to 4.2 kW, a design period of 2 years, and the Coarse mesh.

01 / The one idea

The one idea: the same step response, computed on a mesh

Every design calculation in BoreTherm rests on the step response of the ground: the temperature at the borehole wall after a constant heat rate of 1 W/m starts at t = 0. Made dimensionless it is the g-function. The analytic model, which the program calls 2D, gets it from finite line sources: each borehole is a line of finite length that releases heat into the ground below a surface held at constant temperature. This model serves every design command: Calculation › Calculate, Calculation › Size borehole length, Calculation › Optimize, Tools › Parametric study and Tools › Monte Carlo. The 3D analysis computes the step response with the finite element method (FEM: the ground divided into small cells, the heat equation solved on them) on a mesh of the ground. The loads enter afterwards, by superposition (a load history is a sum of load steps, so its response is the sum of shifted step responses), in the same way for both. One FEM run therefore serves every load case.

Two ways to the step response of the ground, one superpositionAnalytic model (2D)finite line sources, superposed;used by Calculate, Size boreholelength, Optimize and the studiesFEM model (3D)the ground on a 3D mesh;unit step 1 W/m in every boreholeg-function g2D(t)g3D(t) and field Φ(x, t)Loadsmonthly base + peaksTemporal superpositionthe same code for both sidesTf,2D = the design resultTf,3D and the ground temperatureΔ = 3D − 2Dtab 2D / 3DThe 3D result is a second opinion next to the design. It never overwrites the design results.
The design always uses the analytic side. The 3D analysis adds the FEM side and the difference Δ, and it keeps the FEM field Φ(x, t) to show the ground temperature.
Step response (g-function), q = 1 W/mg(t) = 2πλ · Tw(t) / q
Ground temperature fieldT(x, t) = Tu(z) + Σ Δqi Φ(x, t − ti)
Mean fluid temperature at the end of month n (Δqi = qi − qi−1, W/m, > 0 into the ground)Tf(tn) = Tm + Σi Δqi · g(tn − ti−1) / (2πλ) + qn Rb*

λ: thermal conductivity of the ground; Tw: borehole wall temperature; Tu(z): undisturbed ground temperature at depth z; Φ: the temperature field after a unit step of 1 W/m; Tf: mean fluid temperature, the average of inlet and outlet; Tm: undisturbed ground temperature averaged over the borehole; Rb*: effective borehole thermal resistance between the fluid and the borehole wall.

The comparison is Δ = Tf,3D − Tf,2D, per year and over the period. The 2D side is recomputed with the analytic g-function on the FEM's time grid, so that only the g-function differs.

02 / The workflow

The workflow

The 3D analysis is an extra step after the design. It answers two questions: is the analytic result right for this ground and this field, and what does the ground around the field look like over the years?

Design the borefield with the analytic modelCalculate, Size borehole lengthDoes the design need a 3D checkor a picture of the ground?noyesThe 2D design is the resulthomogeneous or mildlylayered ground, verticalboreholes, no flowSimple FEM on the Project pagemesh: Auto or Suggest; check the estimate;Calculation › Run 3D analysis;read Δ on the 2D / 3D tab|Δ| small against themargin to the limits?yesnoKeep the designreport the 3D check, maps, plumeCheck mesh, then refinestill large: adjust the length (the 3DTf must stay inside the limits)Reasons for a 3D check:• strong layer contrast, sections• groundwater flow• inclined boreholesLoads changed later? Run again: only the superposition is redone (milliseconds).
The analytic design comes first. The 3D analysis checks it; it does not size the field in the GUI.

In the program the 3D analysis is switched on on the Project page (3D analysis: Simple FEM, the analysis described here; Full FEM is a further level that time-steps the ground with the actual loads) and has one page of its own:

set the levelProject3D analysis:Off, Simple FEM, Full FEMAdvanced analysis › 3D / Full FEM › 3D analysisleft: mesh, domain, estimate, Run 3D analysisright: 3D view · Plan map · Section · 2D / 3DResults › Thermal plumesource 2D, 3Dor overlaidSaveFEM results file (sidecar)the FEM run: g-functions, mesh, field;read on Open, packed by Pack projectResults cache%LOCALAPPDATA%\BoreTherm\femcache, 2 GBDesign resultsSummary, Temperature:unchanged (2D)Full FEM, the next level, uses the same mesh, domain and solver settings, but runs on Full FEM › Physics & run.
Simple FEM shows the 3D analysis page. Its results are kept apart from the design results; File › Save writes them next to the project.
  • 3D analysis page, left: the mesh (Auto, Coarse, Medium, Fine, Very fine, Custom), the elements (hexahedra or tetrahedra), cells per ground layer, the domain, the estimate (nodes, memory, run time, expected error of g), Suggest and Check mesh, then Run 3D analysis and the temperature field settings (thresholds, evaluation lines, VTU export).
  • Right: 3D view (mesh coloured by layer, cell size, quality or temperature), Plan map and Section of the ground temperature, 2D / 3D with the chart and the table of the comparison.
03 / What Run 3D analysis does

What Run 3D analysis does

1 FingerprintSHA-256 of the inputs thatchange the FEM runSame fingerprint in memory,sidecar or cache?2 Meshgraded hexahedra (vertical)or tetrahedra (inclined)6 Superpose the loadsTf with g3D and with g2D,field from the frames4 Time steppingbackward Euler, levels double,6 steps per level3 Assembleconduction K, lumped C,boreholes as line points7 Show and keepΔ per year, maps, section;write the cache5 Wall temperaturewell index + near-field corr.;analytic shape below tPnoyes: no FEM rung3D, ΦThe 2D side: the analyticg-function on the sametime grid as the FEM.Steps 2–5 are the FEM run. File › Save writes it next to the project file.
Steps 2–5 are the FEM run. When the fingerprint matches saved or cached results, they are skipped and only step 6 runs.
  1. Fingerprint. A SHA-256 over every input that can change the FEM run: field and layout geometry, ground and layers, groundwater, borehole construction and sections, fluid and flow, network, boundary condition, mesh and domain settings, design period and the time grid. Loads, limits, names and costs are not part of it.
  2. Mesh. A graded tensor-product grid of hexahedra for vertical boreholes; an adaptive tetrahedral mesh as soon as a borehole is inclined (Elements: Auto). Small cells at the borehole axes, ends, layer interfaces and section boundaries; they grow by the growth ratio away from them.
  3. Assemble. Conduction matrix K of trilinear elements, lumped heat capacity C, the ground at T = 0 on all faces. Each borehole is a line of points carrying its share of the heat.
  4. Time stepping. Backward Euler, (C/Δt + K) Tn+1 = C/Δt Tn + f. The steps are constant inside a time level and each level is twice as long as the one before, so one factorisation serves a level.
  5. Wall temperature. The node on the axis sees the average of its cells, not the wall. The well index adds q · ln(c h / rb)/(2πλ); a near-field correction removes the lag of the first levels. Before tP = h²/(4α) (h the cell size at the axis, α the thermal diffusivity of the ground), the time below which the mesh cannot resolve the borehole, the response keeps the shape of the analytic self response, scaled to the FEM value at tP.
  6. Superpose. The monthly loads (and peaks) of the project give Tf with g3D and with g2D, the comparison per year, and the ground temperature from the stored frames.
04 / The mesh

The mesh

Section x–z, true scale0 m104 m208 m74.5 mdepthPlan around the borehole, ±15.7 maxis node, ×10reqrbcells from the axis: 1.00, 1.00, 1.04, 1.37, 1.80 … mCoarse presethMin 1.0 m at the axis, hAxial 10 m,hMax 40 m, growth 1.3Axis cells (violet)2 cells of hMin on each sideof the axis, then growthWell indexreq = c·h = 0.1154 × 1.0 m = 0.115 mmust exceed rb = 0.075 mBorehole endsone hMin cell above and below thetop and the bottom (cubes there)
The grid of the example project, read from the saved results. Left: the whole block; the dense band is the refinement at the axis. Middle: the cells around the borehole; the inset enlarges the axis node with the borehole radius rb and the equivalent radius req = c·h of the well index (dashed).

The block must be large enough that its faces stay at the undisturbed temperature: its sides lie at least 4 √(α tend) from the field (tend: the last time of the time grid), where the temperature change is below 0.5 % of the change at the boreholes. The cell at the axis must be larger than the borehole: the line source in a cell behaves like a borehole of radius c·h (c ≈ 0.115, calibrated), so h is raised to at least 1.1 rb/c ≈ 9.5 rb. A finer mesh therefore does not mean smaller cells at the axis; it refines the rest of the block and the time steps.

05 / Theory

Theory: how close are 2D and 3D, and why

g-function: analytic and FEM1 h10 h100 h1000 h10⁴ h012345analytic (2D) solidFEM (3D) dashedtimegFEM against analytic: g3D / g2D − 11 h10 h100 h1000 h10⁴ h−0.6−0.4−0.20.0tPtime%scaled analytic shapemesh resolves it
Left: the two g-functions of the example project lie on top of each other. Right: the FEM value is 0.43 % lower at the end. Before tP = 83 h the FEM value is the analytic self response, scaled to match the FEM at tP.

For a single borehole both models describe the same physics: conduction in a homogeneous ground with an isothermal surface. The remaining difference of about 0.4 % comes from the discretisation and from the boundary condition (a uniform wall temperature, UBWT, solved on the mesh and with the segments of the analytic model). It changes the fluid temperature by hundredths of a kelvin:

Mean fluid temperature, 2 years16121824−4−20246810base loadheating peak (6 h)month of operation°CΔ = Tf,3D − Tf,2D161218240.000.010.020.030.04basepeakmonth of operationK
Left: Tf with the analytic (solid) and the FEM g-function (dashed); the curves coincide. Right: Δ per month for the base load and the 6-hour heating peak.
Why the 3D analysis matters even when Δ is small. Δ measures what the analytic model leaves out for this project. For one borehole in homogeneous ground there is nothing left out, and Δ ≈ 0 confirms that the mesh is good enough. With strongly contrasting layers, groundwater flow, borehole sections or inclined boreholes the analytic model uses effective properties or approximations, and the FEM takes them as they are: there Δ is the check of the design.

Is the mesh fine enough? The same project run with each mesh preset (g at the last time of the grid; the lowest Tf of the period, 2D: −2.933 °C):

Meshg3D/g2D − 1Tf,min 3DΔ against 2D
Coarse (example)−0.43 %−2.909 °C0.025 K
Medium−0.44 %−2.908 °C0.026 K
Fine−0.44 %−2.908 °C0.025 K
Very fine−0.48 %−2.907 °C0.027 K
Auto−0.43 %−2.908 °C0.025 K

For this single borehole every preset gives the same answer within a few hundredths of a per cent: Coarse is enough here. For a field of many boreholes the presets differ more; there Check mesh (the chosen mesh against one 1.5 times coarser) estimates the error of g before you trust Δ.

Why a load change needs no new run. The FEM is linear: constant properties, T = 0 initial and boundary values. Its g-function and its field are responses to a unit step, and any load history is a sum of steps. Changing the monthly loads, the per-year loads, the design limits, the thresholds or the evaluation lines only redoes the superposition (milliseconds). Changing the geometry, the ground, the flow, the mesh or the period changes the fingerprint: the page then says The inputs changed since the 3D analysis: run it again.

06 / How each result is derived

How each result is derived

ResultHow BoreTherm derives itExample project
Meshtensor-product grid nx × ny × nz; hexahedra (nx−1)(ny−1)(nz−1); unknowns = interior nodes23 × 23 × 40 = 21160 nodes; 18876 Hex8; 16759 unknowns
Domainmargin = larger of 4 √(α tend) and the field-size rule (3 × field width, 2 × depth)4 √(8.33·10⁻⁷ m²/s × 1.04·10⁸ s) = 37.2 m → 74.5 × 74.5 × 208 m
Cell at the axishMin = max(preset, 1.1 rb/c): the equivalent radius c·h must exceed rbmax(1.0, 0.71) = 1.0 m; c = 0.1154
Time steppinglevels of doubling length, 6 backward-Euler steps each, up to the last time of the grid12 levels, 69 steps to 3.3 a
Analytic below tPtP = h²/(4α): the mesh cannot resolve the hole earlier1² / (4 × 8.33·10⁻⁷) = 300000 s = 83 h
g-functiong = 2πλ Tw/q for q = 1 W/m (UBWT: the common wall temperature)last time: 3D 5.075, 2D 5.097 (−0.43 %)
Energy balanceQ Δt = ΔE + Δt · heat through the faces, at every step3.51·10⁻¹³ relative
Fieldthe ground part of the solution at every step (float32), stored losslessly compressed69 frames, 4.6 MB; sidecar file 0.59 MB
Comparisonper year min / max of Tf over base and peak loads; Δ = 3D − 2DTf,min −2.93 → −2.91 °C (Δ 0.025 K)

Run figures from the saved FEM results; the FEM run took 1.0 s on the development PC.

07 / The example in numbers

The example in numbers

Comparison table of the 2D / 3D tab (minimum and maximum mean fluid temperature per year, including peaks):

YearTf,min 2DTf,min 3DΔ min [K]Tf,max 2DTf,max 3DΔ max [K]
1−2.11 °C−2.08 °C0.0238.60 °C8.61 °C0.004
2−2.93 °C−2.91 °C0.0258.34 °C8.35 °C0.006

Largest difference of the monthly base-load fluid temperature: 0.018 K. The design limit is −3.0 °C. The design keeps it with a margin of 0.07 K; the FEM g-function moves Tf,min by 0.025 K, so the 3D analysis confirms the design.

  1. Open the example project with its saved FEM results. The page shows From saved results.
  2. Calculation › Run 3D analysis: the saved run is reused, only the superposition runs.
  3. Look at the 3D view, the Plan map and the Section at years 1 and 2; read the 2D / 3D tab.
  4. Change a monthly load and run again: still no FEM run. Change the borehole length: the results are out of date and the next run is a new FEM run.
08 / Limits to keep in mind

Limits to keep in mind

  • Design and sizing stay analytic in the GUI. Calculate, Size borehole length, Optimize and the studies never use the 3D result. If Δ is large and the mesh is checked, adjust the design so that the 3D Tf stays inside the limits (the command-line program boretherm-cli can size with settings.gfunction.engine = FEM).
  • Peaks are only partly checked. A 6-hour peak lies below tP (83 h at hMin 1 m), where the FEM g-function follows the scaled analytic shape. The temperature field contains the monthly base loads only; peaks reach centimetres to decimetres into the ground.
  • Simple FEM is linear. Constant properties, no freezing, superposed loads, steady-state boreholes. The direct time stepping with the actual loads is Full FEM, the next level on the Project page.
  • Coarse is a preview. Use Suggest or Check mesh before trusting Δ for a field. Hexahedra take vertical boreholes only; inclined fields use tetrahedra.
  • Groundwater on hexahedra. The well index assumes conduction around the axis; at strong flow the late-time g can be about 1 % low.
  • Memory. Above the field memory limit (default 1000 MB) only every k-th time step is kept and values between them are interpolated.

Numbers calculated with BoreTherm. Theory: BoreTherm theory manual.