Skip to content

API Reference

Bases: BaseAquifer

Aquifer with statistically distributed thickness and permeability.

Used as input to ThermoGISDoublet when reservoir properties are uncertain. Thickness follows a normal distribution and permeability a log-normal distribution. Pass p_values to ThermoGISDoublet.simulate to sample realisations at specific percentile levels.

Parameters:

Name Type Description Default
thickness_mean float or array

Mean aquifer thickness [m]. Must be >= 0.

required
thickness_sd float or array

Standard deviation of aquifer thickness [m]. Must be >= 0.

required
ln_permeability_mean float or array

Mean of the natural log of permeability [ln(mD)].

required
ln_permeability_sd float or array

Standard deviation of the natural log of permeability [ln(mD)].

required
porosity float or array

Aquifer porosity [-], between 0 and 1.

required
ntg float or array

Net-to-gross ratio [-], between 0 and 1.

required
depth float or array

Aquifer depth [m].

required
temperature float or array

Reservoir temperature [°C]. If not provided, it is calculated from depth using the temperature gradient and surface temperature in UTCSettings when passed to ThermoGISDoublet.

required
mask float or array

Mask array. Cells where the mask is not NaN are excluded from the simulation. Defaults to NaN (no masking).

required
Source code in pythermogis/aquifer.py
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
class StochasticAquifer(BaseAquifer):
    """Aquifer with statistically distributed thickness and permeability.

    Used as input to ``ThermoGISDoublet`` when reservoir properties are
    uncertain. Thickness follows a normal distribution and permeability a
    log-normal distribution. Pass ``p_values`` to ``ThermoGISDoublet.simulate``
    to sample realisations at specific percentile levels.

    Parameters
    ----------
    thickness_mean : float or array
        Mean aquifer thickness [m]. Must be >= 0.
    thickness_sd : float or array
        Standard deviation of aquifer thickness [m]. Must be >= 0.
    ln_permeability_mean : float or array
        Mean of the natural log of permeability [ln(mD)].
    ln_permeability_sd : float or array
        Standard deviation of the natural log of permeability [ln(mD)].
    porosity : float or array
        Aquifer porosity [-], between 0 and 1.
    ntg : float or array
        Net-to-gross ratio [-], between 0 and 1.
    depth : float or array
        Aquifer depth [m].
    temperature : float or array, optional
        Reservoir temperature [°C]. If not provided, it is calculated from
        ``depth`` using the temperature gradient and surface temperature in
        ``UTCSettings`` when passed to ``ThermoGISDoublet``.
    mask : float or array, optional
        Mask array. Cells where the mask is not ``NaN`` are excluded from the
        simulation. Defaults to ``NaN`` (no masking).
    """

    thickness_mean: FloatOrArray
    thickness_sd: FloatOrArray
    ln_permeability_mean: FloatOrArray
    ln_permeability_sd: FloatOrArray

    @field_validator("thickness_mean", "thickness_sd", mode="after")
    @classmethod
    def check_non_negative(cls, value: FloatOrArray, info) -> FloatOrArray:
        if isinstance(value, xr.DataArray):
            if (value < 0.0).any():
                raise ValueError(
                    f"{info.field_name} must always be >= 0.0; "
                    f"negative values are not allowed"
                )
        elif value < 0.0:
            raise ValueError(
                f"{info.field_name} must always be >= 0.0; "
                f"negative values are not allowed"
            )
        return value

    def calculate_temperature(
        self, temperature_gradient: float, surface_temperature: float
    ) -> None:
        self.temperature = calculate_temperature_from_gradient(
            self.depth, self.thickness_mean, temperature_gradient, surface_temperature
        )