ProcessLithologyToThermalConductivity API Reference
geoloop.lithology.process_lithology.ProcessLithologyToThermalConductivity
Handles the calculation procedure of subsurface thermal conductivities based on lithological data.
Attributes:
| Name | Type | Description |
|---|---|---|
lithology_props_df |
DataFrame
|
DataFrame containing physical properties and thermal parameters for different lithologies, adopted from Hantschel & Kauerauf (2009). |
borehole_df |
DataFrame
|
DataFrame containing borehole lithological description (depth and lithology data). |
Tg |
float
|
Surface temperature (in °C). |
Tgrad |
float
|
Average geothermal gradient (in °C/km). |
z_Tg |
float
|
Depth at which the (sub)surface temperature |
phi_scale |
float
|
Scaling factor for porosity over depth. Induces uniform variation in porosity values during sampling of different porosity-depth profiles in a stochastic (MC) simulation. |
lithology_scale |
float
|
Scaling factor for lithology fraction over depth. Induces uniform variation in lithology fraction values during sampling of different porosity-depth profiles in a stochastic (MC) simulation. |
lithology_error |
float
|
Depth-independent error applied to lithology fraction during sampling of different porosity-depth profiles in a stochastic (MC) simulation. |
nsamples |
int
|
Number of thermal conductivity-depth profiles to generate and store. |
basecase |
bool
|
Whether to run the simulation in "base case" mode. In base case mode, no scaling and/or error values are applied to the porosity and lithology profiles in the thermal conductivity calculation. |
out_dir |
str
|
Path to the directory where files with subsurface properties are saved. |
out_table |
str
|
Name of the file (.h5) for storing the table with subsurface properties. |
read_from_table |
bool
|
Whether to read precomputed results of subsurface thermal conductivities from an existing file or compute real-time. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any required input is missing or incompatible. |
create_lithology_props_dict
Creates a dictionary of physical and thermal properties for different lithologies, in the correct format for the thermal conductivity calculations. Property values are adopted from the Hantschel & Kauerauf (HK) database.
Dictionary maps the physical and thermal properties from the HK classification to the corresponding variables in the thermal conductivity calculations.
Returns:
| Type | Description |
|---|---|
dict
|
Mapping |
create_borehole_lithology_props_classification
Merge borehole lithology sheet with HK classification table and create columns with HK IDs for lithology a and b.
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame containing lithological classification along borehole, with thermal properties and added columns 'Lithology_ID_a' and 'Lithology_ID_b'. |
from_config
classmethod
Create a ProcessLithologyToThermalConductivity instance from a configuration dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
LithologyConfig
|
Configuration dictionary with required keys. |
required |
Returns:
| Type | Description |
|---|---|
ProcessLithologyToThermalConductivity
|
Initialized instance. |
create_single_thermcon_profile
Calculates depth-dependent subsurface properties, for a specific sample of the loaded or calculated subsurface properties table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isample
|
int
|
Sample index (0 is basecase). |
required |
Returns:
| Type | Description |
|---|---|
ThermalConductivityResults
|
Object with arrays depth, lithology fraction, porosity and kh_bulk. |
create_multi_thermcon_profiles
Create thermal conductivity profiles for all requested (stochastic) samples (or read from .h5 file).
If read_from_table is True, read data from out_dir/out_table. Otherwise compute samples in run time.
Returns:
| Type | Description |
|---|---|
None (results are stored internally).
|
|
get_thermcon_sample_profile
Retrieves depth-dependent subsurface properties for a specific sample in the precomputed table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isample
|
int
|
Sample index (use -1 to request basecase which is index 0). |
required |
Returns:
| Type | Description |
|---|---|
ThermalConductivityResults
|
Results container for the requested sample. |
save_thermcon_sample_profiles
Save the computed sample profiles to a NetCDF (.h5) file using xarray.
The dataset will contain variables: - kh_bulk (depth x n_samples) - phi (depth x n_samples) - lithology_a_fraction (depth x n_samples)
Returns:
| Type | Description |
|---|---|
None (results are saved directly to the specified output file).
|
|