Output
Simulation results
Simulation.run() returns T_history, a NumPy array of shape:
(n_steps + 1, n_bhes, n_dof)
where:
n_steps + 1— timesteps, index 0 is the initial conditionn_bhes— number of boreholesn_dof— total degrees of freedom per borehole
The state vector along the third axis follows the domain layout described in Discretization:
[ sup | ground | borehole | inf ]
Any quantity can be extracted by computing the correct offset into this
vector. The examples in examples/ cover the most common cases; users
can freely extend them to extract any quantity of interest.
Offsets
nsup = m_mesh_sup + 1 # start of ground domain
nground = n_mesh * m_mesh # start of borehole domain
Extracting results
Outlet fluid temperature over time for borehole b:
Tfout = T_history[1:, b, nsup + nground + (props_b.n_equations - 1)]
Shell temperature vertical profile at timestep t:
slice_shell = [
nsup + nground + j * props_b.n_equations
for j in range(m_mesh)
]
T_shell = T_history[t, b, slice_shell]
Fluid down/up temperature vertical profile at timestep t:
slice_down = [
nsup + nground + j * props_b.n_equations + (props_b.n_equations - 2)
for j in range(m_mesh)
]
slice_up = [
nsup + nground + j * props_b.n_equations + (props_b.n_equations - 1)
for j in range(m_mesh)
]
T_down = T_history[t, b, slice_down]
T_up = T_history[t, b, slice_up]
The offsets n_equations - 2 and n_equations - 1 always point to
fluid down and fluid up regardless of BHE type.
Depth axis
To associate profile values with physical depth:
import numpy as np
dz = model.ground[0].dz
depth = np.arange(-L_sup, -L_sup - dz * m_mesh, -dz)
depth has length m_mesh and matches the profile arrays element-by-element.
Note
Complete working examples are available in the examples/ directory
of the repository, covering single-borehole, parallel, and series configurations.