hyvr package

Submodules

hyvr.assign_points module

hyvr.assign_points.assign_points()

This function does all the dirty work of assigning grid cells to their stratum, ae, or geometrical object.

hyvr.assign_points.maybe_assign_points_to_ae()

Return facies, azim and dip if the cell is inside this AE. Assigns values to point if point is in current ae

Parameters
  • ae (AERealization object) –

  • geo_ids (np.int32 array of size 4) – This holds the geological indices, i.e. facies number, architectural element number, hydrofacies assemblage (ha) and hydrofacies assemblage type (hat).

  • angles (np.ndarray[np.float, dim=1]) – Array of length 2 that holds the azimuth and dip angles, will also be altered.

  • y, z (x,) – cell coordinates

  • y_idx (x_idx,) – indices of x and y position in grid.

  • oi (int) – Object index of the last found object. This can be used as a starting point for the next cell.

  • grid (Grid object) –

Returns

oi – Object index of the last found object. This can be used as a starting point for the next cell.

Return type

int

hyvr.assign_points.maybe_assign_points_to_stratum()

Tries to assign the point in question to an architectural element in the stratum, if it is inside the stratum.

Parameters
  • stratum_aes (list of architectural element objects) –

  • n_ae (int) – Number of AEs in stratum

  • geo_ids (np.int32 array of size 4) – This holds the geological indices, i.e. facies number, architectural element number, hydrofacies assemblage (ha) and hydrofacies assemblage type (hat).

  • angles (np.float array of size 2) – Holds azimuth and dip angle

  • y, z (x,) – x, y, and z position of the point that should be assigned

  • y_idx (x_idx,) – x and y indices in the grid

  • aei (int) – Architectural element index. This is passed, so that we only have to search in elements above the previous one for the right architectural element.

  • oi (int) – Object index.

  • grid (Grid object) –

hyvr.optimized module

This module contains optimized versions of routines that were once in sim or utils.

Author

Samuel Scherrer

hyvr.optimized.curve_interp()

Interpolate evenly spaced points along a curve. This code is based on code in an answer posted by ‘Unutbu’ on http://stackoverflow.com/questions/19117660/how-to-generate-equispaced-interpolating-values (retrieved 17/04/2017)

Parameters
  • xc – x coordinates of curve

  • yc – y coordinates of curve

  • spacing – Spacing between points

Returns

  • xn - x coordinates of interpolated points

  • yn - y coordinates of interpolated points

hyvr.optimized.set_anisotropic_ktensor()

Calculate and set the anisotropic conductivity tensor for every grid point

Parameters
  • ktensors (np.ndarray, dtype = np.float, shape = (nx, ny, nz, 3, 3)) – The matrix of conductivity tensors. This matrix will be altered in place.

  • k_iso (np.ndarray, dtype = np.float, shape = (nx, ny, nz)) – The matrix of isotropic hydraulic conductivities

  • azim (np.ndarray, dtype = np.float, shape = (nx, ny, nz)) – The matrix of azimuth angles (in radians)

  • dip (np.ndarray, dtype = np.float, shape = (nx, ny, nz)) – The matrix of dip angles (in radians)

  • anirat (np.ndarray, dtype = np.float, shape = (nx, ny, nz)) – The matrix of anisotropy ratios

Returns

Return type

None

hyvr.sim module

Hydrogeological Virtual Reality simulation package.

Hydrogeological virtual reality (HYVR) simulator for object-based modelling of sedimentary structures

Author

Jeremy P. Bennett, Samuel Scherrer

hyvr.sim.run(inifile, flag_ow=None)[source]

Runs HyVR based on a given ini-file.

Parameters
  • inifile (path) – Path to inifile. If inifile is set to 0, the ini-file for the MADE test case is used.

  • flag_ow (bool) – Whether to overwrite existing run directories.

hyvr.utils module

Some utility functions for HFM modelling

Authors

Jeremy P. Bennett, with help from Alessandro Comunian and Samuel Scherrer

Notes

hyvr.utils.get_alternating_facies(num_facies, type_params)[source]

Returns a vector of alternating facies numbers based on the ‘altfacies’ setting in the inifile.

hyvr.utils.print_to_stdout(*args)[source]

Prints a message to stdout with timestamp.

hyvr.utils.specsim(grid, var, corl, selection_mask=None, two_dim=False, covmod='gaussian')[source]

Generate random variables with stationary covariance function using spectral techniques of Dietrich & Newsam (1993)

Parameters
  • grid (Grid instance) –

  • var (float) – Variance

  • corl (tuple of floats) – Tuple of correlation lengths. 2-tuple for 2-d (x and y), and 3-tuple for 3-d (x, y, z).

  • selection_mask (boolean numpy array) – This array should have the same size as the model grid and can be used to only generate random variables for a subset of the model grid. If two_dim=True, it should have dimensions (nx, ny), otherwise (nx, ny, nz).

  • two_dim (bool, optional (default: False)) – Whether to return a two-dimensional or a 3 dimensional field

  • covmod (str, optional (default: "gaussian")) – Which covariance model to use (“gaussian” or “exp”).

Returns

Y – Numpy array of random field. If no selection mask was given, this is either a 2d or 3d numpy array, depending on two_dim and of the size of the model grid. If a selection_mask was given, this is a flat array of values.

Return type

1d, 2d, or 3d numpy array