Skip to content

SoilProperties API Reference

geoloop.geoloopcore.soilproperties.SoilProperties

Store soil thermal properties, including geotherm (temperature vs. depth) and thermal conductivity profiles (depth-dependent or lithology-based).

Supports: - Depth-based interpolation of ground temperature Tg(z) - Depth-based or lithology-based interpolation of k_s(z) - Scaling of conductivity profiles

__init__

__init__(
    Tg: list | float,
    k_s: list | float,
    z_Tg: list = None,
    Tgrad: float = 0.0,
    z_k_s: list = None,
    k_s_scale: float = 1.0,
    lithology_to_k: ProcessLithologyToThermalConductivity = None,
    alfa: float = 1e-06,
) -> None

Initialize SoilProperties, containing ground temperature and thermal conductivity as functions of depth.

Parameters:

Name Type Description Default
Tg float or list

Ground temperature(s) used for interpolation. - If array-list: temperature at depths specified by z_Tg. - If float: constant surface temperature for linear gradient computation.

required
k_s float or list

Thermal conductivity values (W/m·K), possibly depth-dependent. If list-like, entries correspond to depths in z_k_s.

required
z_Tg list or None

Depth values (m) corresponding to Tg samples. If None, temperature is assumed constant or determined by Tgrad.

None
Tgrad float

Vertical geothermal gradient (K/m). Default is 0 (no gradient).

0.0
z_k_s list or None

Depth values (m) corresponding to k_s samples. If None, conductivity is assumed constant at all depths.

None
k_s_scale float

Scaling factor applied to thermal conductivity profiles (default 1.0).

1.0
lithology_to_k lithology_to_k or None

If provided, conductivity is derived from lithology-based profiles using the lithology_to_k lookup structure instead of k_s/z_k_s.

None
alfa float

Thermal diffusivity of the ground (m²/s). Default is 1e-6.

1e-06
Notes
  • If lithology_to_k is provided, the lithology-based thermal conductivity profile overrides k_s and z_k_s.
  • This constructor initializes two interpolators:
    • interpolatorTg – for temperature vs. depth
    • interpolatorKs – for conductivity vs. depth

getTg

getTg(z: float | ndarray) -> float | np.ndarray

Return ground temperature at depth z.

get_k_s

get_k_s(
    zstart: ndarray, zend: ndarray, isample: int = 0
) -> np.ndarray

Retrieves and interpolates thermal conductivity-depth profile for depth-segments in the simulation, for the basecase in a single simulation or for the specified sample in a stochastic simulation.

Parameters:

Name Type Description Default
zstart ndarray

Array of starting depths of each segment.

required
zend ndarray

Array of ending depths of each segment.

required
isample int

Index selecting conductivity sample from lithology_to_k (default 0).

0

Returns:

Type Description
ndarray

Thermal conductivity-depth profile with depth-resolution for the depth-segments in the simulation.

from_config classmethod

from_config(config: SingleRunConfig) -> SoilProperties

Build a SoilProperties object from a configuration object.

Parameters:

Name Type Description Default
config SingleRunConfig

Object containing entries including Tg, k_s, stratigraphy, scaling, lithology parameters, and diffusivity.

required

Returns:

Type Description
SoilProperties